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 b9197e0f2a2..09b07f9419d 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 @@ -109,8 +109,8 @@ message SpeechWordInfo { // phase. // // The client provides this configuration in terms of the durations of those -// two phases. The durations are measured in terms of the audio length from -// the start of the input audio. +// two phases. The durations are measured in terms of the audio length from the +// start of the input audio. // // The flow goes like below: // 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 index 26c7bd7c766..0d175831833 100644 --- a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/conversation.proto +++ b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/conversation.proto @@ -24,15 +24,20 @@ import "google/cloud/dialogflow/v2beta1/conversation_profile.proto"; import "google/cloud/dialogflow/v2beta1/generator.proto"; import "google/cloud/dialogflow/v2beta1/participant.proto"; import "google/cloud/dialogflow/v2beta1/session.proto"; +import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; -option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.Dialogflow.V2Beta1"; option go_package = "cloud.google.com/go/dialogflow/apiv2beta1/dialogflowpb;dialogflowpb"; option java_multiple_files = true; option java_outer_classname = "ConversationProto"; option java_package = "com.google.cloud.dialogflow.v2beta1"; option objc_class_prefix = "DF"; +option (google.api.resource_definition) = { + type: "discoveryengine.googleapis.com/DataStore" + pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}" + pattern: "projects/{project}/locations/{location}/dataStores/{data_store}" +}; // Service for managing // [Conversations][google.cloud.dialogflow.v2beta1.Conversation]. @@ -328,9 +333,9 @@ message CreateConversationRequest { // 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 + // The conversation ID must be compliant with the regression formula // `[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 + // If the field is provided, the caller is responsible 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. @@ -706,6 +711,183 @@ message GenerateStatelessSuggestionResponse { // The request message for // [Conversations.SearchKnowledge][google.cloud.dialogflow.v2beta1.Conversations.SearchKnowledge]. message SearchKnowledgeRequest { + // The source of the query. We use QuerySource to distinguish queries directly + // entered by agents and suggested queries from + // [Participants.SuggestKnowledgeAssist][google.cloud.dialogflow.v2beta1.Participants.SuggestKnowledgeAssist]. + // If SUGGESTED_QUERY source is specified, we will treat it as a continuation + // of a SuggestKnowledgeAssist call. + enum QuerySource { + // Unknown query source. + QUERY_SOURCE_UNSPECIFIED = 0; + + // The query is from agents. + AGENT_QUERY = 1; + + // The query is a suggested query from + // [Participants.SuggestKnowledgeAssist][google.cloud.dialogflow.v2beta1.Participants.SuggestKnowledgeAssist]. + SUGGESTED_QUERY = 2; + } + + // Configuration specific to search queries with data stores. + message SearchConfig { + // Boost specifications for data stores. + message BoostSpecs { + // Boost specification to boost certain documents. + // A copy of google.cloud.discoveryengine.v1main.BoostSpec, field + // documentation is available at + // https://cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1alpha/BoostSpec + message BoostSpec { + // Boost applies to documents which match a condition. + message ConditionBoostSpec { + // Specification for custom ranking based on customer specified + // attribute + // value. It provides more controls for customized ranking than the + // simple (condition, boost) combination above. + message BoostControlSpec { + // The attribute(or function) for which the custom ranking is to be + // applied. + enum AttributeType { + // Unspecified AttributeType. + ATTRIBUTE_TYPE_UNSPECIFIED = 0; + + // The value of the numerical field will be used to dynamically + // update the boost amount. In this case, the attribute_value (the + // x value) of the control point will be the actual value of the + // numerical field for which the boost_amount is specified. + NUMERICAL = 1; + + // For the freshness use case the attribute value will be the + // duration between the current time and the date in the datetime + // field specified. The value must be formatted as an XSD + // `dayTimeDuration` value (a restricted subset of an ISO 8601 + // duration value). The pattern for this is: + // `[nD][T[nH][nM][nS]]`. E.g. `5D`, `3DT12H30M`, `T24H`. + FRESHNESS = 2; + } + + // The interpolation type to be applied. Default will be linear + // (Piecewise Linear). + enum InterpolationType { + // Interpolation type is unspecified. In this case, it defaults to + // Linear. + INTERPOLATION_TYPE_UNSPECIFIED = 0; + + // Piecewise linear interpolation will be applied. + LINEAR = 1; + } + + // The control points used to define the curve. The curve defined + // through these control points can only be monotonically increasing + // or decreasing(constant values are acceptable). + message ControlPoint {} + + // Optional. The name of the field whose value will be used to + // determine the boost amount. + string field_name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The attribute type to be used to determine the boost + // amount. The attribute value can be derived from the field value + // of the specified field_name. In the case of numerical it is + // straightforward i.e. attribute_value = numerical_field_value. In + // the case of freshness however, attribute_value = (time.now() - + // datetime_field_value). + AttributeType attribute_type = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The interpolation type to be applied to connect the + // control points listed below. + InterpolationType interpolation_type = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The control points used to define the curve. The + // monotonic function (defined through the interpolation_type above) + // passes through the control points listed here. + repeated ControlPoint control_points = 4 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. An expression which specifies a boost condition. The + // syntax and supported fields are the same as a filter expression. + // Examples: + // + // * To boost documents with document ID "doc_1" or "doc_2", and + // color + // "Red" or "Blue": + // * (id: ANY("doc_1", "doc_2")) AND (color: ANY("Red","Blue")) + string condition = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Strength of the condition boost, which should be in [-1, + // 1]. Negative boost means demotion. Default is 0.0. + // + // Setting to 1.0 gives the document a big promotion. However, it does + // not necessarily mean that the boosted document will be the top + // result at all times, nor that other documents will be excluded. + // Results could still be shown even when none of them matches the + // condition. And results that are significantly more relevant to the + // search query can still trump your heavily favored but irrelevant + // documents. + // + // Setting to -1.0 gives the document a big demotion. However, results + // that are deeply relevant might still be shown. The document will + // have an upstream battle to get a fairly high ranking, but it is not + // blocked out completely. + // + // Setting to 0.0 means no boost applied. The boosting condition is + // ignored. + float boost = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Complex specification for custom ranking based on + // customer defined attribute value. + BoostControlSpec boost_control_spec = 4 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. Condition boost specifications. If a document matches + // multiple conditions in the specifictions, boost scores from these + // specifications are all applied and combined in a non-linear way. + // Maximum number of specifications is 20. + repeated ConditionBoostSpec condition_boost_specs = 1 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. Data Stores where the boosting configuration is applied. The + // full names of the referenced data stores. Formats: + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` + // `projects/{project}/locations/{location}/dataStores/{data_store}` + repeated string data_stores = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/DataStore" + } + ]; + + // Optional. A list of boosting specifications. + repeated BoostSpec spec = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Filter specification for data store queries. + message FilterSpecs { + // Optional. The data store where the filter configuration is applied. + // Full resource name of data store, such as + // projects/{project}/locations/{location}/collections/{collectionId}/ + // dataStores/{dataStoreId}. + repeated string data_stores = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The filter expression to be applied. + // Expression syntax is documented at + // https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata#filter-expression-syntax + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. Boost specifications for data stores. + repeated BoostSpecs boost_specs = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter specification for data store queries. + repeated FilterSpecs filter_specs = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + // Required. The parent resource contains the conversation profile // Format: 'projects/' or `projects//locations/`. @@ -753,6 +935,35 @@ message SearchKnowledgeRequest { type: "dialogflow.googleapis.com/Message" } ]; + + // Optional. The source of the query in the request. + QuerySource query_source = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Information about the end-user to improve the relevance and + // accuracy of generative answers. + // + // This will be interpreted and used by a language model, so, for good + // results, the data should be self-descriptive, and in a simple structure. + // + // Example: + // + // ```json + // { + // "subscription plan": "Business Premium Plus", + // "devices owned": [ + // {"model": "Google Pixel 7"}, + // {"model": "Google Pixel Tablet"} + // ] + // } + // ``` + google.protobuf.Struct end_user_metadata = 9 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configuration specific to search queries with data stores. + SearchConfig search_config = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether to search the query exactly without query rewrite. + bool exact_search = 14 [(google.api.field_behavior) = OPTIONAL]; } // The response message for @@ -793,6 +1004,9 @@ message SearchKnowledgeAnswer { // The relevant snippet of the article. string snippet = 3; + + // Metadata associated with the article. + google.protobuf.Struct metadata = 5; } // The piece of text from the knowledge base documents that answers diff --git a/packages/google-cloud-dialogflow/protos/protos.d.ts b/packages/google-cloud-dialogflow/protos/protos.d.ts index 13151bc9221..3218468b8e1 100644 --- a/packages/google-cloud-dialogflow/protos/protos.d.ts +++ b/packages/google-cloud-dialogflow/protos/protos.d.ts @@ -66230,111 +66230,894 @@ export namespace google { /** SearchKnowledgeRequest latestMessage */ latestMessage?: (string|null); + + /** SearchKnowledgeRequest querySource */ + querySource?: (google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.QuerySource|keyof typeof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.QuerySource|null); + + /** SearchKnowledgeRequest endUserMetadata */ + endUserMetadata?: (google.protobuf.IStruct|null); + + /** SearchKnowledgeRequest searchConfig */ + searchConfig?: (google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.ISearchConfig|null); + + /** SearchKnowledgeRequest exactSearch */ + exactSearch?: (boolean|null); + } + + /** Represents a SearchKnowledgeRequest. */ + class SearchKnowledgeRequest implements ISearchKnowledgeRequest { + + /** + * Constructs a new SearchKnowledgeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ISearchKnowledgeRequest); + + /** SearchKnowledgeRequest parent. */ + public parent: string; + + /** SearchKnowledgeRequest query. */ + public query?: (google.cloud.dialogflow.v2beta1.ITextInput|null); + + /** SearchKnowledgeRequest conversationProfile. */ + public conversationProfile: string; + + /** SearchKnowledgeRequest sessionId. */ + public sessionId: string; + + /** SearchKnowledgeRequest conversation. */ + public conversation: string; + + /** SearchKnowledgeRequest latestMessage. */ + public latestMessage: string; + + /** SearchKnowledgeRequest querySource. */ + public querySource: (google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.QuerySource|keyof typeof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.QuerySource); + + /** SearchKnowledgeRequest endUserMetadata. */ + public endUserMetadata?: (google.protobuf.IStruct|null); + + /** SearchKnowledgeRequest searchConfig. */ + public searchConfig?: (google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.ISearchConfig|null); + + /** SearchKnowledgeRequest exactSearch. */ + public exactSearch: boolean; + + /** + * Creates a new SearchKnowledgeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchKnowledgeRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ISearchKnowledgeRequest): google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest; + + /** + * Encodes the specified SearchKnowledgeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.verify|verify} messages. + * @param message SearchKnowledgeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ISearchKnowledgeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchKnowledgeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.verify|verify} messages. + * @param message SearchKnowledgeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ISearchKnowledgeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchKnowledgeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchKnowledgeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest; + + /** + * Decodes a SearchKnowledgeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchKnowledgeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest; + + /** + * Verifies a SearchKnowledgeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchKnowledgeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchKnowledgeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest; + + /** + * Creates a plain object from a SearchKnowledgeRequest message. Also converts values to other types if specified. + * @param message SearchKnowledgeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchKnowledgeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchKnowledgeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Represents a SearchKnowledgeRequest. */ - class SearchKnowledgeRequest implements ISearchKnowledgeRequest { + namespace SearchKnowledgeRequest { + + /** QuerySource enum. */ + enum QuerySource { + QUERY_SOURCE_UNSPECIFIED = 0, + AGENT_QUERY = 1, + SUGGESTED_QUERY = 2 + } + + /** Properties of a SearchConfig. */ + interface ISearchConfig { + + /** SearchConfig boostSpecs */ + boostSpecs?: (google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.IBoostSpecs[]|null); + + /** SearchConfig filterSpecs */ + filterSpecs?: (google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.IFilterSpecs[]|null); + } + + /** Represents a SearchConfig. */ + class SearchConfig implements ISearchConfig { + + /** + * Constructs a new SearchConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.ISearchConfig); + + /** SearchConfig boostSpecs. */ + public boostSpecs: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.IBoostSpecs[]; + + /** SearchConfig filterSpecs. */ + public filterSpecs: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.IFilterSpecs[]; + + /** + * Creates a new SearchConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchConfig instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.ISearchConfig): google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig; + + /** + * Encodes the specified SearchConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.verify|verify} messages. + * @param message SearchConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.ISearchConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.verify|verify} messages. + * @param message SearchConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.ISearchConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig; + + /** + * Decodes a SearchConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig; + + /** + * Verifies a SearchConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig; + + /** + * Creates a plain object from a SearchConfig message. Also converts values to other types if specified. + * @param message SearchConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SearchConfig { + + /** Properties of a BoostSpecs. */ + interface IBoostSpecs { + + /** BoostSpecs dataStores */ + dataStores?: (string[]|null); + + /** BoostSpecs spec */ + spec?: (google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.IBoostSpec[]|null); + } + + /** Represents a BoostSpecs. */ + class BoostSpecs implements IBoostSpecs { + + /** + * Constructs a new BoostSpecs. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.IBoostSpecs); + + /** BoostSpecs dataStores. */ + public dataStores: string[]; + + /** BoostSpecs spec. */ + public spec: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.IBoostSpec[]; + + /** + * Creates a new BoostSpecs instance using the specified properties. + * @param [properties] Properties to set + * @returns BoostSpecs instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.IBoostSpecs): google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs; + + /** + * Encodes the specified BoostSpecs message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.verify|verify} messages. + * @param message BoostSpecs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.IBoostSpecs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoostSpecs message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.verify|verify} messages. + * @param message BoostSpecs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.IBoostSpecs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoostSpecs message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoostSpecs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs; + + /** + * Decodes a BoostSpecs message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoostSpecs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs; + + /** + * Verifies a BoostSpecs message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoostSpecs message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoostSpecs + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs; + + /** + * Creates a plain object from a BoostSpecs message. Also converts values to other types if specified. + * @param message BoostSpecs + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoostSpecs to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoostSpecs + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BoostSpecs { + + /** Properties of a BoostSpec. */ + interface IBoostSpec { + + /** BoostSpec conditionBoostSpecs */ + conditionBoostSpecs?: (google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.IConditionBoostSpec[]|null); + } + + /** Represents a BoostSpec. */ + class BoostSpec implements IBoostSpec { + + /** + * Constructs a new BoostSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.IBoostSpec); + + /** BoostSpec conditionBoostSpecs. */ + public conditionBoostSpecs: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.IConditionBoostSpec[]; + + /** + * Creates a new BoostSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns BoostSpec instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.IBoostSpec): google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec; + + /** + * Encodes the specified BoostSpec message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.verify|verify} messages. + * @param message BoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.IBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoostSpec message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.verify|verify} messages. + * @param message BoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.IBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoostSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec; + + /** + * Decodes a BoostSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec; + + /** + * Verifies a BoostSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoostSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoostSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec; + + /** + * Creates a plain object from a BoostSpec message. Also converts values to other types if specified. + * @param message BoostSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoostSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoostSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BoostSpec { + + /** Properties of a ConditionBoostSpec. */ + interface IConditionBoostSpec { + + /** ConditionBoostSpec condition */ + condition?: (string|null); + + /** ConditionBoostSpec boost */ + boost?: (number|null); + + /** ConditionBoostSpec boostControlSpec */ + boostControlSpec?: (google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.IBoostControlSpec|null); + } + + /** Represents a ConditionBoostSpec. */ + class ConditionBoostSpec implements IConditionBoostSpec { + + /** + * Constructs a new ConditionBoostSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.IConditionBoostSpec); + + /** ConditionBoostSpec condition. */ + public condition: string; + + /** ConditionBoostSpec boost. */ + public boost: number; + + /** ConditionBoostSpec boostControlSpec. */ + public boostControlSpec?: (google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.IBoostControlSpec|null); + + /** + * Creates a new ConditionBoostSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns ConditionBoostSpec instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.IConditionBoostSpec): google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec; + + /** + * Encodes the specified ConditionBoostSpec message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @param message ConditionBoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.IConditionBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConditionBoostSpec message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @param message ConditionBoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.IConditionBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConditionBoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec; + + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConditionBoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec; + + /** + * Verifies a ConditionBoostSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConditionBoostSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConditionBoostSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec; + + /** + * Creates a plain object from a ConditionBoostSpec message. Also converts values to other types if specified. + * @param message ConditionBoostSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConditionBoostSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConditionBoostSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ConditionBoostSpec { + + /** Properties of a BoostControlSpec. */ + interface IBoostControlSpec { + + /** BoostControlSpec fieldName */ + fieldName?: (string|null); + + /** BoostControlSpec attributeType */ + attributeType?: (google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType|keyof typeof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType|null); + + /** BoostControlSpec interpolationType */ + interpolationType?: (google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType|keyof typeof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType|null); + + /** BoostControlSpec controlPoints */ + controlPoints?: (google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint[]|null); + } + + /** Represents a BoostControlSpec. */ + class BoostControlSpec implements IBoostControlSpec { + + /** + * Constructs a new BoostControlSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.IBoostControlSpec); + + /** BoostControlSpec fieldName. */ + public fieldName: string; + + /** BoostControlSpec attributeType. */ + public attributeType: (google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType|keyof typeof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType); + + /** BoostControlSpec interpolationType. */ + public interpolationType: (google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType|keyof typeof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType); + + /** BoostControlSpec controlPoints. */ + public controlPoints: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint[]; + + /** + * Creates a new BoostControlSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns BoostControlSpec instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.IBoostControlSpec): google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec; + + /** + * Encodes the specified BoostControlSpec message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify|verify} messages. + * @param message BoostControlSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.IBoostControlSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoostControlSpec message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify|verify} messages. + * @param message BoostControlSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.IBoostControlSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoostControlSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoostControlSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec; + + /** + * Decodes a BoostControlSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoostControlSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec; + + /** + * Verifies a BoostControlSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoostControlSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoostControlSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec; + + /** + * Creates a plain object from a BoostControlSpec message. Also converts values to other types if specified. + * @param message BoostControlSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoostControlSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoostControlSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BoostControlSpec { + + /** AttributeType enum. */ + enum AttributeType { + ATTRIBUTE_TYPE_UNSPECIFIED = 0, + NUMERICAL = 1, + FRESHNESS = 2 + } + + /** InterpolationType enum. */ + enum InterpolationType { + INTERPOLATION_TYPE_UNSPECIFIED = 0, + LINEAR = 1 + } + + /** Properties of a ControlPoint. */ + interface IControlPoint { + } - /** - * Constructs a new SearchKnowledgeRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.ISearchKnowledgeRequest); + /** Represents a ControlPoint. */ + class ControlPoint implements IControlPoint { - /** SearchKnowledgeRequest parent. */ - public parent: string; + /** + * Constructs a new ControlPoint. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint); - /** SearchKnowledgeRequest query. */ - public query?: (google.cloud.dialogflow.v2beta1.ITextInput|null); + /** + * Creates a new ControlPoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ControlPoint instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint): google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint; - /** SearchKnowledgeRequest conversationProfile. */ - public conversationProfile: string; + /** + * Encodes the specified ControlPoint message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify|verify} messages. + * @param message ControlPoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint, writer?: $protobuf.Writer): $protobuf.Writer; - /** SearchKnowledgeRequest sessionId. */ - public sessionId: string; + /** + * Encodes the specified ControlPoint message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify|verify} messages. + * @param message ControlPoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint, writer?: $protobuf.Writer): $protobuf.Writer; - /** SearchKnowledgeRequest conversation. */ - public conversation: string; + /** + * Decodes a ControlPoint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ControlPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint; - /** SearchKnowledgeRequest latestMessage. */ - public latestMessage: string; + /** + * Decodes a ControlPoint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ControlPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint; - /** - * Creates a new SearchKnowledgeRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns SearchKnowledgeRequest instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.ISearchKnowledgeRequest): google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest; + /** + * Verifies a ControlPoint message. + * @param message 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 SearchKnowledgeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.verify|verify} messages. - * @param message SearchKnowledgeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.ISearchKnowledgeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a ControlPoint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ControlPoint + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint; - /** - * Encodes the specified SearchKnowledgeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.verify|verify} messages. - * @param message SearchKnowledgeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ISearchKnowledgeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a plain object from a ControlPoint message. Also converts values to other types if specified. + * @param message ControlPoint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes a SearchKnowledgeRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SearchKnowledgeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest; + /** + * Converts this ControlPoint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Decodes a SearchKnowledgeRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SearchKnowledgeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest; + /** + * Gets the default type url for ControlPoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + } - /** - * Verifies a SearchKnowledgeRequest message. - * @param message 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 FilterSpecs. */ + interface IFilterSpecs { - /** - * Creates a SearchKnowledgeRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SearchKnowledgeRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest; + /** FilterSpecs dataStores */ + dataStores?: (string[]|null); - /** - * Creates a plain object from a SearchKnowledgeRequest message. Also converts values to other types if specified. - * @param message SearchKnowledgeRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** FilterSpecs filter */ + filter?: (string|null); + } - /** - * Converts this SearchKnowledgeRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Represents a FilterSpecs. */ + class FilterSpecs implements IFilterSpecs { - /** - * Gets the default type url for SearchKnowledgeRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; + /** + * Constructs a new FilterSpecs. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.IFilterSpecs); + + /** FilterSpecs dataStores. */ + public dataStores: string[]; + + /** FilterSpecs filter. */ + public filter: string; + + /** + * Creates a new FilterSpecs instance using the specified properties. + * @param [properties] Properties to set + * @returns FilterSpecs instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.IFilterSpecs): google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.FilterSpecs; + + /** + * Encodes the specified FilterSpecs message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.FilterSpecs.verify|verify} messages. + * @param message FilterSpecs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.IFilterSpecs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FilterSpecs message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.FilterSpecs.verify|verify} messages. + * @param message FilterSpecs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.IFilterSpecs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FilterSpecs message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FilterSpecs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.FilterSpecs; + + /** + * Decodes a FilterSpecs message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FilterSpecs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.FilterSpecs; + + /** + * Verifies a FilterSpecs message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FilterSpecs message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FilterSpecs + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.FilterSpecs; + + /** + * Creates a plain object from a FilterSpecs message. Also converts values to other types if specified. + * @param message FilterSpecs + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.FilterSpecs, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FilterSpecs to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FilterSpecs + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } } /** Properties of a SearchKnowledgeResponse. */ @@ -66576,6 +67359,9 @@ export namespace google { /** AnswerSource snippet */ snippet?: (string|null); + + /** AnswerSource metadata */ + metadata?: (google.protobuf.IStruct|null); } /** Represents an AnswerSource. */ @@ -66596,6 +67382,9 @@ export namespace google { /** AnswerSource snippet. */ public snippet: string; + /** AnswerSource metadata. */ + public metadata?: (google.protobuf.IStruct|null); + /** * Creates a new AnswerSource instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-cloud-dialogflow/protos/protos.js b/packages/google-cloud-dialogflow/protos/protos.js index ae1ddc158b7..14d098c218f 100644 --- a/packages/google-cloud-dialogflow/protos/protos.js +++ b/packages/google-cloud-dialogflow/protos/protos.js @@ -161908,6 +161908,10 @@ * @property {string|null} [sessionId] SearchKnowledgeRequest sessionId * @property {string|null} [conversation] SearchKnowledgeRequest conversation * @property {string|null} [latestMessage] SearchKnowledgeRequest latestMessage + * @property {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.QuerySource|null} [querySource] SearchKnowledgeRequest querySource + * @property {google.protobuf.IStruct|null} [endUserMetadata] SearchKnowledgeRequest endUserMetadata + * @property {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.ISearchConfig|null} [searchConfig] SearchKnowledgeRequest searchConfig + * @property {boolean|null} [exactSearch] SearchKnowledgeRequest exactSearch */ /** @@ -161973,6 +161977,38 @@ */ SearchKnowledgeRequest.prototype.latestMessage = ""; + /** + * SearchKnowledgeRequest querySource. + * @member {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.QuerySource} querySource + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest + * @instance + */ + SearchKnowledgeRequest.prototype.querySource = 0; + + /** + * SearchKnowledgeRequest endUserMetadata. + * @member {google.protobuf.IStruct|null|undefined} endUserMetadata + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest + * @instance + */ + SearchKnowledgeRequest.prototype.endUserMetadata = null; + + /** + * SearchKnowledgeRequest searchConfig. + * @member {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.ISearchConfig|null|undefined} searchConfig + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest + * @instance + */ + SearchKnowledgeRequest.prototype.searchConfig = null; + + /** + * SearchKnowledgeRequest exactSearch. + * @member {boolean} exactSearch + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest + * @instance + */ + SearchKnowledgeRequest.prototype.exactSearch = false; + /** * Creates a new SearchKnowledgeRequest instance using the specified properties. * @function create @@ -162009,6 +162045,14 @@ writer.uint32(/* id 5, wireType 2 =*/42).string(message.latestMessage); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.parent); + if (message.querySource != null && Object.hasOwnProperty.call(message, "querySource")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.querySource); + if (message.endUserMetadata != null && Object.hasOwnProperty.call(message, "endUserMetadata")) + $root.google.protobuf.Struct.encode(message.endUserMetadata, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.searchConfig != null && Object.hasOwnProperty.call(message, "searchConfig")) + $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.encode(message.searchConfig, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.exactSearch != null && Object.hasOwnProperty.call(message, "exactSearch")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.exactSearch); return writer; }; @@ -162067,155 +162111,2051 @@ message.latestMessage = reader.string(); break; } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + case 7: { + message.querySource = reader.int32(); + break; + } + case 9: { + message.endUserMetadata = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 11: { + message.searchConfig = $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.decode(reader, reader.uint32()); + break; + } + case 14: { + message.exactSearch = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchKnowledgeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest} SearchKnowledgeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchKnowledgeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchKnowledgeRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchKnowledgeRequest.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.query != null && message.hasOwnProperty("query")) { + var error = $root.google.cloud.dialogflow.v2beta1.TextInput.verify(message.query); + if (error) + return "query." + error; + } + if (message.conversationProfile != null && message.hasOwnProperty("conversationProfile")) + if (!$util.isString(message.conversationProfile)) + return "conversationProfile: string expected"; + if (message.sessionId != null && message.hasOwnProperty("sessionId")) + if (!$util.isString(message.sessionId)) + return "sessionId: string expected"; + if (message.conversation != null && message.hasOwnProperty("conversation")) + if (!$util.isString(message.conversation)) + return "conversation: string expected"; + if (message.latestMessage != null && message.hasOwnProperty("latestMessage")) + if (!$util.isString(message.latestMessage)) + return "latestMessage: string expected"; + if (message.querySource != null && message.hasOwnProperty("querySource")) + switch (message.querySource) { + default: + return "querySource: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.endUserMetadata != null && message.hasOwnProperty("endUserMetadata")) { + var error = $root.google.protobuf.Struct.verify(message.endUserMetadata); + if (error) + return "endUserMetadata." + error; + } + if (message.searchConfig != null && message.hasOwnProperty("searchConfig")) { + var error = $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.verify(message.searchConfig); + if (error) + return "searchConfig." + error; + } + if (message.exactSearch != null && message.hasOwnProperty("exactSearch")) + if (typeof message.exactSearch !== "boolean") + return "exactSearch: boolean expected"; + return null; + }; + + /** + * Creates a SearchKnowledgeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest} SearchKnowledgeRequest + */ + SearchKnowledgeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.query != null) { + if (typeof object.query !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.query: object expected"); + message.query = $root.google.cloud.dialogflow.v2beta1.TextInput.fromObject(object.query); + } + if (object.conversationProfile != null) + message.conversationProfile = String(object.conversationProfile); + if (object.sessionId != null) + message.sessionId = String(object.sessionId); + if (object.conversation != null) + message.conversation = String(object.conversation); + if (object.latestMessage != null) + message.latestMessage = String(object.latestMessage); + switch (object.querySource) { + default: + if (typeof object.querySource === "number") { + message.querySource = object.querySource; + break; + } + break; + case "QUERY_SOURCE_UNSPECIFIED": + case 0: + message.querySource = 0; + break; + case "AGENT_QUERY": + case 1: + message.querySource = 1; + break; + case "SUGGESTED_QUERY": + case 2: + message.querySource = 2; + break; + } + if (object.endUserMetadata != null) { + if (typeof object.endUserMetadata !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.endUserMetadata: object expected"); + message.endUserMetadata = $root.google.protobuf.Struct.fromObject(object.endUserMetadata); + } + if (object.searchConfig != null) { + if (typeof object.searchConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.searchConfig: object expected"); + message.searchConfig = $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.fromObject(object.searchConfig); + } + if (object.exactSearch != null) + message.exactSearch = Boolean(object.exactSearch); + return message; + }; + + /** + * Creates a plain object from a SearchKnowledgeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest} message SearchKnowledgeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchKnowledgeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.query = null; + object.conversationProfile = ""; + object.sessionId = ""; + object.conversation = ""; + object.latestMessage = ""; + object.parent = ""; + object.querySource = options.enums === String ? "QUERY_SOURCE_UNSPECIFIED" : 0; + object.endUserMetadata = null; + object.searchConfig = null; + object.exactSearch = false; + } + if (message.query != null && message.hasOwnProperty("query")) + object.query = $root.google.cloud.dialogflow.v2beta1.TextInput.toObject(message.query, options); + if (message.conversationProfile != null && message.hasOwnProperty("conversationProfile")) + object.conversationProfile = message.conversationProfile; + if (message.sessionId != null && message.hasOwnProperty("sessionId")) + object.sessionId = message.sessionId; + if (message.conversation != null && message.hasOwnProperty("conversation")) + object.conversation = message.conversation; + if (message.latestMessage != null && message.hasOwnProperty("latestMessage")) + object.latestMessage = message.latestMessage; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.querySource != null && message.hasOwnProperty("querySource")) + object.querySource = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.QuerySource[message.querySource] === undefined ? message.querySource : $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.QuerySource[message.querySource] : message.querySource; + if (message.endUserMetadata != null && message.hasOwnProperty("endUserMetadata")) + object.endUserMetadata = $root.google.protobuf.Struct.toObject(message.endUserMetadata, options); + if (message.searchConfig != null && message.hasOwnProperty("searchConfig")) + object.searchConfig = $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.toObject(message.searchConfig, options); + if (message.exactSearch != null && message.hasOwnProperty("exactSearch")) + object.exactSearch = message.exactSearch; + return object; + }; + + /** + * Converts this SearchKnowledgeRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest + * @instance + * @returns {Object.} JSON object + */ + SearchKnowledgeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchKnowledgeRequest + * @function getTypeUrl + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchKnowledgeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest"; + }; + + /** + * QuerySource enum. + * @name google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.QuerySource + * @enum {number} + * @property {number} QUERY_SOURCE_UNSPECIFIED=0 QUERY_SOURCE_UNSPECIFIED value + * @property {number} AGENT_QUERY=1 AGENT_QUERY value + * @property {number} SUGGESTED_QUERY=2 SUGGESTED_QUERY value + */ + SearchKnowledgeRequest.QuerySource = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "QUERY_SOURCE_UNSPECIFIED"] = 0; + values[valuesById[1] = "AGENT_QUERY"] = 1; + values[valuesById[2] = "SUGGESTED_QUERY"] = 2; + return values; + })(); + + SearchKnowledgeRequest.SearchConfig = (function() { + + /** + * Properties of a SearchConfig. + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest + * @interface ISearchConfig + * @property {Array.|null} [boostSpecs] SearchConfig boostSpecs + * @property {Array.|null} [filterSpecs] SearchConfig filterSpecs + */ + + /** + * Constructs a new SearchConfig. + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest + * @classdesc Represents a SearchConfig. + * @implements ISearchConfig + * @constructor + * @param {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.ISearchConfig=} [properties] Properties to set + */ + function SearchConfig(properties) { + this.boostSpecs = []; + this.filterSpecs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchConfig boostSpecs. + * @member {Array.} boostSpecs + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig + * @instance + */ + SearchConfig.prototype.boostSpecs = $util.emptyArray; + + /** + * SearchConfig filterSpecs. + * @member {Array.} filterSpecs + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig + * @instance + */ + SearchConfig.prototype.filterSpecs = $util.emptyArray; + + /** + * Creates a new SearchConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.ISearchConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig} SearchConfig instance + */ + SearchConfig.create = function create(properties) { + return new SearchConfig(properties); + }; + + /** + * Encodes the specified SearchConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.ISearchConfig} message SearchConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.boostSpecs != null && message.boostSpecs.length) + for (var i = 0; i < message.boostSpecs.length; ++i) + $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.encode(message.boostSpecs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.filterSpecs != null && message.filterSpecs.length) + for (var i = 0; i < message.filterSpecs.length; ++i) + $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.FilterSpecs.encode(message.filterSpecs[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SearchConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.ISearchConfig} message SearchConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig} SearchConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.boostSpecs && message.boostSpecs.length)) + message.boostSpecs = []; + message.boostSpecs.push($root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.filterSpecs && message.filterSpecs.length)) + message.filterSpecs = []; + message.filterSpecs.push($root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.FilterSpecs.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig} SearchConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchConfig message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.boostSpecs != null && message.hasOwnProperty("boostSpecs")) { + if (!Array.isArray(message.boostSpecs)) + return "boostSpecs: array expected"; + for (var i = 0; i < message.boostSpecs.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.verify(message.boostSpecs[i]); + if (error) + return "boostSpecs." + error; + } + } + if (message.filterSpecs != null && message.hasOwnProperty("filterSpecs")) { + if (!Array.isArray(message.filterSpecs)) + return "filterSpecs: array expected"; + for (var i = 0; i < message.filterSpecs.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.FilterSpecs.verify(message.filterSpecs[i]); + if (error) + return "filterSpecs." + error; + } + } + return null; + }; + + /** + * Creates a SearchConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig} SearchConfig + */ + SearchConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig(); + if (object.boostSpecs) { + if (!Array.isArray(object.boostSpecs)) + throw TypeError(".google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.boostSpecs: array expected"); + message.boostSpecs = []; + for (var i = 0; i < object.boostSpecs.length; ++i) { + if (typeof object.boostSpecs[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.boostSpecs: object expected"); + message.boostSpecs[i] = $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.fromObject(object.boostSpecs[i]); + } + } + if (object.filterSpecs) { + if (!Array.isArray(object.filterSpecs)) + throw TypeError(".google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.filterSpecs: array expected"); + message.filterSpecs = []; + for (var i = 0; i < object.filterSpecs.length; ++i) { + if (typeof object.filterSpecs[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.filterSpecs: object expected"); + message.filterSpecs[i] = $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.FilterSpecs.fromObject(object.filterSpecs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SearchConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig} message SearchConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.boostSpecs = []; + object.filterSpecs = []; + } + if (message.boostSpecs && message.boostSpecs.length) { + object.boostSpecs = []; + for (var j = 0; j < message.boostSpecs.length; ++j) + object.boostSpecs[j] = $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.toObject(message.boostSpecs[j], options); + } + if (message.filterSpecs && message.filterSpecs.length) { + object.filterSpecs = []; + for (var j = 0; j < message.filterSpecs.length; ++j) + object.filterSpecs[j] = $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.FilterSpecs.toObject(message.filterSpecs[j], options); + } + return object; + }; + + /** + * Converts this SearchConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig + * @instance + * @returns {Object.} JSON object + */ + SearchConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchConfig + * @function getTypeUrl + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig"; + }; + + SearchConfig.BoostSpecs = (function() { + + /** + * Properties of a BoostSpecs. + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig + * @interface IBoostSpecs + * @property {Array.|null} [dataStores] BoostSpecs dataStores + * @property {Array.|null} [spec] BoostSpecs spec + */ + + /** + * Constructs a new BoostSpecs. + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig + * @classdesc Represents a BoostSpecs. + * @implements IBoostSpecs + * @constructor + * @param {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.IBoostSpecs=} [properties] Properties to set + */ + function BoostSpecs(properties) { + this.dataStores = []; + this.spec = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoostSpecs dataStores. + * @member {Array.} dataStores + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs + * @instance + */ + BoostSpecs.prototype.dataStores = $util.emptyArray; + + /** + * BoostSpecs spec. + * @member {Array.} spec + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs + * @instance + */ + BoostSpecs.prototype.spec = $util.emptyArray; + + /** + * Creates a new BoostSpecs instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs + * @static + * @param {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.IBoostSpecs=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs} BoostSpecs instance + */ + BoostSpecs.create = function create(properties) { + return new BoostSpecs(properties); + }; + + /** + * Encodes the specified BoostSpecs message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs + * @static + * @param {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.IBoostSpecs} message BoostSpecs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostSpecs.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataStores != null && message.dataStores.length) + for (var i = 0; i < message.dataStores.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataStores[i]); + if (message.spec != null && message.spec.length) + for (var i = 0; i < message.spec.length; ++i) + $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.encode(message.spec[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BoostSpecs message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs + * @static + * @param {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.IBoostSpecs} message BoostSpecs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostSpecs.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoostSpecs message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs} BoostSpecs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostSpecs.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.dataStores && message.dataStores.length)) + message.dataStores = []; + message.dataStores.push(reader.string()); + break; + } + case 2: { + if (!(message.spec && message.spec.length)) + message.spec = []; + message.spec.push($root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoostSpecs message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs} BoostSpecs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostSpecs.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoostSpecs message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoostSpecs.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataStores != null && message.hasOwnProperty("dataStores")) { + if (!Array.isArray(message.dataStores)) + return "dataStores: array expected"; + for (var i = 0; i < message.dataStores.length; ++i) + if (!$util.isString(message.dataStores[i])) + return "dataStores: string[] expected"; + } + if (message.spec != null && message.hasOwnProperty("spec")) { + if (!Array.isArray(message.spec)) + return "spec: array expected"; + for (var i = 0; i < message.spec.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.verify(message.spec[i]); + if (error) + return "spec." + error; + } + } + return null; + }; + + /** + * Creates a BoostSpecs message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs} BoostSpecs + */ + BoostSpecs.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs(); + if (object.dataStores) { + if (!Array.isArray(object.dataStores)) + throw TypeError(".google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.dataStores: array expected"); + message.dataStores = []; + for (var i = 0; i < object.dataStores.length; ++i) + message.dataStores[i] = String(object.dataStores[i]); + } + if (object.spec) { + if (!Array.isArray(object.spec)) + throw TypeError(".google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.spec: array expected"); + message.spec = []; + for (var i = 0; i < object.spec.length; ++i) { + if (typeof object.spec[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.spec: object expected"); + message.spec[i] = $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.fromObject(object.spec[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BoostSpecs message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs + * @static + * @param {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs} message BoostSpecs + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoostSpecs.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dataStores = []; + object.spec = []; + } + if (message.dataStores && message.dataStores.length) { + object.dataStores = []; + for (var j = 0; j < message.dataStores.length; ++j) + object.dataStores[j] = message.dataStores[j]; + } + if (message.spec && message.spec.length) { + object.spec = []; + for (var j = 0; j < message.spec.length; ++j) + object.spec[j] = $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.toObject(message.spec[j], options); + } + return object; + }; + + /** + * Converts this BoostSpecs to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs + * @instance + * @returns {Object.} JSON object + */ + BoostSpecs.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoostSpecs + * @function getTypeUrl + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoostSpecs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs"; + }; + + BoostSpecs.BoostSpec = (function() { + + /** + * Properties of a BoostSpec. + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs + * @interface IBoostSpec + * @property {Array.|null} [conditionBoostSpecs] BoostSpec conditionBoostSpecs + */ + + /** + * Constructs a new BoostSpec. + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs + * @classdesc Represents a BoostSpec. + * @implements IBoostSpec + * @constructor + * @param {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.IBoostSpec=} [properties] Properties to set + */ + function BoostSpec(properties) { + this.conditionBoostSpecs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoostSpec conditionBoostSpecs. + * @member {Array.} conditionBoostSpecs + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec + * @instance + */ + BoostSpec.prototype.conditionBoostSpecs = $util.emptyArray; + + /** + * Creates a new BoostSpec instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec + * @static + * @param {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.IBoostSpec=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec} BoostSpec instance + */ + BoostSpec.create = function create(properties) { + return new BoostSpec(properties); + }; + + /** + * Encodes the specified BoostSpec message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec + * @static + * @param {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.IBoostSpec} message BoostSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conditionBoostSpecs != null && message.conditionBoostSpecs.length) + for (var i = 0; i < message.conditionBoostSpecs.length; ++i) + $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.encode(message.conditionBoostSpecs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BoostSpec message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec + * @static + * @param {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.IBoostSpec} message BoostSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoostSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec} BoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.conditionBoostSpecs && message.conditionBoostSpecs.length)) + message.conditionBoostSpecs = []; + message.conditionBoostSpecs.push($root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoostSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec} BoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoostSpec message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoostSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conditionBoostSpecs != null && message.hasOwnProperty("conditionBoostSpecs")) { + if (!Array.isArray(message.conditionBoostSpecs)) + return "conditionBoostSpecs: array expected"; + for (var i = 0; i < message.conditionBoostSpecs.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.verify(message.conditionBoostSpecs[i]); + if (error) + return "conditionBoostSpecs." + error; + } + } + return null; + }; + + /** + * Creates a BoostSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec} BoostSpec + */ + BoostSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec(); + if (object.conditionBoostSpecs) { + if (!Array.isArray(object.conditionBoostSpecs)) + throw TypeError(".google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.conditionBoostSpecs: array expected"); + message.conditionBoostSpecs = []; + for (var i = 0; i < object.conditionBoostSpecs.length; ++i) { + if (typeof object.conditionBoostSpecs[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.conditionBoostSpecs: object expected"); + message.conditionBoostSpecs[i] = $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.fromObject(object.conditionBoostSpecs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BoostSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec + * @static + * @param {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec} message BoostSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoostSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.conditionBoostSpecs = []; + if (message.conditionBoostSpecs && message.conditionBoostSpecs.length) { + object.conditionBoostSpecs = []; + for (var j = 0; j < message.conditionBoostSpecs.length; ++j) + object.conditionBoostSpecs[j] = $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.toObject(message.conditionBoostSpecs[j], options); + } + return object; + }; + + /** + * Converts this BoostSpec to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec + * @instance + * @returns {Object.} JSON object + */ + BoostSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoostSpec + * @function getTypeUrl + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoostSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec"; + }; + + BoostSpec.ConditionBoostSpec = (function() { + + /** + * Properties of a ConditionBoostSpec. + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec + * @interface IConditionBoostSpec + * @property {string|null} [condition] ConditionBoostSpec condition + * @property {number|null} [boost] ConditionBoostSpec boost + * @property {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.IBoostControlSpec|null} [boostControlSpec] ConditionBoostSpec boostControlSpec + */ + + /** + * Constructs a new ConditionBoostSpec. + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec + * @classdesc Represents a ConditionBoostSpec. + * @implements IConditionBoostSpec + * @constructor + * @param {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.IConditionBoostSpec=} [properties] Properties to set + */ + function ConditionBoostSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConditionBoostSpec condition. + * @member {string} condition + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec + * @instance + */ + ConditionBoostSpec.prototype.condition = ""; + + /** + * ConditionBoostSpec boost. + * @member {number} boost + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec + * @instance + */ + ConditionBoostSpec.prototype.boost = 0; + + /** + * ConditionBoostSpec boostControlSpec. + * @member {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.IBoostControlSpec|null|undefined} boostControlSpec + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec + * @instance + */ + ConditionBoostSpec.prototype.boostControlSpec = null; + + /** + * Creates a new ConditionBoostSpec instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.IConditionBoostSpec=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec} ConditionBoostSpec instance + */ + ConditionBoostSpec.create = function create(properties) { + return new ConditionBoostSpec(properties); + }; + + /** + * Encodes the specified ConditionBoostSpec message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.IConditionBoostSpec} message ConditionBoostSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionBoostSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.condition); + if (message.boost != null && Object.hasOwnProperty.call(message, "boost")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.boost); + if (message.boostControlSpec != null && Object.hasOwnProperty.call(message, "boostControlSpec")) + $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.encode(message.boostControlSpec, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConditionBoostSpec message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.IConditionBoostSpec} message ConditionBoostSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionBoostSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec} ConditionBoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionBoostSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.condition = reader.string(); + break; + } + case 2: { + message.boost = reader.float(); + break; + } + case 4: { + message.boostControlSpec = $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec} ConditionBoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionBoostSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConditionBoostSpec message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConditionBoostSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.condition != null && message.hasOwnProperty("condition")) + if (!$util.isString(message.condition)) + return "condition: string expected"; + if (message.boost != null && message.hasOwnProperty("boost")) + if (typeof message.boost !== "number") + return "boost: number expected"; + if (message.boostControlSpec != null && message.hasOwnProperty("boostControlSpec")) { + var error = $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify(message.boostControlSpec); + if (error) + return "boostControlSpec." + error; + } + return null; + }; + + /** + * Creates a ConditionBoostSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec} ConditionBoostSpec + */ + ConditionBoostSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec(); + if (object.condition != null) + message.condition = String(object.condition); + if (object.boost != null) + message.boost = Number(object.boost); + if (object.boostControlSpec != null) { + if (typeof object.boostControlSpec !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.boostControlSpec: object expected"); + message.boostControlSpec = $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.fromObject(object.boostControlSpec); + } + return message; + }; + + /** + * Creates a plain object from a ConditionBoostSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec} message ConditionBoostSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConditionBoostSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.condition = ""; + object.boost = 0; + object.boostControlSpec = null; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = message.condition; + if (message.boost != null && message.hasOwnProperty("boost")) + object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost; + if (message.boostControlSpec != null && message.hasOwnProperty("boostControlSpec")) + object.boostControlSpec = $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.toObject(message.boostControlSpec, options); + return object; + }; + + /** + * Converts this ConditionBoostSpec to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec + * @instance + * @returns {Object.} JSON object + */ + ConditionBoostSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConditionBoostSpec + * @function getTypeUrl + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConditionBoostSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec"; + }; + + ConditionBoostSpec.BoostControlSpec = (function() { + + /** + * Properties of a BoostControlSpec. + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec + * @interface IBoostControlSpec + * @property {string|null} [fieldName] BoostControlSpec fieldName + * @property {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType|null} [attributeType] BoostControlSpec attributeType + * @property {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType|null} [interpolationType] BoostControlSpec interpolationType + * @property {Array.|null} [controlPoints] BoostControlSpec controlPoints + */ + + /** + * Constructs a new BoostControlSpec. + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec + * @classdesc Represents a BoostControlSpec. + * @implements IBoostControlSpec + * @constructor + * @param {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.IBoostControlSpec=} [properties] Properties to set + */ + function BoostControlSpec(properties) { + this.controlPoints = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoostControlSpec fieldName. + * @member {string} fieldName + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @instance + */ + BoostControlSpec.prototype.fieldName = ""; + + /** + * BoostControlSpec attributeType. + * @member {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType} attributeType + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @instance + */ + BoostControlSpec.prototype.attributeType = 0; + + /** + * BoostControlSpec interpolationType. + * @member {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType} interpolationType + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @instance + */ + BoostControlSpec.prototype.interpolationType = 0; + + /** + * BoostControlSpec controlPoints. + * @member {Array.} controlPoints + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @instance + */ + BoostControlSpec.prototype.controlPoints = $util.emptyArray; + + /** + * Creates a new BoostControlSpec instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.IBoostControlSpec=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec} BoostControlSpec instance + */ + BoostControlSpec.create = function create(properties) { + return new BoostControlSpec(properties); + }; + + /** + * Encodes the specified BoostControlSpec message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.IBoostControlSpec} message BoostControlSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostControlSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldName != null && Object.hasOwnProperty.call(message, "fieldName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fieldName); + if (message.attributeType != null && Object.hasOwnProperty.call(message, "attributeType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.attributeType); + if (message.interpolationType != null && Object.hasOwnProperty.call(message, "interpolationType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.interpolationType); + if (message.controlPoints != null && message.controlPoints.length) + for (var i = 0; i < message.controlPoints.length; ++i) + $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.encode(message.controlPoints[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BoostControlSpec message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.IBoostControlSpec} message BoostControlSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostControlSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoostControlSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec} BoostControlSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostControlSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fieldName = reader.string(); + break; + } + case 2: { + message.attributeType = reader.int32(); + break; + } + case 3: { + message.interpolationType = reader.int32(); + break; + } + case 4: { + if (!(message.controlPoints && message.controlPoints.length)) + message.controlPoints = []; + message.controlPoints.push($root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoostControlSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec} BoostControlSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostControlSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoostControlSpec message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoostControlSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldName != null && message.hasOwnProperty("fieldName")) + if (!$util.isString(message.fieldName)) + return "fieldName: string expected"; + if (message.attributeType != null && message.hasOwnProperty("attributeType")) + switch (message.attributeType) { + default: + return "attributeType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.interpolationType != null && message.hasOwnProperty("interpolationType")) + switch (message.interpolationType) { + default: + return "interpolationType: enum value expected"; + case 0: + case 1: + break; + } + if (message.controlPoints != null && message.hasOwnProperty("controlPoints")) { + if (!Array.isArray(message.controlPoints)) + return "controlPoints: array expected"; + for (var i = 0; i < message.controlPoints.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify(message.controlPoints[i]); + if (error) + return "controlPoints." + error; + } + } + return null; + }; + + /** + * Creates a BoostControlSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec} BoostControlSpec + */ + BoostControlSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec(); + if (object.fieldName != null) + message.fieldName = String(object.fieldName); + switch (object.attributeType) { + default: + if (typeof object.attributeType === "number") { + message.attributeType = object.attributeType; + break; + } + break; + case "ATTRIBUTE_TYPE_UNSPECIFIED": + case 0: + message.attributeType = 0; + break; + case "NUMERICAL": + case 1: + message.attributeType = 1; + break; + case "FRESHNESS": + case 2: + message.attributeType = 2; + break; + } + switch (object.interpolationType) { + default: + if (typeof object.interpolationType === "number") { + message.interpolationType = object.interpolationType; + break; + } + break; + case "INTERPOLATION_TYPE_UNSPECIFIED": + case 0: + message.interpolationType = 0; + break; + case "LINEAR": + case 1: + message.interpolationType = 1; + break; + } + if (object.controlPoints) { + if (!Array.isArray(object.controlPoints)) + throw TypeError(".google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.controlPoints: array expected"); + message.controlPoints = []; + for (var i = 0; i < object.controlPoints.length; ++i) { + if (typeof object.controlPoints[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.controlPoints: object expected"); + message.controlPoints[i] = $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.fromObject(object.controlPoints[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BoostControlSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec} message BoostControlSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoostControlSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.controlPoints = []; + if (options.defaults) { + object.fieldName = ""; + object.attributeType = options.enums === String ? "ATTRIBUTE_TYPE_UNSPECIFIED" : 0; + object.interpolationType = options.enums === String ? "INTERPOLATION_TYPE_UNSPECIFIED" : 0; + } + if (message.fieldName != null && message.hasOwnProperty("fieldName")) + object.fieldName = message.fieldName; + if (message.attributeType != null && message.hasOwnProperty("attributeType")) + object.attributeType = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType[message.attributeType] === undefined ? message.attributeType : $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType[message.attributeType] : message.attributeType; + if (message.interpolationType != null && message.hasOwnProperty("interpolationType")) + object.interpolationType = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType[message.interpolationType] === undefined ? message.interpolationType : $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType[message.interpolationType] : message.interpolationType; + if (message.controlPoints && message.controlPoints.length) { + object.controlPoints = []; + for (var j = 0; j < message.controlPoints.length; ++j) + object.controlPoints[j] = $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.toObject(message.controlPoints[j], options); + } + return object; + }; + + /** + * Converts this BoostControlSpec to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @instance + * @returns {Object.} JSON object + */ + BoostControlSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoostControlSpec + * @function getTypeUrl + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoostControlSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec"; + }; + + /** + * AttributeType enum. + * @name google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType + * @enum {number} + * @property {number} ATTRIBUTE_TYPE_UNSPECIFIED=0 ATTRIBUTE_TYPE_UNSPECIFIED value + * @property {number} NUMERICAL=1 NUMERICAL value + * @property {number} FRESHNESS=2 FRESHNESS value + */ + BoostControlSpec.AttributeType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ATTRIBUTE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NUMERICAL"] = 1; + values[valuesById[2] = "FRESHNESS"] = 2; + return values; + })(); + + /** + * InterpolationType enum. + * @name google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType + * @enum {number} + * @property {number} INTERPOLATION_TYPE_UNSPECIFIED=0 INTERPOLATION_TYPE_UNSPECIFIED value + * @property {number} LINEAR=1 LINEAR value + */ + BoostControlSpec.InterpolationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INTERPOLATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "LINEAR"] = 1; + return values; + })(); + + BoostControlSpec.ControlPoint = (function() { + + /** + * Properties of a ControlPoint. + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @interface IControlPoint + */ + + /** + * Constructs a new ControlPoint. + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @classdesc Represents a ControlPoint. + * @implements IControlPoint + * @constructor + * @param {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint=} [properties] Properties to set + */ + function ControlPoint(properties) { + if (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 ControlPoint instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} ControlPoint instance + */ + ControlPoint.create = function create(properties) { + return new ControlPoint(properties); + }; + + /** + * Encodes the specified ControlPoint message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint} message ControlPoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ControlPoint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ControlPoint message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint} message ControlPoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ControlPoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ControlPoint message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} ControlPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ControlPoint.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ControlPoint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} ControlPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ControlPoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ControlPoint message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ControlPoint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a ControlPoint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} ControlPoint + */ + ControlPoint.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint) + return object; + return new $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint(); + }; + + /** + * Creates a plain object from a ControlPoint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} message ControlPoint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ControlPoint.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ControlPoint to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @instance + * @returns {Object.} JSON object + */ + ControlPoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ControlPoint + * @function getTypeUrl + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ControlPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint"; + }; + + return ControlPoint; + })(); + + return BoostControlSpec; + })(); + + return ConditionBoostSpec; + })(); + + return BoostSpec; + })(); + + return BoostSpecs; + })(); + + SearchConfig.FilterSpecs = (function() { + + /** + * Properties of a FilterSpecs. + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig + * @interface IFilterSpecs + * @property {Array.|null} [dataStores] FilterSpecs dataStores + * @property {string|null} [filter] FilterSpecs filter + */ + + /** + * Constructs a new FilterSpecs. + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig + * @classdesc Represents a FilterSpecs. + * @implements IFilterSpecs + * @constructor + * @param {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.IFilterSpecs=} [properties] Properties to set + */ + function FilterSpecs(properties) { + this.dataStores = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FilterSpecs dataStores. + * @member {Array.} dataStores + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.FilterSpecs + * @instance + */ + FilterSpecs.prototype.dataStores = $util.emptyArray; + + /** + * FilterSpecs filter. + * @member {string} filter + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.FilterSpecs + * @instance + */ + FilterSpecs.prototype.filter = ""; + + /** + * Creates a new FilterSpecs instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.FilterSpecs + * @static + * @param {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.IFilterSpecs=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.FilterSpecs} FilterSpecs instance + */ + FilterSpecs.create = function create(properties) { + return new FilterSpecs(properties); + }; + + /** + * Encodes the specified FilterSpecs message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.FilterSpecs.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.FilterSpecs + * @static + * @param {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.IFilterSpecs} message FilterSpecs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FilterSpecs.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataStores != null && message.dataStores.length) + for (var i = 0; i < message.dataStores.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataStores[i]); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + return writer; + }; + + /** + * Encodes the specified FilterSpecs message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.FilterSpecs.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.FilterSpecs + * @static + * @param {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.IFilterSpecs} message FilterSpecs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FilterSpecs.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FilterSpecs message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.FilterSpecs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.FilterSpecs} FilterSpecs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FilterSpecs.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.FilterSpecs(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.dataStores && message.dataStores.length)) + message.dataStores = []; + message.dataStores.push(reader.string()); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FilterSpecs message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.FilterSpecs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.FilterSpecs} FilterSpecs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FilterSpecs.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FilterSpecs message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.FilterSpecs + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FilterSpecs.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataStores != null && message.hasOwnProperty("dataStores")) { + if (!Array.isArray(message.dataStores)) + return "dataStores: array expected"; + for (var i = 0; i < message.dataStores.length; ++i) + if (!$util.isString(message.dataStores[i])) + return "dataStores: string[] expected"; + } + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; - /** - * Decodes a SearchKnowledgeRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest} SearchKnowledgeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchKnowledgeRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a FilterSpecs message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.FilterSpecs + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.FilterSpecs} FilterSpecs + */ + FilterSpecs.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.FilterSpecs) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.FilterSpecs(); + if (object.dataStores) { + if (!Array.isArray(object.dataStores)) + throw TypeError(".google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.FilterSpecs.dataStores: array expected"); + message.dataStores = []; + for (var i = 0; i < object.dataStores.length; ++i) + message.dataStores[i] = String(object.dataStores[i]); + } + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; - /** - * Verifies a SearchKnowledgeRequest message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SearchKnowledgeRequest.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.query != null && message.hasOwnProperty("query")) { - var error = $root.google.cloud.dialogflow.v2beta1.TextInput.verify(message.query); - if (error) - return "query." + error; - } - if (message.conversationProfile != null && message.hasOwnProperty("conversationProfile")) - if (!$util.isString(message.conversationProfile)) - return "conversationProfile: string expected"; - if (message.sessionId != null && message.hasOwnProperty("sessionId")) - if (!$util.isString(message.sessionId)) - return "sessionId: string expected"; - if (message.conversation != null && message.hasOwnProperty("conversation")) - if (!$util.isString(message.conversation)) - return "conversation: string expected"; - if (message.latestMessage != null && message.hasOwnProperty("latestMessage")) - if (!$util.isString(message.latestMessage)) - return "latestMessage: string expected"; - return null; - }; + /** + * Creates a plain object from a FilterSpecs message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.FilterSpecs + * @static + * @param {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.FilterSpecs} message FilterSpecs + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FilterSpecs.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataStores = []; + if (options.defaults) + object.filter = ""; + if (message.dataStores && message.dataStores.length) { + object.dataStores = []; + for (var j = 0; j < message.dataStores.length; ++j) + object.dataStores[j] = message.dataStores[j]; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; - /** - * Creates a SearchKnowledgeRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest} SearchKnowledgeRequest - */ - SearchKnowledgeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.query != null) { - if (typeof object.query !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.query: object expected"); - message.query = $root.google.cloud.dialogflow.v2beta1.TextInput.fromObject(object.query); - } - if (object.conversationProfile != null) - message.conversationProfile = String(object.conversationProfile); - if (object.sessionId != null) - message.sessionId = String(object.sessionId); - if (object.conversation != null) - message.conversation = String(object.conversation); - if (object.latestMessage != null) - message.latestMessage = String(object.latestMessage); - return message; - }; + /** + * Converts this FilterSpecs to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.FilterSpecs + * @instance + * @returns {Object.} JSON object + */ + FilterSpecs.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a plain object from a SearchKnowledgeRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest} message SearchKnowledgeRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SearchKnowledgeRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.query = null; - object.conversationProfile = ""; - object.sessionId = ""; - object.conversation = ""; - object.latestMessage = ""; - object.parent = ""; - } - if (message.query != null && message.hasOwnProperty("query")) - object.query = $root.google.cloud.dialogflow.v2beta1.TextInput.toObject(message.query, options); - if (message.conversationProfile != null && message.hasOwnProperty("conversationProfile")) - object.conversationProfile = message.conversationProfile; - if (message.sessionId != null && message.hasOwnProperty("sessionId")) - object.sessionId = message.sessionId; - if (message.conversation != null && message.hasOwnProperty("conversation")) - object.conversation = message.conversation; - if (message.latestMessage != null && message.hasOwnProperty("latestMessage")) - object.latestMessage = message.latestMessage; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - return object; - }; + /** + * Gets the default type url for FilterSpecs + * @function getTypeUrl + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.FilterSpecs + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FilterSpecs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig.FilterSpecs"; + }; - /** - * Converts this SearchKnowledgeRequest to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest - * @instance - * @returns {Object.} JSON object - */ - SearchKnowledgeRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return FilterSpecs; + })(); - /** - * Gets the default type url for SearchKnowledgeRequest - * @function getTypeUrl - * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SearchKnowledgeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest"; - }; + return SearchConfig; + })(); return SearchKnowledgeRequest; })(); @@ -162816,6 +164756,7 @@ * @property {string|null} [title] AnswerSource title * @property {string|null} [uri] AnswerSource uri * @property {string|null} [snippet] AnswerSource snippet + * @property {google.protobuf.IStruct|null} [metadata] AnswerSource metadata */ /** @@ -162857,6 +164798,14 @@ */ AnswerSource.prototype.snippet = ""; + /** + * AnswerSource metadata. + * @member {google.protobuf.IStruct|null|undefined} metadata + * @memberof google.cloud.dialogflow.v2beta1.SearchKnowledgeAnswer.AnswerSource + * @instance + */ + AnswerSource.prototype.metadata = null; + /** * Creates a new AnswerSource instance using the specified properties. * @function create @@ -162887,6 +164836,8 @@ writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri); if (message.snippet != null && Object.hasOwnProperty.call(message, "snippet")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.snippet); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Struct.encode(message.metadata, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -162933,6 +164884,10 @@ message.snippet = reader.string(); break; } + case 5: { + message.metadata = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -162977,6 +164932,11 @@ if (message.snippet != null && message.hasOwnProperty("snippet")) if (!$util.isString(message.snippet)) return "snippet: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Struct.verify(message.metadata); + if (error) + return "metadata." + error; + } return null; }; @@ -162998,6 +164958,11 @@ message.uri = String(object.uri); if (object.snippet != null) message.snippet = String(object.snippet); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.SearchKnowledgeAnswer.AnswerSource.metadata: object expected"); + message.metadata = $root.google.protobuf.Struct.fromObject(object.metadata); + } return message; }; @@ -163018,6 +164983,7 @@ object.title = ""; object.uri = ""; object.snippet = ""; + object.metadata = null; } if (message.title != null && message.hasOwnProperty("title")) object.title = message.title; @@ -163025,6 +164991,8 @@ object.uri = message.uri; if (message.snippet != null && message.hasOwnProperty("snippet")) object.snippet = message.snippet; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Struct.toObject(message.metadata, options); return object; }; diff --git a/packages/google-cloud-dialogflow/protos/protos.json b/packages/google-cloud-dialogflow/protos/protos.json index 832560b2ca1..b26ec08f7e3 100644 --- a/packages/google-cloud-dialogflow/protos/protos.json +++ b/packages/google-cloud-dialogflow/protos/protos.json @@ -18854,6 +18854,199 @@ "(google.api.field_behavior)": "OPTIONAL", "(google.api.resource_reference).type": "dialogflow.googleapis.com/Message" } + }, + "querySource": { + "type": "QuerySource", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "endUserMetadata": { + "type": "google.protobuf.Struct", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "searchConfig": { + "type": "SearchConfig", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "exactSearch": { + "type": "bool", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "QuerySource": { + "values": { + "QUERY_SOURCE_UNSPECIFIED": 0, + "AGENT_QUERY": 1, + "SUGGESTED_QUERY": 2 + } + }, + "SearchConfig": { + "fields": { + "boostSpecs": { + "rule": "repeated", + "type": "BoostSpecs", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filterSpecs": { + "rule": "repeated", + "type": "FilterSpecs", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "BoostSpecs": { + "fields": { + "dataStores": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "discoveryengine.googleapis.com/DataStore" + } + }, + "spec": { + "rule": "repeated", + "type": "BoostSpec", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "BoostSpec": { + "fields": { + "conditionBoostSpecs": { + "rule": "repeated", + "type": "ConditionBoostSpec", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ConditionBoostSpec": { + "fields": { + "condition": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "boost": { + "type": "float", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "boostControlSpec": { + "type": "BoostControlSpec", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "BoostControlSpec": { + "fields": { + "fieldName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "attributeType": { + "type": "AttributeType", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "interpolationType": { + "type": "InterpolationType", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "controlPoints": { + "rule": "repeated", + "type": "ControlPoint", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "AttributeType": { + "values": { + "ATTRIBUTE_TYPE_UNSPECIFIED": 0, + "NUMERICAL": 1, + "FRESHNESS": 2 + } + }, + "InterpolationType": { + "values": { + "INTERPOLATION_TYPE_UNSPECIFIED": 0, + "LINEAR": 1 + } + }, + "ControlPoint": { + "fields": {} + } + } + } + } + } + } + } + } + }, + "FilterSpecs": { + "fields": { + "dataStores": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } } } }, @@ -18912,6 +19105,10 @@ "snippet": { "type": "string", "id": 3 + }, + "metadata": { + "type": "google.protobuf.Struct", + "id": 5 } } } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversations.create_conversation.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversations.create_conversation.js index 78e0d2525c0..03f27525795 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversations.create_conversation.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversations.create_conversation.js @@ -41,9 +41,9 @@ function main(parent, conversation) { * 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 + * The conversation ID must be compliant with the regression formula * `[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 + * If the field is provided, the caller is responsible 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. diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversations.search_knowledge.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversations.search_knowledge.js index c73ad045efa..bdec879cb61 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversations.search_knowledge.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversations.search_knowledge.js @@ -67,6 +67,35 @@ function main(parent, query, conversationProfile, sessionId) { * ID>/conversations//messages/`. */ // const latestMessage = 'abc123' + /** + * Optional. The source of the query in the request. + */ + // const querySource = {} + /** + * Optional. Information about the end-user to improve the relevance and + * accuracy of generative answers. + * This will be interpreted and used by a language model, so, for good + * results, the data should be self-descriptive, and in a simple structure. + * Example: + * ```json + * { + * "subscription plan": "Business Premium Plus", + * "devices owned": + * {"model": "Google Pixel 7"}, + * {"model": "Google Pixel Tablet"} + * + * } + * ``` + */ + // const endUserMetadata = {} + /** + * Optional. Configuration specific to search queries with data stores. + */ + // const searchConfig = {} + /** + * Optional. Whether to search the query exactly without query rewrite. + */ + // const exactSearch = true // Imports the Dialogflow library const {ConversationsClient} = require('@google-cloud/dialogflow').v2beta1; diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/snippet_metadata_google.cloud.dialogflow.v2beta1.json b/packages/google-cloud-dialogflow/samples/generated/v2beta1/snippet_metadata_google.cloud.dialogflow.v2beta1.json index 9831b652960..60aa5de103d 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/snippet_metadata_google.cloud.dialogflow.v2beta1.json +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/snippet_metadata_google.cloud.dialogflow.v2beta1.json @@ -1558,7 +1558,7 @@ "segments": [ { "start": 25, - "end": 91, + "end": 120, "type": "FULL" } ], @@ -1590,6 +1590,22 @@ { "name": "latest_message", "type": "TYPE_STRING" + }, + { + "name": "query_source", + "type": ".google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.QuerySource" + }, + { + "name": "end_user_metadata", + "type": ".google.protobuf.Struct" + }, + { + "name": "search_config", + "type": ".google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig" + }, + { + "name": "exact_search", + "type": "TYPE_BOOL" } ], "resultType": ".google.cloud.dialogflow.v2beta1.SearchKnowledgeResponse", diff --git a/packages/google-cloud-dialogflow/src/v2beta1/conversations_client.ts b/packages/google-cloud-dialogflow/src/v2beta1/conversations_client.ts index 152fa925a04..4f8417fc99b 100644 --- a/packages/google-cloud-dialogflow/src/v2beta1/conversations_client.ts +++ b/packages/google-cloud-dialogflow/src/v2beta1/conversations_client.ts @@ -571,9 +571,9 @@ export class ConversationsClient { * 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 + * The conversation ID must be compliant with the regression formula * `{@link protos.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 + * If the field is provided, the caller is responsible 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. @@ -1346,6 +1346,30 @@ export class ConversationsClient { * triggered. * Format: `projects//locations//conversations//messages/`. + * @param {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.QuerySource} [request.querySource] + * Optional. The source of the query in the request. + * @param {google.protobuf.Struct} [request.endUserMetadata] + * Optional. Information about the end-user to improve the relevance and + * accuracy of generative answers. + * + * This will be interpreted and used by a language model, so, for good + * results, the data should be self-descriptive, and in a simple structure. + * + * Example: + * + * ```json + * { + * "subscription plan": "Business Premium Plus", + * "devices owned": [ + * {"model": "Google Pixel 7"}, + * {"model": "Google Pixel Tablet"} + * ] + * } + * ``` + * @param {google.cloud.dialogflow.v2beta1.SearchKnowledgeRequest.SearchConfig} [request.searchConfig] + * Optional. Configuration specific to search queries with data stores. + * @param {boolean} [request.exactSearch] + * Optional. Whether to search the query exactly without query rewrite. * @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.