diff --git a/packages/google-cloud-discoveryengine/README.md b/packages/google-cloud-discoveryengine/README.md index f9bff4e30ed..a4fda00efbc 100644 --- a/packages/google-cloud-discoveryengine/README.md +++ b/packages/google-cloud-discoveryengine/README.md @@ -195,6 +195,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Document_service.create_document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1alpha/document_service.create_document.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-discoveryengine/samples/generated/v1alpha/document_service.create_document.js,packages/google-cloud-discoveryengine/samples/README.md) | | Document_service.delete_document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1alpha/document_service.delete_document.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-discoveryengine/samples/generated/v1alpha/document_service.delete_document.js,packages/google-cloud-discoveryengine/samples/README.md) | | Document_service.get_document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1alpha/document_service.get_document.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-discoveryengine/samples/generated/v1alpha/document_service.get_document.js,packages/google-cloud-discoveryengine/samples/README.md) | +| Document_service.get_processed_document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1alpha/document_service.get_processed_document.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-discoveryengine/samples/generated/v1alpha/document_service.get_processed_document.js,packages/google-cloud-discoveryengine/samples/README.md) | | Document_service.import_documents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1alpha/document_service.import_documents.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-discoveryengine/samples/generated/v1alpha/document_service.import_documents.js,packages/google-cloud-discoveryengine/samples/README.md) | | Document_service.list_documents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1alpha/document_service.list_documents.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-discoveryengine/samples/generated/v1alpha/document_service.list_documents.js,packages/google-cloud-discoveryengine/samples/README.md) | | Document_service.purge_documents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1alpha/document_service.purge_documents.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-discoveryengine/samples/generated/v1alpha/document_service.purge_documents.js,packages/google-cloud-discoveryengine/samples/README.md) | @@ -208,6 +209,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Engine_service.tune_engine | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1alpha/engine_service.tune_engine.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-discoveryengine/samples/generated/v1alpha/engine_service.tune_engine.js,packages/google-cloud-discoveryengine/samples/README.md) | | Engine_service.update_engine | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1alpha/engine_service.update_engine.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-discoveryengine/samples/generated/v1alpha/engine_service.update_engine.js,packages/google-cloud-discoveryengine/samples/README.md) | | Estimate_billing_service.estimate_data_size | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1alpha/estimate_billing_service.estimate_data_size.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-discoveryengine/samples/generated/v1alpha/estimate_billing_service.estimate_data_size.js,packages/google-cloud-discoveryengine/samples/README.md) | +| Rank_service.rank | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1alpha/rank_service.rank.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-discoveryengine/samples/generated/v1alpha/rank_service.rank.js,packages/google-cloud-discoveryengine/samples/README.md) | | Recommendation_service.recommend | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1alpha/recommendation_service.recommend.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-discoveryengine/samples/generated/v1alpha/recommendation_service.recommend.js,packages/google-cloud-discoveryengine/samples/README.md) | | Schema_service.create_schema | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1alpha/schema_service.create_schema.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-discoveryengine/samples/generated/v1alpha/schema_service.create_schema.js,packages/google-cloud-discoveryengine/samples/README.md) | | Schema_service.delete_schema | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1alpha/schema_service.delete_schema.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-discoveryengine/samples/generated/v1alpha/schema_service.delete_schema.js,packages/google-cloud-discoveryengine/samples/README.md) | diff --git a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1alpha/chunk.proto b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1alpha/chunk.proto index 0d3578d2645..a30c5dd274f 100644 --- a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1alpha/chunk.proto +++ b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1alpha/chunk.proto @@ -48,6 +48,34 @@ message Chunk { string title = 2; } + // Page span of the chunk. + message PageSpan { + // The start page of the chunk. + int32 page_start = 1; + + // The end page of the chunk. + int32 page_end = 2; + } + + // Metadata of the current chunk. This field is only populated on + // [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search] + // API. + message ChunkMetadata { + // The previous chunks of the current chunk. The number is controlled by + // [SearchRequest.ContentSearchSpec.ChunkSpec.num_previous_chunks][google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ChunkSpec.num_previous_chunks]. + // This field is only populated on + // [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search] + // API. + repeated Chunk previous_chunks = 1; + + // The next chunks of the current chunk. The number is controlled by + // [SearchRequest.ContentSearchSpec.ChunkSpec.num_next_chunks][google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ChunkSpec.num_next_chunks]. + // This field is only populated on + // [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search] + // API. + repeated Chunk next_chunks = 2; + } + // The full resource name of the chunk. // Format: // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}/chunks/{chunk_id}`. @@ -56,7 +84,7 @@ message Chunk { // characters. string name = 1; - // Unique chunk id of the current chunk. + // Unique chunk ID of the current chunk. string id = 2; // Content is a string from a document (parsed content). @@ -69,4 +97,10 @@ message Chunk { // It contains derived data that are not in the original input document. google.protobuf.Struct derived_struct_data = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Page span of the chunk. + PageSpan page_span = 6; + + // Output only. Metadata of the current chunk. + ChunkMetadata chunk_metadata = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; } diff --git a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1alpha/common.proto b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1alpha/common.proto index c096c9c4898..026a6bf6a92 100644 --- a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1alpha/common.proto +++ b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1alpha/common.proto @@ -39,6 +39,18 @@ option (google.api.resource_definition) = { type: "discoveryengine.googleapis.com/Location" pattern: "projects/{project}/locations/{location}" }; +option (google.api.resource_definition) = { + type: "discoveryengine.googleapis.com/GroundingConfig" + pattern: "projects/{project}/locations/{location}/groundingConfigs/{grounding_config}" +}; +option (google.api.resource_definition) = { + type: "discoveryengine.googleapis.com/RankingConfig" + pattern: "projects/{project}/locations/{location}/rankingConfigs/{ranking_config}" +}; +option (google.api.resource_definition) = { + type: "healthcare.googleapis.com/FhirStore" + pattern: "projects/{project}/locations/{location}/datasets/{dataset}/fhirStores/{fhir_store}" +}; // The industry vertical associated with the // [DataStore][google.cloud.discoveryengine.v1alpha.DataStore]. @@ -52,6 +64,9 @@ enum IndustryVertical { // The media industry vertical. MEDIA = 2; + + // The healthcare FHIR vertical. + HEALTHCARE_FHIR = 7; } // The type of solution. @@ -67,6 +82,11 @@ enum SolutionType { // Used for use cases related to the Generative AI agent. SOLUTION_TYPE_CHAT = 3; + + // Used for use cases related to the Generative Chat agent. + // It's used for Generative chat engine only, the associated data stores + // must enrolled with `SOLUTION_TYPE_CHAT` solution. + SOLUTION_TYPE_GENERATIVE_CHAT = 4; } // Tiers of search features. Different tiers might have different diff --git a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1alpha/document.proto b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1alpha/document.proto index 88fd8886824..cead31c531a 100644 --- a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1alpha/document.proto +++ b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1alpha/document.proto @@ -202,3 +202,22 @@ message Document { google.protobuf.Timestamp index_time = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; } + +// Document captures all raw metadata information of items to be recommended or +// searched. +message ProcessedDocument { + // Output format of the processed document. + oneof processed_data_format { + // The JSON string representation of the processed document. + string json_data = 2; + } + + // Required. Full resource name of the referenced document, in the format + // `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`. + string document = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/Document" + } + ]; +} diff --git a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1alpha/document_service.proto b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1alpha/document_service.proto index c4d18d23ffd..6e954a9f6cd 100644 --- a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1alpha/document_service.proto +++ b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1alpha/document_service.proto @@ -158,6 +158,19 @@ service DocumentService { metadata_type: "google.cloud.discoveryengine.v1alpha.PurgeDocumentsMetadata" }; } + + // Gets the parsed layout information for a + // [Document][google.cloud.discoveryengine.v1alpha.Document]. + rpc GetProcessedDocument(GetProcessedDocumentRequest) + returns (ProcessedDocument) { + option (google.api.http) = { + get: "/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*/documents/*}:getProcessedDocument" + additional_bindings { + get: "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}:getProcessedDocument" + } + }; + option (google.api.method_signature) = "name"; + } } // Request message for @@ -322,3 +335,54 @@ message DeleteDocumentRequest { } ]; } + +// Request message for +// [DocumentService.GetDocument][google.cloud.discoveryengine.v1alpha.DocumentService.GetDocument] +// method. +message GetProcessedDocumentRequest { + // The type of processing to return in the response. + enum ProcessedDocumentType { + // Default value. + PROCESSED_DOCUMENT_TYPE_UNSPECIFIED = 0; + + // Available for all data store parsing configs. + PARSED_DOCUMENT = 1; + + // Only available if ChunkingConfig is enabeld on the data store. + CHUNKED_DOCUMENT = 2; + } + + // The format of the returned processed document. If unspecified, defaults to + // JSON. + enum ProcessedDocumentFormat { + // Default value. + PROCESSED_DOCUMENT_FORMAT_UNSPECIFIED = 0; + + // output format will be a JSON string representation of processed document. + JSON = 1; + } + + // Required. Full resource name of + // [Document][google.cloud.discoveryengine.v1alpha.Document], such as + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. + // + // If the caller does not have permission to access the + // [Document][google.cloud.discoveryengine.v1alpha.Document], regardless of + // whether or not it exists, a `PERMISSION_DENIED` error is returned. + // + // If the requested [Document][google.cloud.discoveryengine.v1alpha.Document] + // does not exist, a `NOT_FOUND` error is returned. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/Document" + } + ]; + + // Required. What type of processing to return. + ProcessedDocumentType processed_document_type = 2 + [(google.api.field_behavior) = REQUIRED]; + + // What format output should be. If unspecified, defaults to JSON. + ProcessedDocumentFormat processed_document_format = 3; +} diff --git a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1alpha/import_config.proto b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1alpha/import_config.proto index f6c45aecf18..062406a9b5f 100644 --- a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1alpha/import_config.proto +++ b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1alpha/import_config.proto @@ -21,6 +21,7 @@ import "google/api/resource.proto"; import "google/cloud/discoveryengine/v1alpha/completion.proto"; import "google/cloud/discoveryengine/v1alpha/document.proto"; import "google/cloud/discoveryengine/v1alpha/user_event.proto"; +import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; import "google/rpc/status.proto"; import "google/type/date.proto"; @@ -123,6 +124,233 @@ message BigQuerySource { string data_schema = 6; } +// The Spanner source for importing data +message SpannerSource { + // The project ID that the Spanner source is in with a length limit of 128 + // characters. If not specified, inherits the project ID from the parent + // request. + string project_id = 1; + + // Required. The instance ID of the source Spanner table. + string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The database ID of the source Spanner table. + string database_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The table name of the Spanner database that needs to be imported. + string table_id = 4 [(google.api.field_behavior) = REQUIRED]; + + // Whether to apply data boost on Spanner export. Enabling this option will + // incur additional cost. More info can be found + // [here](https://cloud.google.com/spanner/docs/databoost/databoost-overview#billing_and_quotas). + bool enable_data_boost = 5; +} + +// The Bigtable Options object that contains information to support +// the import. +message BigtableOptions { + // The column family of the Bigtable. + message BigtableColumnFamily { + // The field name to use for this column family in the document. The + // name has to match the pattern `[a-zA-Z0-9][a-zA-Z0-9-_]*`. If not set, + // it is parsed from the family name with best effort. However, due to + // different naming patterns, field name collisions could happen, where + // parsing behavior is undefined. + string field_name = 1; + + // The encoding mode of the values when the type is not STRING. + // Acceptable encoding values are: + // + // * `TEXT`: indicates values are alphanumeric text strings. + // * `BINARY`: indicates values are encoded using `HBase Bytes.toBytes` + // family of functions. This can be overridden for a specific column + // by listing that column in `columns` and specifying an encoding for it. + Encoding encoding = 2; + + // The type of values in this column family. + // The values are expected to be encoded using `HBase Bytes.toBytes` + // function when the encoding value is set to `BINARY`. + Type type = 3; + + // The list of objects that contains column level information for each + // column. If a column is not present in this list it will be ignored. + repeated BigtableColumn columns = 4; + } + + // The column of the Bigtable. + message BigtableColumn { + // Required. Qualifier of the column. If it cannot be decoded with utf-8, + // use a base-64 encoded string instead. + bytes qualifier = 1 [(google.api.field_behavior) = REQUIRED]; + + // The field name to use for this column in the document. The name has to + // match the pattern `[a-zA-Z0-9][a-zA-Z0-9-_]*`. + // If not set, it is parsed from the qualifier bytes with best effort. + // However, due to different naming patterns, field name collisions could + // happen, where parsing behavior is undefined. + string field_name = 2; + + // The encoding mode of the values when the type is not `STRING`. + // Acceptable encoding values are: + // + // * `TEXT`: indicates values are alphanumeric text strings. + // * `BINARY`: indicates values are encoded using `HBase Bytes.toBytes` + // family of functions. This can be overridden for a specific column + // by listing that column in `columns` and specifying an encoding for it. + Encoding encoding = 3; + + // The type of values in this column family. + // The values are expected to be encoded using `HBase Bytes.toBytes` + // function when the encoding value is set to `BINARY`. + Type type = 4; + } + + // The type of values in a Bigtable column or column family. + // The values are expected to be encoded using + // [HBase + // Bytes.toBytes](https://hbase.apache.org/apidocs/org/apache/hadoop/hbase/util/Bytes.html) + // function when the encoding value is set to `BINARY`. + enum Type { + // The type is unspecified. + TYPE_UNSPECIFIED = 0; + + // String type. + STRING = 1; + + // Numerical type. + NUMBER = 2; + + // Integer type. + INTEGER = 3; + + // Variable length integer type. + VAR_INTEGER = 4; + + // BigDecimal type. + BIG_NUMERIC = 5; + + // Boolean type. + BOOLEAN = 6; + + // JSON type. + JSON = 7; + } + + // The encoding mode of a Bigtable column or column family. + enum Encoding { + // The encoding is unspecified. + ENCODING_UNSPECIFIED = 0; + + // Text encoding. + TEXT = 1; + + // Binary encoding. + BINARY = 2; + } + + // The field name used for saving row key value in the document. The name has + // to match the pattern `[a-zA-Z0-9][a-zA-Z0-9-_]*`. + string key_field_name = 1; + + // The mapping from family names to an object that contains column families + // level information for the given column family. If a family is not present + // in this map it will be ignored. + map families = 2; +} + +// The Cloud Bigtable source for importing data. +message BigtableSource { + // The project ID that the Bigtable source is in with a length limit of 128 + // characters. If not specified, inherits the project ID from the parent + // request. + string project_id = 1; + + // Required. The instance ID of the Cloud Bigtable that needs to be imported. + string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The table ID of the Cloud Bigtable that needs to be imported. + string table_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Bigtable options that contains information needed when parsing + // data into typed structures. For example, column type annotations. + BigtableOptions bigtable_options = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// Cloud FhirStore source import data from. +message FhirStoreSource { + // Required. The full resource name of the FHIR store to import data from, in + // the format of + // `projects/{project}/locations/{location}/datasets/{dataset}/fhirStores/{fhir_store}`. + string fhir_store = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "healthcare.googleapis.com/FhirStore" + } + ]; + + // Intermediate Cloud Storage directory used for the import with a length + // limit of 2,000 characters. Can be specified if one wants to have the + // FhirStore export to a specific Cloud Storage directory. + string gcs_staging_dir = 2; +} + +// Cloud SQL source import data from. +message CloudSqlSource { + // The project ID that the Cloud SQL source is in with a length limit of 128 + // characters. If not specified, inherits the project ID from the parent + // request. + string project_id = 1; + + // Required. The Cloud SQL instance to copy the data from with a length limit + // of 256 characters. + string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Cloud SQL database to copy the data from with a length limit + // of 256 characters. + string database_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Cloud SQL table to copy the data from with a length limit of + // 256 characters. + string table_id = 4 [(google.api.field_behavior) = REQUIRED]; + + // Intermediate Cloud Storage directory used for the import with a length + // limit of 2,000 characters. Can be specified if one wants to have the + // Cloud SQL export to a specific Cloud Storage directory. + // + // Please ensure that the Cloud SQL service account has the necessary Cloud + // Storage Admin permissions to access the specified Cloud Storage directory. + string gcs_staging_dir = 5; + + // Option for serverless export. Enabling this option will incur + // additional cost. More info can be found + // [here](https://cloud.google.com/sql/pricing#serverless). + bool offload = 6; +} + +// Firestore source import data from. +message FirestoreSource { + // The project ID that the Cloud SQL source is in with a length limit of 128 + // characters. If not specified, inherits the project ID from the parent + // request. + string project_id = 1; + + // Required. The Firestore database to copy the data from with a length limit + // of 256 characters. + string database_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Firestore collection to copy the data from with a length + // limit of 1,500 characters. + string collection_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Intermediate Cloud Storage directory used for the import with a length + // limit of 2,000 characters. Can be specified if one wants to have the + // Firestore export to a specific Cloud Storage directory. + // + // Please ensure that the Firestore service account has the necessary Cloud + // Storage Admin permissions to access the specified Cloud Storage directory. + string gcs_staging_dir = 4; +} + // Configuration of destination for Import related errors. message ImportErrorConfig { // Required. Errors destination. @@ -220,6 +448,9 @@ message ImportDocumentsMetadata { // Count of entries that encountered errors while processing. int64 failure_count = 4; + + // Total count of entries that were processed. + int64 total_count = 5; } // Request message for Import methods. @@ -256,6 +487,21 @@ message ImportDocumentsRequest { // BigQuery input source. BigQuerySource bigquery_source = 4; + + // FhirStore input source. + FhirStoreSource fhir_store_source = 10; + + // Spanner input source. + SpannerSource spanner_source = 11; + + // Cloud SQL input source. + CloudSqlSource cloud_sql_source = 12; + + // Firestore input source. + FirestoreSource firestore_source = 13; + + // Cloud Bigtable input source. + BigtableSource bigtable_source = 15; } // Required. The parent branch resource name, such as @@ -276,6 +522,10 @@ message ImportDocumentsRequest { // [ReconciliationMode.INCREMENTAL][google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode.INCREMENTAL]. ReconciliationMode reconciliation_mode = 6; + // Indicates which fields in the provided imported documents to update. If + // not set, the default is to update all fields. + google.protobuf.FieldMask update_mask = 7; + // Whether to automatically generate IDs for the documents if absent. // // If set to `true`, @@ -289,45 +539,54 @@ message ImportDocumentsRequest { // [id_field][google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.id_field], // otherwise, documents without IDs fail to be imported. // - // Only set this field when using - // [GcsSource][google.cloud.discoveryengine.v1alpha.GcsSource] or - // [BigQuerySource][google.cloud.discoveryengine.v1alpha.BigQuerySource], and - // when + // Supported data sources: + // + // * [GcsSource][google.cloud.discoveryengine.v1alpha.GcsSource]. // [GcsSource.data_schema][google.cloud.discoveryengine.v1alpha.GcsSource.data_schema] - // or + // must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. + // * [BigQuerySource][google.cloud.discoveryengine.v1alpha.BigQuerySource]. // [BigQuerySource.data_schema][google.cloud.discoveryengine.v1alpha.BigQuerySource.data_schema] - // is `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. + // must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. + // * [SpannerSource][google.cloud.discoveryengine.v1alpha.SpannerSource]. + // * [CloudSqlSource][google.cloud.discoveryengine.v1alpha.CloudSqlSource]. + // * [FirestoreSource][google.cloud.discoveryengine.v1alpha.FirestoreSource]. + // * [BigtableSource][google.cloud.discoveryengine.v1alpha.BigtableSource]. bool auto_generate_ids = 8; - // The field in the Cloud Storage and BigQuery sources that indicates the - // unique IDs of the documents. + // The field indicates the ID field or column to be used as unique IDs of + // the documents. // // For [GcsSource][google.cloud.discoveryengine.v1alpha.GcsSource] it is the // key of the JSON field. For instance, `my_id` for JSON `{"my_id": - // "some_uuid"}`. For - // [BigQuerySource][google.cloud.discoveryengine.v1alpha.BigQuerySource] it is - // the column name of the BigQuery table where the unique ids are stored. + // "some_uuid"}`. For others, it may be the column name of the table where the + // unique ids are stored. // - // The values of the JSON field or the BigQuery column are used as the + // The values of the JSON field or the table column are used as the // [Document.id][google.cloud.discoveryengine.v1alpha.Document.id]s. The JSON - // field or the BigQuery column must be of string type, and the values must be + // field or the table column must be of string type, and the values must be // set as valid strings conform to // [RFC-1034](https://tools.ietf.org/html/rfc1034) with 1-63 characters. // Otherwise, documents without valid IDs fail to be imported. // - // Only set this field when using - // [GcsSource][google.cloud.discoveryengine.v1alpha.GcsSource] or - // [BigQuerySource][google.cloud.discoveryengine.v1alpha.BigQuerySource], and - // when - // [GcsSource.data_schema][google.cloud.discoveryengine.v1alpha.GcsSource.data_schema] - // or - // [BigQuerySource.data_schema][google.cloud.discoveryengine.v1alpha.BigQuerySource.data_schema] - // is `custom`. And only set this field when + // Only set this field when // [auto_generate_ids][google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.auto_generate_ids] // is unset or set as `false`. Otherwise, an INVALID_ARGUMENT error is thrown. // // If it is unset, a default value `_id` is used when importing from the // allowed data sources. + // + // Supported data sources: + // + // * [GcsSource][google.cloud.discoveryengine.v1alpha.GcsSource]. + // [GcsSource.data_schema][google.cloud.discoveryengine.v1alpha.GcsSource.data_schema] + // must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. + // * [BigQuerySource][google.cloud.discoveryengine.v1alpha.BigQuerySource]. + // [BigQuerySource.data_schema][google.cloud.discoveryengine.v1alpha.BigQuerySource.data_schema] + // must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. + // * [SpannerSource][google.cloud.discoveryengine.v1alpha.SpannerSource]. + // * [CloudSqlSource][google.cloud.discoveryengine.v1alpha.CloudSqlSource]. + // * [FirestoreSource][google.cloud.discoveryengine.v1alpha.FirestoreSource]. + // * [BigtableSource][google.cloud.discoveryengine.v1alpha.BigtableSource]. string id_field = 9; } @@ -405,3 +664,35 @@ message ImportSuggestionDenyListEntriesMetadata { // finish time. google.protobuf.Timestamp update_time = 2; } + +// Response of the +// [CompletionService.ImportCompletionSuggestions][google.cloud.discoveryengine.v1alpha.CompletionService.ImportCompletionSuggestions] +// method. If the long running operation is done, this message is returned by +// the google.longrunning.Operations.response field if the operation is +// successful. +message ImportCompletionSuggestionsResponse { + // A sample of errors encountered while processing the request. + repeated google.rpc.Status error_samples = 1; + + // Count of + // [CompletionSuggestion][google.cloud.discoveryengine.v1alpha.CompletionSuggestion]s + // successfully imported. + int64 success_count = 2; + + // Count of + // [CompletionSuggestion][google.cloud.discoveryengine.v1alpha.CompletionSuggestion]s + // that failed to be imported. + int64 failure_count = 3; +} + +// Metadata related to the progress of the ImportCompletionSuggestions +// operation. This will be returned by the google.longrunning.Operation.metadata +// field. +message ImportCompletionSuggestionsMetadata { + // Operation create time. + google.protobuf.Timestamp create_time = 1; + + // Operation last update time. If the operation is done, this is also the + // finish time. + google.protobuf.Timestamp update_time = 2; +} diff --git a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1alpha/rank_service.proto b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1alpha/rank_service.proto new file mode 100644 index 00000000000..b10073f2f38 --- /dev/null +++ b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1alpha/rank_service.proto @@ -0,0 +1,115 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.discoveryengine.v1alpha; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Alpha"; +option go_package = "cloud.google.com/go/discoveryengine/apiv1alpha/discoveryenginepb;discoveryenginepb"; +option java_multiple_files = true; +option java_outer_classname = "RankServiceProto"; +option java_package = "com.google.cloud.discoveryengine.v1alpha"; +option objc_class_prefix = "DISCOVERYENGINE"; +option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1alpha"; +option ruby_package = "Google::Cloud::DiscoveryEngine::V1alpha"; + +// Service for ranking text records. +service RankService { + option (google.api.default_host) = "discoveryengine.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Ranks a list of text records based on the given input query. + rpc Rank(RankRequest) returns (RankResponse) { + option (google.api.http) = { + post: "/v1alpha/{ranking_config=projects/*/locations/*/rankingConfigs/*}:rank" + body: "*" + }; + } +} + +// Record message for +// [RankService.Rank][google.cloud.discoveryengine.v1alpha.RankService.Rank] +// method. +message RankingRecord { + // The unique ID to represent the record. + string id = 1; + + // The title of the record. Empty by default. + // At least one of + // [title][google.cloud.discoveryengine.v1alpha.RankingRecord.title] or + // [content][google.cloud.discoveryengine.v1alpha.RankingRecord.content] + // should be set otherwise an INVALID_ARGUMENT error is thrown. + string title = 2; + + // The content of the record. Empty by default. + // At least one of + // [title][google.cloud.discoveryengine.v1alpha.RankingRecord.title] or + // [content][google.cloud.discoveryengine.v1alpha.RankingRecord.content] + // should be set otherwise an INVALID_ARGUMENT error is thrown. + string content = 3; + + // The score of this record based on the given query and selected model. + float score = 4; +} + +// Request message for +// [RankService.Rank][google.cloud.discoveryengine.v1alpha.RankService.Rank] +// method. +message RankRequest { + // Required. The resource name of the rank service config, such as + // `projects/{project_num}/locations/{location_id}/rankingConfigs/default_ranking_config`. + string ranking_config = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "discoveryengine.googleapis.com/RankingConfig" + } + ]; + + // The identifier of the model to use. It is one of: + // + // * `semantic-ranker-512@latest`: Semantic ranking model with maxiumn input + // token size 512. + // + // It is set to `semantic-ranker-512@latest` by default if unspecified. + string model = 2; + + // The number of results to return. If this is unset or no bigger than zero, + // returns all results. + int32 top_n = 3; + + // The query to use. + string query = 4; + + // Required. A list of records to rank. At most 200 records to rank. + repeated RankingRecord records = 5 [(google.api.field_behavior) = REQUIRED]; + + // If true, the response will contain only record ID and score. By default, it + // is false, the response will contain record details. + bool ignore_record_details_in_response = 6; +} + +// Response message for +// [RankService.Rank][google.cloud.discoveryengine.v1alpha.RankService.Rank] +// method. +message RankResponse { + // A list of records sorted by descending score. + repeated RankingRecord records = 5; +} diff --git a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1alpha/search_service.proto b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1alpha/search_service.proto index 920a6ed82fd..047a2197505 100644 --- a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1alpha/search_service.proto +++ b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1alpha/search_service.proto @@ -218,6 +218,80 @@ message SearchRequest { 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 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 { + // Can be one of: + // 1. The numerical field value. + // 2. The duration spec for freshness: + // 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]]`. + string attribute_value = 1; + + // The value between -1 to 1 by which to boost the score if the + // attribute_value evaluates to the value specified above. + float boost_amount = 2; + } + + // 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 name of the field whose value will be used to determine the + // boost amount. + string field_name = 1; + + // 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; + + // The interpolation type to be applied to connect the control points + // listed below. + InterpolationType interpolation_type = 3; + + // 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; + } + // An expression which specifies a boost condition. The syntax and // supported fields are the same as a filter expression. See // [SearchRequest.filter][google.cloud.discoveryengine.v1alpha.SearchRequest.filter] @@ -233,21 +307,27 @@ message SearchRequest { // 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 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. + // 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. + // ignored. Only one of the (condition, boost) combination or the + // boost_control_spec below are set. If both are set then the global boost + // is ignored and the more fine-grained boost_control_spec is applied. float boost = 2; + + // Complex specification for custom ranking based on customer defined + // attribute value. + BoostControlSpec boost_control_spec = 3; } // Condition boost specifications. If a document matches multiple conditions @@ -348,11 +428,13 @@ message SearchRequest { // Supported values are: // // * `stable`: string. Default value when no value is specified. Uses a - // generally available, fine-tuned version of the text-bison@001 - // model. - // * `preview`: string. (Public preview) Uses a fine-tuned version of - // the text-bison@002 model. This model works only for summaries in - // English. + // generally available, fine-tuned model. For more information, see + // [Answer generation model versions and + // lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models). + // * `preview`: string. (Public preview) Uses a preview model. For more + // information, see + // [Answer generation model versions and + // lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models). string version = 1; } @@ -419,6 +501,14 @@ message SearchRequest { // If specified, the spec will be used to modify the model specification // provided to the LLM. ModelSpec model_spec = 7; + + // If true, answer will be generated from most relevant chunks from top + // search results. This feature will improve summary quality. + // Please note that with this feature enabled, not all top search results + // will be referenced and included in the reference list, so the citation + // source index only points to the search results listed in the reference + // list. + bool use_semantic_chunks = 8; } // A specification for configuring the extractive content in a search @@ -459,10 +549,9 @@ message SearchRequest { int32 max_extractive_segment_count = 2; // Specifies whether to return the confidence score from the extractive - // segments in each search result. The default value is `false`. - // - // Note: this is a priavte preview feature and only works for allowlisted - // users, please reach out to Cloud Support team if you want to use it. + // segments in each search result. This feature is available only for new + // or allowlisted data stores. To allowlist your data store, please + // contact your Customer Engineer. The default value is `false`. bool return_extractive_segment_score = 3; // Specifies whether to also include the adjacent from each selected @@ -476,6 +565,23 @@ message SearchRequest { int32 num_next_segments = 5; } + // Specifies the chunk spec to be returned from the search response. + // Only available if the + // [SearchRequest.ContentSearchSpec.search_result_mode][google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.search_result_mode] + // is set to + // [CHUNKS][google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SearchResultMode.CHUNKS] + message ChunkSpec { + // The number of previous chunks to be returned of the current chunk. The + // maximum allowed value is 3. + // If not specified, no previous chunks will be returned. + int32 num_previous_chunks = 1; + + // The number of next chunks to be returned of the current chunk. The + // maximum allowed value is 3. + // If not specified, no next chunks will be returned. + int32 num_next_chunks = 2; + } + // Specifies the search result mode. If unspecified, the // search result mode is based on // [DataStore.DocumentProcessingConfig.chunking_config][]: @@ -513,6 +619,13 @@ message SearchRequest { // it defaults to `CHUNKS`. // * Otherwise, it defaults to `DOCUMENTS`. SearchResultMode search_result_mode = 4; + + // Specifies the chunk spec to be returned from the search response. + // Only available if the + // [SearchRequest.ContentSearchSpec.search_result_mode][google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.search_result_mode] + // is set to + // [CHUNKS][google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SearchResultMode.CHUNKS] + ChunkSpec chunk_spec = 5; } // The specification that uses customized query embedding vector to do @@ -560,11 +673,15 @@ message SearchRequest { ImageQuery image_query = 19; // Maximum number of - // [Document][google.cloud.discoveryengine.v1alpha.Document]s to return. If - // unspecified, defaults to a reasonable value. The maximum allowed value is - // 100. Values above 100 are coerced to 100. + // [Document][google.cloud.discoveryengine.v1alpha.Document]s to return. The + // maximum allowed value depends on the data type. Values above the maximum + // value are coerced to the maximum value. // - // If this field is negative, an `INVALID_ARGUMENT` is returned. + // * Websites with basic indexing: Default `10`, Maximum `25`. + // * Websites with advanced indexing: Default `25`, Maximum `50`. + // * Other: Default `50`, Maximum `100`. + // + // If this field is negative, an `INVALID_ARGUMENT` is returned. int32 page_size = 4; // A page token received from a previous @@ -701,7 +818,8 @@ message SearchRequest { // // If // [SearchRequest.EmbeddingSpec.EmbeddingVector.field_path][google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector.field_path] - // is not provided, it will use [ServingConfig.EmbeddingConfig.field_path][]. + // is not provided, it will use + // [ServingConfig.EmbeddingConfig.field_path][google.cloud.discoveryengine.v1alpha.ServingConfig.embedding_config]. EmbeddingSpec embedding_spec = 23; // The ranking expression controls the customized ranking on retrieval @@ -867,6 +985,15 @@ message SearchResponse { // Document reference. message Reference { + // Chunk content. + message ChunkContent { + // Chunk textual content. + string content = 1; + + // Page identifier. + string page_identifier = 2; + } + // Title of the document. string title = 1; @@ -884,6 +1011,9 @@ message SearchResponse { // Cloud Storage or HTTP uri for the document. string uri = 3; + + // List of cited chunk contents derived from document content. + repeated ChunkContent chunk_contents = 4; } // Summary with metadata information. diff --git a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1alpha/search_tuning_service.proto b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1alpha/search_tuning_service.proto index 334edae3e38..92d0479a9b9 100644 --- a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1alpha/search_tuning_service.proto +++ b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1alpha/search_tuning_service.proto @@ -65,8 +65,8 @@ message TrainCustomModelRequest { // A newline delimited jsonl/ndjson file. // // For search-tuning model, each line should have the _id, title - // and text. Example: {"_id": "doc1", title: "relevant doc", "text": - // "relevant text"} + // and text. Example: + // `{"_id": "doc1", title: "relevant doc", "text": "relevant text"}` string corpus_data_path = 1; // The gcs query data which could be associated in train data. @@ -137,6 +137,9 @@ message TrainCustomModelResponse { // * **in-progress**: Model training is in progress. // * **ready**: The model is ready for serving. string model_status = 3; + + // The metrics of the trained model. + map metrics = 4; } // Metadata related to the progress of the TrainCustomModel operation. This is diff --git a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1alpha/serving_config_service.proto b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1alpha/serving_config_service.proto index 22fd94fd531..0cba972b1e6 100644 --- a/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1alpha/serving_config_service.proto +++ b/packages/google-cloud-discoveryengine/protos/google/cloud/discoveryengine/v1alpha/serving_config_service.proto @@ -32,7 +32,8 @@ option objc_class_prefix = "DISCOVERYENGINE"; option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1alpha"; option ruby_package = "Google::Cloud::DiscoveryEngine::V1alpha"; -// Service for operations related to [ServingConfig][]. +// Service for operations related to +// [ServingConfig][google.cloud.discoveryengine.v1alpha.ServingConfig]. service ServingConfigService { option (google.api.default_host) = "discoveryengine.googleapis.com"; option (google.api.oauth_scopes) = diff --git a/packages/google-cloud-discoveryengine/protos/protos.d.ts b/packages/google-cloud-discoveryengine/protos/protos.d.ts index 8426426f16d..876664d0def 100644 --- a/packages/google-cloud-discoveryengine/protos/protos.d.ts +++ b/packages/google-cloud-discoveryengine/protos/protos.d.ts @@ -17938,7 +17938,8 @@ export namespace google { enum IndustryVertical { INDUSTRY_VERTICAL_UNSPECIFIED = 0, GENERIC = 1, - MEDIA = 2 + MEDIA = 2, + HEALTHCARE_FHIR = 7 } /** SolutionType enum. */ @@ -17946,7 +17947,8 @@ export namespace google { SOLUTION_TYPE_UNSPECIFIED = 0, SOLUTION_TYPE_RECOMMENDATION = 1, SOLUTION_TYPE_SEARCH = 2, - SOLUTION_TYPE_CHAT = 3 + SOLUTION_TYPE_CHAT = 3, + SOLUTION_TYPE_GENERATIVE_CHAT = 4 } /** SearchTier enum. */ @@ -19282,6 +19284,12 @@ export namespace google { /** Chunk derivedStructData */ derivedStructData?: (google.protobuf.IStruct|null); + + /** Chunk pageSpan */ + pageSpan?: (google.cloud.discoveryengine.v1alpha.Chunk.IPageSpan|null); + + /** Chunk chunkMetadata */ + chunkMetadata?: (google.cloud.discoveryengine.v1alpha.Chunk.IChunkMetadata|null); } /** Represents a Chunk. */ @@ -19308,6 +19316,12 @@ export namespace google { /** Chunk derivedStructData. */ public derivedStructData?: (google.protobuf.IStruct|null); + /** Chunk pageSpan. */ + public pageSpan?: (google.cloud.discoveryengine.v1alpha.Chunk.IPageSpan|null); + + /** Chunk chunkMetadata. */ + public chunkMetadata?: (google.cloud.discoveryengine.v1alpha.Chunk.IChunkMetadata|null); + /** * Creates a new Chunk instance using the specified properties. * @param [properties] Properties to set @@ -19490,6 +19504,212 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a PageSpan. */ + interface IPageSpan { + + /** PageSpan pageStart */ + pageStart?: (number|null); + + /** PageSpan pageEnd */ + pageEnd?: (number|null); + } + + /** Represents a PageSpan. */ + class PageSpan implements IPageSpan { + + /** + * Constructs a new PageSpan. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1alpha.Chunk.IPageSpan); + + /** PageSpan pageStart. */ + public pageStart: number; + + /** PageSpan pageEnd. */ + public pageEnd: number; + + /** + * Creates a new PageSpan instance using the specified properties. + * @param [properties] Properties to set + * @returns PageSpan instance + */ + public static create(properties?: google.cloud.discoveryengine.v1alpha.Chunk.IPageSpan): google.cloud.discoveryengine.v1alpha.Chunk.PageSpan; + + /** + * Encodes the specified PageSpan message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.Chunk.PageSpan.verify|verify} messages. + * @param message PageSpan message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1alpha.Chunk.IPageSpan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PageSpan message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.Chunk.PageSpan.verify|verify} messages. + * @param message PageSpan message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1alpha.Chunk.IPageSpan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PageSpan message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PageSpan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1alpha.Chunk.PageSpan; + + /** + * Decodes a PageSpan message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PageSpan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1alpha.Chunk.PageSpan; + + /** + * Verifies a PageSpan message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PageSpan message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PageSpan + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1alpha.Chunk.PageSpan; + + /** + * Creates a plain object from a PageSpan message. Also converts values to other types if specified. + * @param message PageSpan + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1alpha.Chunk.PageSpan, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PageSpan to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PageSpan + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ChunkMetadata. */ + interface IChunkMetadata { + + /** ChunkMetadata previousChunks */ + previousChunks?: (google.cloud.discoveryengine.v1alpha.IChunk[]|null); + + /** ChunkMetadata nextChunks */ + nextChunks?: (google.cloud.discoveryengine.v1alpha.IChunk[]|null); + } + + /** Represents a ChunkMetadata. */ + class ChunkMetadata implements IChunkMetadata { + + /** + * Constructs a new ChunkMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1alpha.Chunk.IChunkMetadata); + + /** ChunkMetadata previousChunks. */ + public previousChunks: google.cloud.discoveryengine.v1alpha.IChunk[]; + + /** ChunkMetadata nextChunks. */ + public nextChunks: google.cloud.discoveryengine.v1alpha.IChunk[]; + + /** + * Creates a new ChunkMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ChunkMetadata instance + */ + public static create(properties?: google.cloud.discoveryengine.v1alpha.Chunk.IChunkMetadata): google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata; + + /** + * Encodes the specified ChunkMetadata message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata.verify|verify} messages. + * @param message ChunkMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1alpha.Chunk.IChunkMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChunkMetadata message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata.verify|verify} messages. + * @param message ChunkMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1alpha.Chunk.IChunkMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChunkMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChunkMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata; + + /** + * Decodes a ChunkMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChunkMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata; + + /** + * Verifies a ChunkMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChunkMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChunkMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata; + + /** + * Creates a plain object from a ChunkMetadata message. Also converts values to other types if specified. + * @param message ChunkMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChunkMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChunkMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Represents a ChunkService */ @@ -20630,250 +20850,1186 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an ImportErrorConfig. */ - interface IImportErrorConfig { + /** Properties of a SpannerSource. */ + interface ISpannerSource { - /** ImportErrorConfig gcsPrefix */ - gcsPrefix?: (string|null); + /** SpannerSource projectId */ + projectId?: (string|null); + + /** SpannerSource instanceId */ + instanceId?: (string|null); + + /** SpannerSource databaseId */ + databaseId?: (string|null); + + /** SpannerSource tableId */ + tableId?: (string|null); + + /** SpannerSource enableDataBoost */ + enableDataBoost?: (boolean|null); } - /** Represents an ImportErrorConfig. */ - class ImportErrorConfig implements IImportErrorConfig { + /** Represents a SpannerSource. */ + class SpannerSource implements ISpannerSource { /** - * Constructs a new ImportErrorConfig. + * Constructs a new SpannerSource. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.discoveryengine.v1alpha.IImportErrorConfig); + constructor(properties?: google.cloud.discoveryengine.v1alpha.ISpannerSource); - /** ImportErrorConfig gcsPrefix. */ - public gcsPrefix?: (string|null); + /** SpannerSource projectId. */ + public projectId: string; - /** ImportErrorConfig destination. */ - public destination?: "gcsPrefix"; + /** SpannerSource instanceId. */ + public instanceId: string; + + /** SpannerSource databaseId. */ + public databaseId: string; + + /** SpannerSource tableId. */ + public tableId: string; + + /** SpannerSource enableDataBoost. */ + public enableDataBoost: boolean; /** - * Creates a new ImportErrorConfig instance using the specified properties. + * Creates a new SpannerSource instance using the specified properties. * @param [properties] Properties to set - * @returns ImportErrorConfig instance + * @returns SpannerSource instance */ - public static create(properties?: google.cloud.discoveryengine.v1alpha.IImportErrorConfig): google.cloud.discoveryengine.v1alpha.ImportErrorConfig; + public static create(properties?: google.cloud.discoveryengine.v1alpha.ISpannerSource): google.cloud.discoveryengine.v1alpha.SpannerSource; /** - * Encodes the specified ImportErrorConfig message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportErrorConfig.verify|verify} messages. - * @param message ImportErrorConfig message or plain object to encode + * Encodes the specified SpannerSource message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.SpannerSource.verify|verify} messages. + * @param message SpannerSource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.discoveryengine.v1alpha.IImportErrorConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.discoveryengine.v1alpha.ISpannerSource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ImportErrorConfig message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportErrorConfig.verify|verify} messages. - * @param message ImportErrorConfig message or plain object to encode + * Encodes the specified SpannerSource message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.SpannerSource.verify|verify} messages. + * @param message SpannerSource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.discoveryengine.v1alpha.IImportErrorConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.discoveryengine.v1alpha.ISpannerSource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ImportErrorConfig message from the specified reader or buffer. + * Decodes a SpannerSource message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ImportErrorConfig + * @returns SpannerSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1alpha.ImportErrorConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1alpha.SpannerSource; /** - * Decodes an ImportErrorConfig message from the specified reader or buffer, length delimited. + * Decodes a SpannerSource message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ImportErrorConfig + * @returns SpannerSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1alpha.ImportErrorConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1alpha.SpannerSource; /** - * Verifies an ImportErrorConfig message. + * Verifies a SpannerSource message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an ImportErrorConfig message from a plain object. Also converts values to their respective internal types. + * Creates a SpannerSource message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ImportErrorConfig + * @returns SpannerSource */ - public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1alpha.ImportErrorConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1alpha.SpannerSource; /** - * Creates a plain object from an ImportErrorConfig message. Also converts values to other types if specified. - * @param message ImportErrorConfig + * Creates a plain object from a SpannerSource message. Also converts values to other types if specified. + * @param message SpannerSource * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.discoveryengine.v1alpha.ImportErrorConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.discoveryengine.v1alpha.SpannerSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ImportErrorConfig to JSON. + * Converts this SpannerSource to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ImportErrorConfig + * Gets the default type url for SpannerSource * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an ImportUserEventsRequest. */ - interface IImportUserEventsRequest { - - /** ImportUserEventsRequest inlineSource */ - inlineSource?: (google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.IInlineSource|null); - - /** ImportUserEventsRequest gcsSource */ - gcsSource?: (google.cloud.discoveryengine.v1alpha.IGcsSource|null); - - /** ImportUserEventsRequest bigquerySource */ - bigquerySource?: (google.cloud.discoveryengine.v1alpha.IBigQuerySource|null); + /** Properties of a BigtableOptions. */ + interface IBigtableOptions { - /** ImportUserEventsRequest parent */ - parent?: (string|null); + /** BigtableOptions keyFieldName */ + keyFieldName?: (string|null); - /** ImportUserEventsRequest errorConfig */ - errorConfig?: (google.cloud.discoveryengine.v1alpha.IImportErrorConfig|null); + /** BigtableOptions families */ + families?: ({ [k: string]: google.cloud.discoveryengine.v1alpha.BigtableOptions.IBigtableColumnFamily }|null); } - /** Represents an ImportUserEventsRequest. */ - class ImportUserEventsRequest implements IImportUserEventsRequest { + /** Represents a BigtableOptions. */ + class BigtableOptions implements IBigtableOptions { /** - * Constructs a new ImportUserEventsRequest. + * Constructs a new BigtableOptions. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.discoveryengine.v1alpha.IImportUserEventsRequest); - - /** ImportUserEventsRequest inlineSource. */ - public inlineSource?: (google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.IInlineSource|null); - - /** ImportUserEventsRequest gcsSource. */ - public gcsSource?: (google.cloud.discoveryengine.v1alpha.IGcsSource|null); + constructor(properties?: google.cloud.discoveryengine.v1alpha.IBigtableOptions); - /** ImportUserEventsRequest bigquerySource. */ - public bigquerySource?: (google.cloud.discoveryengine.v1alpha.IBigQuerySource|null); - - /** ImportUserEventsRequest parent. */ - public parent: string; - - /** ImportUserEventsRequest errorConfig. */ - public errorConfig?: (google.cloud.discoveryengine.v1alpha.IImportErrorConfig|null); + /** BigtableOptions keyFieldName. */ + public keyFieldName: string; - /** ImportUserEventsRequest source. */ - public source?: ("inlineSource"|"gcsSource"|"bigquerySource"); + /** BigtableOptions families. */ + public families: { [k: string]: google.cloud.discoveryengine.v1alpha.BigtableOptions.IBigtableColumnFamily }; /** - * Creates a new ImportUserEventsRequest instance using the specified properties. + * Creates a new BigtableOptions instance using the specified properties. * @param [properties] Properties to set - * @returns ImportUserEventsRequest instance + * @returns BigtableOptions instance */ - public static create(properties?: google.cloud.discoveryengine.v1alpha.IImportUserEventsRequest): google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest; + public static create(properties?: google.cloud.discoveryengine.v1alpha.IBigtableOptions): google.cloud.discoveryengine.v1alpha.BigtableOptions; /** - * Encodes the specified ImportUserEventsRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.verify|verify} messages. - * @param message ImportUserEventsRequest message or plain object to encode + * Encodes the specified BigtableOptions message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.BigtableOptions.verify|verify} messages. + * @param message BigtableOptions message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.discoveryengine.v1alpha.IImportUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.discoveryengine.v1alpha.IBigtableOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ImportUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.verify|verify} messages. - * @param message ImportUserEventsRequest message or plain object to encode + * Encodes the specified BigtableOptions message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.BigtableOptions.verify|verify} messages. + * @param message BigtableOptions message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.discoveryengine.v1alpha.IImportUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.discoveryengine.v1alpha.IBigtableOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ImportUserEventsRequest message from the specified reader or buffer. + * Decodes a BigtableOptions message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ImportUserEventsRequest + * @returns BigtableOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1alpha.BigtableOptions; /** - * Decodes an ImportUserEventsRequest message from the specified reader or buffer, length delimited. + * Decodes a BigtableOptions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ImportUserEventsRequest + * @returns BigtableOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1alpha.BigtableOptions; /** - * Verifies an ImportUserEventsRequest message. + * Verifies a BigtableOptions message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an ImportUserEventsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BigtableOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ImportUserEventsRequest + * @returns BigtableOptions */ - public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1alpha.BigtableOptions; /** - * Creates a plain object from an ImportUserEventsRequest message. Also converts values to other types if specified. - * @param message ImportUserEventsRequest + * Creates a plain object from a BigtableOptions message. Also converts values to other types if specified. + * @param message BigtableOptions * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.discoveryengine.v1alpha.BigtableOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ImportUserEventsRequest to JSON. + * Converts this BigtableOptions to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ImportUserEventsRequest + * Gets the default type url for BigtableOptions * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace ImportUserEventsRequest { + namespace BigtableOptions { - /** Properties of an InlineSource. */ - interface IInlineSource { + /** Properties of a BigtableColumnFamily. */ + interface IBigtableColumnFamily { - /** InlineSource userEvents */ - userEvents?: (google.cloud.discoveryengine.v1alpha.IUserEvent[]|null); + /** BigtableColumnFamily fieldName */ + fieldName?: (string|null); + + /** BigtableColumnFamily encoding */ + encoding?: (google.cloud.discoveryengine.v1alpha.BigtableOptions.Encoding|keyof typeof google.cloud.discoveryengine.v1alpha.BigtableOptions.Encoding|null); + + /** BigtableColumnFamily type */ + type?: (google.cloud.discoveryengine.v1alpha.BigtableOptions.Type|keyof typeof google.cloud.discoveryengine.v1alpha.BigtableOptions.Type|null); + + /** BigtableColumnFamily columns */ + columns?: (google.cloud.discoveryengine.v1alpha.BigtableOptions.IBigtableColumn[]|null); } - /** Represents an InlineSource. */ - class InlineSource implements IInlineSource { + /** Represents a BigtableColumnFamily. */ + class BigtableColumnFamily implements IBigtableColumnFamily { /** - * Constructs a new InlineSource. + * Constructs a new BigtableColumnFamily. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.IInlineSource); + constructor(properties?: google.cloud.discoveryengine.v1alpha.BigtableOptions.IBigtableColumnFamily); - /** InlineSource userEvents. */ - public userEvents: google.cloud.discoveryengine.v1alpha.IUserEvent[]; + /** BigtableColumnFamily fieldName. */ + public fieldName: string; + + /** BigtableColumnFamily encoding. */ + public encoding: (google.cloud.discoveryengine.v1alpha.BigtableOptions.Encoding|keyof typeof google.cloud.discoveryengine.v1alpha.BigtableOptions.Encoding); + + /** BigtableColumnFamily type. */ + public type: (google.cloud.discoveryengine.v1alpha.BigtableOptions.Type|keyof typeof google.cloud.discoveryengine.v1alpha.BigtableOptions.Type); + + /** BigtableColumnFamily columns. */ + public columns: google.cloud.discoveryengine.v1alpha.BigtableOptions.IBigtableColumn[]; + + /** + * Creates a new BigtableColumnFamily instance using the specified properties. + * @param [properties] Properties to set + * @returns BigtableColumnFamily instance + */ + public static create(properties?: google.cloud.discoveryengine.v1alpha.BigtableOptions.IBigtableColumnFamily): google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumnFamily; + + /** + * Encodes the specified BigtableColumnFamily message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumnFamily.verify|verify} messages. + * @param message BigtableColumnFamily message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1alpha.BigtableOptions.IBigtableColumnFamily, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigtableColumnFamily message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumnFamily.verify|verify} messages. + * @param message BigtableColumnFamily message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1alpha.BigtableOptions.IBigtableColumnFamily, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigtableColumnFamily message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigtableColumnFamily + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumnFamily; + + /** + * Decodes a BigtableColumnFamily message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigtableColumnFamily + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumnFamily; + + /** + * Verifies a BigtableColumnFamily message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BigtableColumnFamily message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigtableColumnFamily + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumnFamily; + + /** + * Creates a plain object from a BigtableColumnFamily message. Also converts values to other types if specified. + * @param message BigtableColumnFamily + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumnFamily, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigtableColumnFamily to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigtableColumnFamily + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BigtableColumn. */ + interface IBigtableColumn { + + /** BigtableColumn qualifier */ + qualifier?: (Uint8Array|string|null); + + /** BigtableColumn fieldName */ + fieldName?: (string|null); + + /** BigtableColumn encoding */ + encoding?: (google.cloud.discoveryengine.v1alpha.BigtableOptions.Encoding|keyof typeof google.cloud.discoveryengine.v1alpha.BigtableOptions.Encoding|null); + + /** BigtableColumn type */ + type?: (google.cloud.discoveryengine.v1alpha.BigtableOptions.Type|keyof typeof google.cloud.discoveryengine.v1alpha.BigtableOptions.Type|null); + } + + /** Represents a BigtableColumn. */ + class BigtableColumn implements IBigtableColumn { + + /** + * Constructs a new BigtableColumn. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1alpha.BigtableOptions.IBigtableColumn); + + /** BigtableColumn qualifier. */ + public qualifier: (Uint8Array|string); + + /** BigtableColumn fieldName. */ + public fieldName: string; + + /** BigtableColumn encoding. */ + public encoding: (google.cloud.discoveryengine.v1alpha.BigtableOptions.Encoding|keyof typeof google.cloud.discoveryengine.v1alpha.BigtableOptions.Encoding); + + /** BigtableColumn type. */ + public type: (google.cloud.discoveryengine.v1alpha.BigtableOptions.Type|keyof typeof google.cloud.discoveryengine.v1alpha.BigtableOptions.Type); + + /** + * Creates a new BigtableColumn instance using the specified properties. + * @param [properties] Properties to set + * @returns BigtableColumn instance + */ + public static create(properties?: google.cloud.discoveryengine.v1alpha.BigtableOptions.IBigtableColumn): google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumn; + + /** + * Encodes the specified BigtableColumn message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumn.verify|verify} messages. + * @param message BigtableColumn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1alpha.BigtableOptions.IBigtableColumn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigtableColumn message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumn.verify|verify} messages. + * @param message BigtableColumn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1alpha.BigtableOptions.IBigtableColumn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigtableColumn message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigtableColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumn; + + /** + * Decodes a BigtableColumn message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigtableColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumn; + + /** + * Verifies a BigtableColumn message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BigtableColumn message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigtableColumn + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumn; + + /** + * Creates a plain object from a BigtableColumn message. Also converts values to other types if specified. + * @param message BigtableColumn + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumn, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigtableColumn to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigtableColumn + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + STRING = 1, + NUMBER = 2, + INTEGER = 3, + VAR_INTEGER = 4, + BIG_NUMERIC = 5, + BOOLEAN = 6, + JSON = 7 + } + + /** Encoding enum. */ + enum Encoding { + ENCODING_UNSPECIFIED = 0, + TEXT = 1, + BINARY = 2 + } + } + + /** Properties of a BigtableSource. */ + interface IBigtableSource { + + /** BigtableSource projectId */ + projectId?: (string|null); + + /** BigtableSource instanceId */ + instanceId?: (string|null); + + /** BigtableSource tableId */ + tableId?: (string|null); + + /** BigtableSource bigtableOptions */ + bigtableOptions?: (google.cloud.discoveryengine.v1alpha.IBigtableOptions|null); + } + + /** Represents a BigtableSource. */ + class BigtableSource implements IBigtableSource { + + /** + * Constructs a new BigtableSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1alpha.IBigtableSource); + + /** BigtableSource projectId. */ + public projectId: string; + + /** BigtableSource instanceId. */ + public instanceId: string; + + /** BigtableSource tableId. */ + public tableId: string; + + /** BigtableSource bigtableOptions. */ + public bigtableOptions?: (google.cloud.discoveryengine.v1alpha.IBigtableOptions|null); + + /** + * Creates a new BigtableSource instance using the specified properties. + * @param [properties] Properties to set + * @returns BigtableSource instance + */ + public static create(properties?: google.cloud.discoveryengine.v1alpha.IBigtableSource): google.cloud.discoveryengine.v1alpha.BigtableSource; + + /** + * Encodes the specified BigtableSource message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.BigtableSource.verify|verify} messages. + * @param message BigtableSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1alpha.IBigtableSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigtableSource message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.BigtableSource.verify|verify} messages. + * @param message BigtableSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1alpha.IBigtableSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigtableSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigtableSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1alpha.BigtableSource; + + /** + * Decodes a BigtableSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigtableSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1alpha.BigtableSource; + + /** + * Verifies a BigtableSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BigtableSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigtableSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1alpha.BigtableSource; + + /** + * Creates a plain object from a BigtableSource message. Also converts values to other types if specified. + * @param message BigtableSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1alpha.BigtableSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigtableSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigtableSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FhirStoreSource. */ + interface IFhirStoreSource { + + /** FhirStoreSource fhirStore */ + fhirStore?: (string|null); + + /** FhirStoreSource gcsStagingDir */ + gcsStagingDir?: (string|null); + } + + /** Represents a FhirStoreSource. */ + class FhirStoreSource implements IFhirStoreSource { + + /** + * Constructs a new FhirStoreSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1alpha.IFhirStoreSource); + + /** FhirStoreSource fhirStore. */ + public fhirStore: string; + + /** FhirStoreSource gcsStagingDir. */ + public gcsStagingDir: string; + + /** + * Creates a new FhirStoreSource instance using the specified properties. + * @param [properties] Properties to set + * @returns FhirStoreSource instance + */ + public static create(properties?: google.cloud.discoveryengine.v1alpha.IFhirStoreSource): google.cloud.discoveryengine.v1alpha.FhirStoreSource; + + /** + * Encodes the specified FhirStoreSource message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.FhirStoreSource.verify|verify} messages. + * @param message FhirStoreSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1alpha.IFhirStoreSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FhirStoreSource message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.FhirStoreSource.verify|verify} messages. + * @param message FhirStoreSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1alpha.IFhirStoreSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FhirStoreSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FhirStoreSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1alpha.FhirStoreSource; + + /** + * Decodes a FhirStoreSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FhirStoreSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1alpha.FhirStoreSource; + + /** + * Verifies a FhirStoreSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FhirStoreSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FhirStoreSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1alpha.FhirStoreSource; + + /** + * Creates a plain object from a FhirStoreSource message. Also converts values to other types if specified. + * @param message FhirStoreSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1alpha.FhirStoreSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FhirStoreSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FhirStoreSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloudSqlSource. */ + interface ICloudSqlSource { + + /** CloudSqlSource projectId */ + projectId?: (string|null); + + /** CloudSqlSource instanceId */ + instanceId?: (string|null); + + /** CloudSqlSource databaseId */ + databaseId?: (string|null); + + /** CloudSqlSource tableId */ + tableId?: (string|null); + + /** CloudSqlSource gcsStagingDir */ + gcsStagingDir?: (string|null); + + /** CloudSqlSource offload */ + offload?: (boolean|null); + } + + /** Represents a CloudSqlSource. */ + class CloudSqlSource implements ICloudSqlSource { + + /** + * Constructs a new CloudSqlSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1alpha.ICloudSqlSource); + + /** CloudSqlSource projectId. */ + public projectId: string; + + /** CloudSqlSource instanceId. */ + public instanceId: string; + + /** CloudSqlSource databaseId. */ + public databaseId: string; + + /** CloudSqlSource tableId. */ + public tableId: string; + + /** CloudSqlSource gcsStagingDir. */ + public gcsStagingDir: string; + + /** CloudSqlSource offload. */ + public offload: boolean; + + /** + * Creates a new CloudSqlSource instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudSqlSource instance + */ + public static create(properties?: google.cloud.discoveryengine.v1alpha.ICloudSqlSource): google.cloud.discoveryengine.v1alpha.CloudSqlSource; + + /** + * Encodes the specified CloudSqlSource message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.CloudSqlSource.verify|verify} messages. + * @param message CloudSqlSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1alpha.ICloudSqlSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudSqlSource message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.CloudSqlSource.verify|verify} messages. + * @param message CloudSqlSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1alpha.ICloudSqlSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudSqlSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudSqlSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1alpha.CloudSqlSource; + + /** + * Decodes a CloudSqlSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudSqlSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1alpha.CloudSqlSource; + + /** + * Verifies a CloudSqlSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudSqlSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudSqlSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1alpha.CloudSqlSource; + + /** + * Creates a plain object from a CloudSqlSource message. Also converts values to other types if specified. + * @param message CloudSqlSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1alpha.CloudSqlSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudSqlSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudSqlSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FirestoreSource. */ + interface IFirestoreSource { + + /** FirestoreSource projectId */ + projectId?: (string|null); + + /** FirestoreSource databaseId */ + databaseId?: (string|null); + + /** FirestoreSource collectionId */ + collectionId?: (string|null); + + /** FirestoreSource gcsStagingDir */ + gcsStagingDir?: (string|null); + } + + /** Represents a FirestoreSource. */ + class FirestoreSource implements IFirestoreSource { + + /** + * Constructs a new FirestoreSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1alpha.IFirestoreSource); + + /** FirestoreSource projectId. */ + public projectId: string; + + /** FirestoreSource databaseId. */ + public databaseId: string; + + /** FirestoreSource collectionId. */ + public collectionId: string; + + /** FirestoreSource gcsStagingDir. */ + public gcsStagingDir: string; + + /** + * Creates a new FirestoreSource instance using the specified properties. + * @param [properties] Properties to set + * @returns FirestoreSource instance + */ + public static create(properties?: google.cloud.discoveryengine.v1alpha.IFirestoreSource): google.cloud.discoveryengine.v1alpha.FirestoreSource; + + /** + * Encodes the specified FirestoreSource message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.FirestoreSource.verify|verify} messages. + * @param message FirestoreSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1alpha.IFirestoreSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FirestoreSource message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.FirestoreSource.verify|verify} messages. + * @param message FirestoreSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1alpha.IFirestoreSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FirestoreSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FirestoreSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1alpha.FirestoreSource; + + /** + * Decodes a FirestoreSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FirestoreSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1alpha.FirestoreSource; + + /** + * Verifies a FirestoreSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FirestoreSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FirestoreSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1alpha.FirestoreSource; + + /** + * Creates a plain object from a FirestoreSource message. Also converts values to other types if specified. + * @param message FirestoreSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1alpha.FirestoreSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FirestoreSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FirestoreSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportErrorConfig. */ + interface IImportErrorConfig { + + /** ImportErrorConfig gcsPrefix */ + gcsPrefix?: (string|null); + } + + /** Represents an ImportErrorConfig. */ + class ImportErrorConfig implements IImportErrorConfig { + + /** + * Constructs a new ImportErrorConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1alpha.IImportErrorConfig); + + /** ImportErrorConfig gcsPrefix. */ + public gcsPrefix?: (string|null); + + /** ImportErrorConfig destination. */ + public destination?: "gcsPrefix"; + + /** + * Creates a new ImportErrorConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportErrorConfig instance + */ + public static create(properties?: google.cloud.discoveryengine.v1alpha.IImportErrorConfig): google.cloud.discoveryengine.v1alpha.ImportErrorConfig; + + /** + * Encodes the specified ImportErrorConfig message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportErrorConfig.verify|verify} messages. + * @param message ImportErrorConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1alpha.IImportErrorConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportErrorConfig message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportErrorConfig.verify|verify} messages. + * @param message ImportErrorConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1alpha.IImportErrorConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportErrorConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportErrorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1alpha.ImportErrorConfig; + + /** + * Decodes an ImportErrorConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportErrorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1alpha.ImportErrorConfig; + + /** + * Verifies an ImportErrorConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ImportErrorConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportErrorConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1alpha.ImportErrorConfig; + + /** + * Creates a plain object from an ImportErrorConfig message. Also converts values to other types if specified. + * @param message ImportErrorConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1alpha.ImportErrorConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportErrorConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportErrorConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportUserEventsRequest. */ + interface IImportUserEventsRequest { + + /** ImportUserEventsRequest inlineSource */ + inlineSource?: (google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.IInlineSource|null); + + /** ImportUserEventsRequest gcsSource */ + gcsSource?: (google.cloud.discoveryengine.v1alpha.IGcsSource|null); + + /** ImportUserEventsRequest bigquerySource */ + bigquerySource?: (google.cloud.discoveryengine.v1alpha.IBigQuerySource|null); + + /** ImportUserEventsRequest parent */ + parent?: (string|null); + + /** ImportUserEventsRequest errorConfig */ + errorConfig?: (google.cloud.discoveryengine.v1alpha.IImportErrorConfig|null); + } + + /** Represents an ImportUserEventsRequest. */ + class ImportUserEventsRequest implements IImportUserEventsRequest { + + /** + * Constructs a new ImportUserEventsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1alpha.IImportUserEventsRequest); + + /** ImportUserEventsRequest inlineSource. */ + public inlineSource?: (google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.IInlineSource|null); + + /** ImportUserEventsRequest gcsSource. */ + public gcsSource?: (google.cloud.discoveryengine.v1alpha.IGcsSource|null); + + /** ImportUserEventsRequest bigquerySource. */ + public bigquerySource?: (google.cloud.discoveryengine.v1alpha.IBigQuerySource|null); + + /** ImportUserEventsRequest parent. */ + public parent: string; + + /** ImportUserEventsRequest errorConfig. */ + public errorConfig?: (google.cloud.discoveryengine.v1alpha.IImportErrorConfig|null); + + /** ImportUserEventsRequest source. */ + public source?: ("inlineSource"|"gcsSource"|"bigquerySource"); + + /** + * Creates a new ImportUserEventsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportUserEventsRequest instance + */ + public static create(properties?: google.cloud.discoveryengine.v1alpha.IImportUserEventsRequest): google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest; + + /** + * Encodes the specified ImportUserEventsRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.verify|verify} messages. + * @param message ImportUserEventsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1alpha.IImportUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.verify|verify} messages. + * @param message ImportUserEventsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1alpha.IImportUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportUserEventsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportUserEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest; + + /** + * Decodes an ImportUserEventsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportUserEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest; + + /** + * Verifies an ImportUserEventsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ImportUserEventsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportUserEventsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest; + + /** + * Creates a plain object from an ImportUserEventsRequest message. Also converts values to other types if specified. + * @param message ImportUserEventsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportUserEventsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportUserEventsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ImportUserEventsRequest { + + /** Properties of an InlineSource. */ + interface IInlineSource { + + /** InlineSource userEvents */ + userEvents?: (google.cloud.discoveryengine.v1alpha.IUserEvent[]|null); + } + + /** Represents an InlineSource. */ + class InlineSource implements IInlineSource { + + /** + * Constructs a new InlineSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.IInlineSource); + + /** InlineSource userEvents. */ + public userEvents: google.cloud.discoveryengine.v1alpha.IUserEvent[]; /** * Creates a new InlineSource instance using the specified properties. @@ -21198,6 +22354,9 @@ export namespace google { /** ImportDocumentsMetadata failureCount */ failureCount?: (number|Long|string|null); + + /** ImportDocumentsMetadata totalCount */ + totalCount?: (number|Long|string|null); } /** Represents an ImportDocumentsMetadata. */ @@ -21221,6 +22380,9 @@ export namespace google { /** ImportDocumentsMetadata failureCount. */ public failureCount: (number|Long|string); + /** ImportDocumentsMetadata totalCount. */ + public totalCount: (number|Long|string); + /** * Creates a new ImportDocumentsMetadata instance using the specified properties. * @param [properties] Properties to set @@ -21311,6 +22473,21 @@ export namespace google { /** ImportDocumentsRequest bigquerySource */ bigquerySource?: (google.cloud.discoveryengine.v1alpha.IBigQuerySource|null); + /** ImportDocumentsRequest fhirStoreSource */ + fhirStoreSource?: (google.cloud.discoveryengine.v1alpha.IFhirStoreSource|null); + + /** ImportDocumentsRequest spannerSource */ + spannerSource?: (google.cloud.discoveryengine.v1alpha.ISpannerSource|null); + + /** ImportDocumentsRequest cloudSqlSource */ + cloudSqlSource?: (google.cloud.discoveryengine.v1alpha.ICloudSqlSource|null); + + /** ImportDocumentsRequest firestoreSource */ + firestoreSource?: (google.cloud.discoveryengine.v1alpha.IFirestoreSource|null); + + /** ImportDocumentsRequest bigtableSource */ + bigtableSource?: (google.cloud.discoveryengine.v1alpha.IBigtableSource|null); + /** ImportDocumentsRequest parent */ parent?: (string|null); @@ -21320,6 +22497,9 @@ export namespace google { /** ImportDocumentsRequest reconciliationMode */ reconciliationMode?: (google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode|keyof typeof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode|null); + /** ImportDocumentsRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + /** ImportDocumentsRequest autoGenerateIds */ autoGenerateIds?: (boolean|null); @@ -21345,6 +22525,21 @@ export namespace google { /** ImportDocumentsRequest bigquerySource. */ public bigquerySource?: (google.cloud.discoveryengine.v1alpha.IBigQuerySource|null); + /** ImportDocumentsRequest fhirStoreSource. */ + public fhirStoreSource?: (google.cloud.discoveryengine.v1alpha.IFhirStoreSource|null); + + /** ImportDocumentsRequest spannerSource. */ + public spannerSource?: (google.cloud.discoveryengine.v1alpha.ISpannerSource|null); + + /** ImportDocumentsRequest cloudSqlSource. */ + public cloudSqlSource?: (google.cloud.discoveryengine.v1alpha.ICloudSqlSource|null); + + /** ImportDocumentsRequest firestoreSource. */ + public firestoreSource?: (google.cloud.discoveryengine.v1alpha.IFirestoreSource|null); + + /** ImportDocumentsRequest bigtableSource. */ + public bigtableSource?: (google.cloud.discoveryengine.v1alpha.IBigtableSource|null); + /** ImportDocumentsRequest parent. */ public parent: string; @@ -21354,6 +22549,9 @@ export namespace google { /** ImportDocumentsRequest reconciliationMode. */ public reconciliationMode: (google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode|keyof typeof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode); + /** ImportDocumentsRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + /** ImportDocumentsRequest autoGenerateIds. */ public autoGenerateIds: boolean; @@ -21361,7 +22559,7 @@ export namespace google { public idField: string; /** ImportDocumentsRequest source. */ - public source?: ("inlineSource"|"gcsSource"|"bigquerySource"); + public source?: ("inlineSource"|"gcsSource"|"bigquerySource"|"fhirStoreSource"|"spannerSource"|"cloudSqlSource"|"firestoreSource"|"bigtableSource"); /** * Creates a new ImportDocumentsRequest instance using the specified properties. @@ -21848,227 +23046,439 @@ export namespace google { */ public static toObject(message: google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this InlineSource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Converts this InlineSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InlineSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ImportSuggestionDenyListEntriesResponse. */ + interface IImportSuggestionDenyListEntriesResponse { + + /** ImportSuggestionDenyListEntriesResponse errorSamples */ + errorSamples?: (google.rpc.IStatus[]|null); + + /** ImportSuggestionDenyListEntriesResponse importedEntriesCount */ + importedEntriesCount?: (number|Long|string|null); + + /** ImportSuggestionDenyListEntriesResponse failedEntriesCount */ + failedEntriesCount?: (number|Long|string|null); + } + + /** Represents an ImportSuggestionDenyListEntriesResponse. */ + class ImportSuggestionDenyListEntriesResponse implements IImportSuggestionDenyListEntriesResponse { + + /** + * Constructs a new ImportSuggestionDenyListEntriesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesResponse); + + /** ImportSuggestionDenyListEntriesResponse errorSamples. */ + public errorSamples: google.rpc.IStatus[]; + + /** ImportSuggestionDenyListEntriesResponse importedEntriesCount. */ + public importedEntriesCount: (number|Long|string); + + /** ImportSuggestionDenyListEntriesResponse failedEntriesCount. */ + public failedEntriesCount: (number|Long|string); + + /** + * Creates a new ImportSuggestionDenyListEntriesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportSuggestionDenyListEntriesResponse instance + */ + public static create(properties?: google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesResponse): google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse; + + /** + * Encodes the specified ImportSuggestionDenyListEntriesResponse message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse.verify|verify} messages. + * @param message ImportSuggestionDenyListEntriesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportSuggestionDenyListEntriesResponse message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse.verify|verify} messages. + * @param message ImportSuggestionDenyListEntriesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportSuggestionDenyListEntriesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportSuggestionDenyListEntriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse; + + /** + * Decodes an ImportSuggestionDenyListEntriesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportSuggestionDenyListEntriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse; + + /** + * Verifies an ImportSuggestionDenyListEntriesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ImportSuggestionDenyListEntriesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportSuggestionDenyListEntriesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse; + + /** + * Creates a plain object from an ImportSuggestionDenyListEntriesResponse message. Also converts values to other types if specified. + * @param message ImportSuggestionDenyListEntriesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportSuggestionDenyListEntriesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportSuggestionDenyListEntriesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportSuggestionDenyListEntriesMetadata. */ + interface IImportSuggestionDenyListEntriesMetadata { + + /** ImportSuggestionDenyListEntriesMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ImportSuggestionDenyListEntriesMetadata updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an ImportSuggestionDenyListEntriesMetadata. */ + class ImportSuggestionDenyListEntriesMetadata implements IImportSuggestionDenyListEntriesMetadata { + + /** + * Constructs a new ImportSuggestionDenyListEntriesMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesMetadata); + + /** ImportSuggestionDenyListEntriesMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ImportSuggestionDenyListEntriesMetadata updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ImportSuggestionDenyListEntriesMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportSuggestionDenyListEntriesMetadata instance + */ + public static create(properties?: google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesMetadata): google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata; + + /** + * Encodes the specified ImportSuggestionDenyListEntriesMetadata message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata.verify|verify} messages. + * @param message ImportSuggestionDenyListEntriesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportSuggestionDenyListEntriesMetadata message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata.verify|verify} messages. + * @param message ImportSuggestionDenyListEntriesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportSuggestionDenyListEntriesMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportSuggestionDenyListEntriesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata; + + /** + * Decodes an ImportSuggestionDenyListEntriesMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportSuggestionDenyListEntriesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata; + + /** + * Verifies an ImportSuggestionDenyListEntriesMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ImportSuggestionDenyListEntriesMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportSuggestionDenyListEntriesMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata; + + /** + * Creates a plain object from an ImportSuggestionDenyListEntriesMetadata message. Also converts values to other types if specified. + * @param message ImportSuggestionDenyListEntriesMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportSuggestionDenyListEntriesMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Gets the default type url for InlineSource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Gets the default type url for ImportSuggestionDenyListEntriesMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an ImportSuggestionDenyListEntriesResponse. */ - interface IImportSuggestionDenyListEntriesResponse { + /** Properties of an ImportCompletionSuggestionsResponse. */ + interface IImportCompletionSuggestionsResponse { - /** ImportSuggestionDenyListEntriesResponse errorSamples */ + /** ImportCompletionSuggestionsResponse errorSamples */ errorSamples?: (google.rpc.IStatus[]|null); - /** ImportSuggestionDenyListEntriesResponse importedEntriesCount */ - importedEntriesCount?: (number|Long|string|null); + /** ImportCompletionSuggestionsResponse successCount */ + successCount?: (number|Long|string|null); - /** ImportSuggestionDenyListEntriesResponse failedEntriesCount */ - failedEntriesCount?: (number|Long|string|null); + /** ImportCompletionSuggestionsResponse failureCount */ + failureCount?: (number|Long|string|null); } - /** Represents an ImportSuggestionDenyListEntriesResponse. */ - class ImportSuggestionDenyListEntriesResponse implements IImportSuggestionDenyListEntriesResponse { + /** Represents an ImportCompletionSuggestionsResponse. */ + class ImportCompletionSuggestionsResponse implements IImportCompletionSuggestionsResponse { /** - * Constructs a new ImportSuggestionDenyListEntriesResponse. + * Constructs a new ImportCompletionSuggestionsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesResponse); + constructor(properties?: google.cloud.discoveryengine.v1alpha.IImportCompletionSuggestionsResponse); - /** ImportSuggestionDenyListEntriesResponse errorSamples. */ + /** ImportCompletionSuggestionsResponse errorSamples. */ public errorSamples: google.rpc.IStatus[]; - /** ImportSuggestionDenyListEntriesResponse importedEntriesCount. */ - public importedEntriesCount: (number|Long|string); + /** ImportCompletionSuggestionsResponse successCount. */ + public successCount: (number|Long|string); - /** ImportSuggestionDenyListEntriesResponse failedEntriesCount. */ - public failedEntriesCount: (number|Long|string); + /** ImportCompletionSuggestionsResponse failureCount. */ + public failureCount: (number|Long|string); /** - * Creates a new ImportSuggestionDenyListEntriesResponse instance using the specified properties. + * Creates a new ImportCompletionSuggestionsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ImportSuggestionDenyListEntriesResponse instance + * @returns ImportCompletionSuggestionsResponse instance */ - public static create(properties?: google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesResponse): google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse; + public static create(properties?: google.cloud.discoveryengine.v1alpha.IImportCompletionSuggestionsResponse): google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsResponse; /** - * Encodes the specified ImportSuggestionDenyListEntriesResponse message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse.verify|verify} messages. - * @param message ImportSuggestionDenyListEntriesResponse message or plain object to encode + * Encodes the specified ImportCompletionSuggestionsResponse message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsResponse.verify|verify} messages. + * @param message ImportCompletionSuggestionsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.discoveryengine.v1alpha.IImportCompletionSuggestionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ImportSuggestionDenyListEntriesResponse message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse.verify|verify} messages. - * @param message ImportSuggestionDenyListEntriesResponse message or plain object to encode + * Encodes the specified ImportCompletionSuggestionsResponse message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsResponse.verify|verify} messages. + * @param message ImportCompletionSuggestionsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.discoveryengine.v1alpha.IImportCompletionSuggestionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ImportSuggestionDenyListEntriesResponse message from the specified reader or buffer. + * Decodes an ImportCompletionSuggestionsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ImportSuggestionDenyListEntriesResponse + * @returns ImportCompletionSuggestionsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsResponse; /** - * Decodes an ImportSuggestionDenyListEntriesResponse message from the specified reader or buffer, length delimited. + * Decodes an ImportCompletionSuggestionsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ImportSuggestionDenyListEntriesResponse + * @returns ImportCompletionSuggestionsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsResponse; /** - * Verifies an ImportSuggestionDenyListEntriesResponse message. + * Verifies an ImportCompletionSuggestionsResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an ImportSuggestionDenyListEntriesResponse message from a plain object. Also converts values to their respective internal types. + * Creates an ImportCompletionSuggestionsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ImportSuggestionDenyListEntriesResponse + * @returns ImportCompletionSuggestionsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsResponse; /** - * Creates a plain object from an ImportSuggestionDenyListEntriesResponse message. Also converts values to other types if specified. - * @param message ImportSuggestionDenyListEntriesResponse + * Creates a plain object from an ImportCompletionSuggestionsResponse message. Also converts values to other types if specified. + * @param message ImportCompletionSuggestionsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ImportSuggestionDenyListEntriesResponse to JSON. + * Converts this ImportCompletionSuggestionsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ImportSuggestionDenyListEntriesResponse + * Gets the default type url for ImportCompletionSuggestionsResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an ImportSuggestionDenyListEntriesMetadata. */ - interface IImportSuggestionDenyListEntriesMetadata { + /** Properties of an ImportCompletionSuggestionsMetadata. */ + interface IImportCompletionSuggestionsMetadata { - /** ImportSuggestionDenyListEntriesMetadata createTime */ + /** ImportCompletionSuggestionsMetadata createTime */ createTime?: (google.protobuf.ITimestamp|null); - /** ImportSuggestionDenyListEntriesMetadata updateTime */ + /** ImportCompletionSuggestionsMetadata updateTime */ updateTime?: (google.protobuf.ITimestamp|null); } - /** Represents an ImportSuggestionDenyListEntriesMetadata. */ - class ImportSuggestionDenyListEntriesMetadata implements IImportSuggestionDenyListEntriesMetadata { + /** Represents an ImportCompletionSuggestionsMetadata. */ + class ImportCompletionSuggestionsMetadata implements IImportCompletionSuggestionsMetadata { /** - * Constructs a new ImportSuggestionDenyListEntriesMetadata. + * Constructs a new ImportCompletionSuggestionsMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesMetadata); + constructor(properties?: google.cloud.discoveryengine.v1alpha.IImportCompletionSuggestionsMetadata); - /** ImportSuggestionDenyListEntriesMetadata createTime. */ + /** ImportCompletionSuggestionsMetadata createTime. */ public createTime?: (google.protobuf.ITimestamp|null); - /** ImportSuggestionDenyListEntriesMetadata updateTime. */ + /** ImportCompletionSuggestionsMetadata updateTime. */ public updateTime?: (google.protobuf.ITimestamp|null); /** - * Creates a new ImportSuggestionDenyListEntriesMetadata instance using the specified properties. + * Creates a new ImportCompletionSuggestionsMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns ImportSuggestionDenyListEntriesMetadata instance + * @returns ImportCompletionSuggestionsMetadata instance */ - public static create(properties?: google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesMetadata): google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata; + public static create(properties?: google.cloud.discoveryengine.v1alpha.IImportCompletionSuggestionsMetadata): google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsMetadata; /** - * Encodes the specified ImportSuggestionDenyListEntriesMetadata message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata.verify|verify} messages. - * @param message ImportSuggestionDenyListEntriesMetadata message or plain object to encode + * Encodes the specified ImportCompletionSuggestionsMetadata message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsMetadata.verify|verify} messages. + * @param message ImportCompletionSuggestionsMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.discoveryengine.v1alpha.IImportCompletionSuggestionsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ImportSuggestionDenyListEntriesMetadata message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata.verify|verify} messages. - * @param message ImportSuggestionDenyListEntriesMetadata message or plain object to encode + * Encodes the specified ImportCompletionSuggestionsMetadata message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsMetadata.verify|verify} messages. + * @param message ImportCompletionSuggestionsMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.discoveryengine.v1alpha.IImportCompletionSuggestionsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ImportSuggestionDenyListEntriesMetadata message from the specified reader or buffer. + * Decodes an ImportCompletionSuggestionsMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ImportSuggestionDenyListEntriesMetadata + * @returns ImportCompletionSuggestionsMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsMetadata; /** - * Decodes an ImportSuggestionDenyListEntriesMetadata message from the specified reader or buffer, length delimited. + * Decodes an ImportCompletionSuggestionsMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ImportSuggestionDenyListEntriesMetadata + * @returns ImportCompletionSuggestionsMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsMetadata; /** - * Verifies an ImportSuggestionDenyListEntriesMetadata message. + * Verifies an ImportCompletionSuggestionsMetadata message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an ImportSuggestionDenyListEntriesMetadata message from a plain object. Also converts values to their respective internal types. + * Creates an ImportCompletionSuggestionsMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ImportSuggestionDenyListEntriesMetadata + * @returns ImportCompletionSuggestionsMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsMetadata; /** - * Creates a plain object from an ImportSuggestionDenyListEntriesMetadata message. Also converts values to other types if specified. - * @param message ImportSuggestionDenyListEntriesMetadata + * Creates a plain object from an ImportCompletionSuggestionsMetadata message. Also converts values to other types if specified. + * @param message ImportCompletionSuggestionsMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ImportSuggestionDenyListEntriesMetadata to JSON. + * Converts this ImportCompletionSuggestionsMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ImportSuggestionDenyListEntriesMetadata + * Gets the default type url for ImportCompletionSuggestionsMetadata * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ @@ -22541,6 +23951,112 @@ export namespace google { } } + /** Properties of a ProcessedDocument. */ + interface IProcessedDocument { + + /** ProcessedDocument jsonData */ + jsonData?: (string|null); + + /** ProcessedDocument document */ + document?: (string|null); + } + + /** Represents a ProcessedDocument. */ + class ProcessedDocument implements IProcessedDocument { + + /** + * Constructs a new ProcessedDocument. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1alpha.IProcessedDocument); + + /** ProcessedDocument jsonData. */ + public jsonData?: (string|null); + + /** ProcessedDocument document. */ + public document: string; + + /** ProcessedDocument processedDataFormat. */ + public processedDataFormat?: "jsonData"; + + /** + * Creates a new ProcessedDocument instance using the specified properties. + * @param [properties] Properties to set + * @returns ProcessedDocument instance + */ + public static create(properties?: google.cloud.discoveryengine.v1alpha.IProcessedDocument): google.cloud.discoveryengine.v1alpha.ProcessedDocument; + + /** + * Encodes the specified ProcessedDocument message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ProcessedDocument.verify|verify} messages. + * @param message ProcessedDocument message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1alpha.IProcessedDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProcessedDocument message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ProcessedDocument.verify|verify} messages. + * @param message ProcessedDocument message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1alpha.IProcessedDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProcessedDocument message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProcessedDocument + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1alpha.ProcessedDocument; + + /** + * Decodes a ProcessedDocument message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProcessedDocument + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1alpha.ProcessedDocument; + + /** + * Verifies a ProcessedDocument message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProcessedDocument message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProcessedDocument + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1alpha.ProcessedDocument; + + /** + * Creates a plain object from a ProcessedDocument message. Also converts values to other types if specified. + * @param message ProcessedDocument + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1alpha.ProcessedDocument, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProcessedDocument to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProcessedDocument + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a UserEvent. */ interface IUserEvent { @@ -26154,6 +27670,9 @@ export namespace google { /** ConditionBoostSpec boost */ boost?: (number|null); + + /** ConditionBoostSpec boostControlSpec */ + boostControlSpec?: (google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.IBoostControlSpec|null); } /** Represents a ConditionBoostSpec. */ @@ -26171,6 +27690,9 @@ export namespace google { /** ConditionBoostSpec boost. */ public boost: number; + /** ConditionBoostSpec boostControlSpec. */ + public boostControlSpec?: (google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.IBoostControlSpec|null); + /** * Creates a new ConditionBoostSpec instance using the specified properties. * @param [properties] Properties to set @@ -26227,26 +27749,263 @@ export namespace google { */ public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1alpha.SearchRequest.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.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * 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.discoveryengine.v1alpha.SearchRequest.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.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType|keyof typeof google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType|null); + + /** BoostControlSpec interpolationType */ + interpolationType?: (google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType|keyof typeof google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType|null); + + /** BoostControlSpec controlPoints */ + controlPoints?: (google.cloud.discoveryengine.v1alpha.SearchRequest.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.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.IBoostControlSpec); + + /** BoostControlSpec fieldName. */ + public fieldName: string; + + /** BoostControlSpec attributeType. */ + public attributeType: (google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType|keyof typeof google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType); + + /** BoostControlSpec interpolationType. */ + public interpolationType: (google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType|keyof typeof google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType); + + /** BoostControlSpec controlPoints. */ + public controlPoints: google.cloud.discoveryengine.v1alpha.SearchRequest.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.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.IBoostControlSpec): google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec; + + /** + * Encodes the specified BoostControlSpec message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.SearchRequest.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.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.IBoostControlSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoostControlSpec message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.SearchRequest.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.discoveryengine.v1alpha.SearchRequest.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.discoveryengine.v1alpha.SearchRequest.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.discoveryengine.v1alpha.SearchRequest.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.discoveryengine.v1alpha.SearchRequest.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.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoostControlSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Converts this ConditionBoostSpec 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; + } - /** - * 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 BoostControlSpec { + + /** Properties of a ControlPoint. */ + interface IControlPoint { + + /** ControlPoint attributeValue */ + attributeValue?: (string|null); + + /** ControlPoint boostAmount */ + boostAmount?: (number|null); + } + + /** Represents a ControlPoint. */ + class ControlPoint implements IControlPoint { + + /** + * Constructs a new ControlPoint. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint); + + /** ControlPoint attributeValue. */ + public attributeValue: string; + + /** ControlPoint boostAmount. */ + public boostAmount: number; + + /** + * Creates a new ControlPoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ControlPoint instance + */ + public static create(properties?: google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint): google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint; + + /** + * Encodes the specified ControlPoint message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.SearchRequest.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.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ControlPoint message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.SearchRequest.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.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint; + + /** + * 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.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint; + + /** + * 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); + + /** + * 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.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint; + + /** + * 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.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ControlPoint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * 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; + } + + /** AttributeType enum. */ + enum AttributeType { + ATTRIBUTE_TYPE_UNSPECIFIED = 0, + NUMERICAL = 1, + FRESHNESS = 2 + } + + /** InterpolationType enum. */ + enum InterpolationType { + INTERPOLATION_TYPE_UNSPECIFIED = 0, + LINEAR = 1 + } + } } } @@ -26484,6 +28243,9 @@ export namespace google { /** ContentSearchSpec searchResultMode */ searchResultMode?: (google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SearchResultMode|keyof typeof google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SearchResultMode|null); + + /** ContentSearchSpec chunkSpec */ + chunkSpec?: (google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.IChunkSpec|null); } /** Represents a ContentSearchSpec. */ @@ -26507,6 +28269,9 @@ export namespace google { /** ContentSearchSpec searchResultMode. */ public searchResultMode: (google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SearchResultMode|keyof typeof google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SearchResultMode); + /** ContentSearchSpec chunkSpec. */ + public chunkSpec?: (google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.IChunkSpec|null); + /** * Creates a new ContentSearchSpec instance using the specified properties. * @param [properties] Properties to set @@ -26719,6 +28484,9 @@ export namespace google { /** SummarySpec modelSpec */ modelSpec?: (google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec.IModelSpec|null); + + /** SummarySpec useSemanticChunks */ + useSemanticChunks?: (boolean|null); } /** Represents a SummarySpec. */ @@ -26751,6 +28519,9 @@ export namespace google { /** SummarySpec modelSpec. */ public modelSpec?: (google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec.IModelSpec|null); + /** SummarySpec useSemanticChunks. */ + public useSemanticChunks: boolean; + /** * Creates a new SummarySpec instance using the specified properties. * @param [properties] Properties to set @@ -27147,6 +28918,109 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a ChunkSpec. */ + interface IChunkSpec { + + /** ChunkSpec numPreviousChunks */ + numPreviousChunks?: (number|null); + + /** ChunkSpec numNextChunks */ + numNextChunks?: (number|null); + } + + /** Represents a ChunkSpec. */ + class ChunkSpec implements IChunkSpec { + + /** + * Constructs a new ChunkSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.IChunkSpec); + + /** ChunkSpec numPreviousChunks. */ + public numPreviousChunks: number; + + /** ChunkSpec numNextChunks. */ + public numNextChunks: number; + + /** + * Creates a new ChunkSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns ChunkSpec instance + */ + public static create(properties?: google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.IChunkSpec): google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ChunkSpec; + + /** + * Encodes the specified ChunkSpec message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ChunkSpec.verify|verify} messages. + * @param message ChunkSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.IChunkSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChunkSpec message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ChunkSpec.verify|verify} messages. + * @param message ChunkSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.IChunkSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChunkSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChunkSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ChunkSpec; + + /** + * Decodes a ChunkSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChunkSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ChunkSpec; + + /** + * Verifies a ChunkSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChunkSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChunkSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ChunkSpec; + + /** + * Creates a plain object from a ChunkSpec message. Also converts values to other types if specified. + * @param message ChunkSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ChunkSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChunkSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChunkSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** SearchResultMode enum. */ enum SearchResultMode { SEARCH_RESULT_MODE_UNSPECIFIED = 0, @@ -28606,6 +30480,9 @@ export namespace google { /** Reference uri */ uri?: (string|null); + + /** Reference chunkContents */ + chunkContents?: (google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.IChunkContent[]|null); } /** Represents a Reference. */ @@ -28626,6 +30503,9 @@ export namespace google { /** Reference uri. */ public uri: string; + /** Reference chunkContents. */ + public chunkContents: google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.IChunkContent[]; + /** * Creates a new Reference instance using the specified properties. * @param [properties] Properties to set @@ -28704,6 +30584,112 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace Reference { + + /** Properties of a ChunkContent. */ + interface IChunkContent { + + /** ChunkContent content */ + content?: (string|null); + + /** ChunkContent pageIdentifier */ + pageIdentifier?: (string|null); + } + + /** Represents a ChunkContent. */ + class ChunkContent implements IChunkContent { + + /** + * Constructs a new ChunkContent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.IChunkContent); + + /** ChunkContent content. */ + public content: string; + + /** ChunkContent pageIdentifier. */ + public pageIdentifier: string; + + /** + * Creates a new ChunkContent instance using the specified properties. + * @param [properties] Properties to set + * @returns ChunkContent instance + */ + public static create(properties?: google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.IChunkContent): google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.ChunkContent; + + /** + * Encodes the specified ChunkContent message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.ChunkContent.verify|verify} messages. + * @param message ChunkContent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.IChunkContent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChunkContent message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.ChunkContent.verify|verify} messages. + * @param message ChunkContent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.IChunkContent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChunkContent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChunkContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.ChunkContent; + + /** + * Decodes a ChunkContent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChunkContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.ChunkContent; + + /** + * Verifies a ChunkContent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChunkContent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChunkContent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.ChunkContent; + + /** + * Creates a plain object from a ChunkContent message. Also converts values to other types if specified. + * @param message ChunkContent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.ChunkContent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChunkContent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChunkContent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of a SummaryWithMetadata. */ interface ISummaryWithMetadata { @@ -32601,6 +34587,20 @@ export namespace google { * @returns Promise */ public purgeDocuments(request: google.cloud.discoveryengine.v1alpha.IPurgeDocumentsRequest): Promise; + + /** + * Calls GetProcessedDocument. + * @param request GetProcessedDocumentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ProcessedDocument + */ + public getProcessedDocument(request: google.cloud.discoveryengine.v1alpha.IGetProcessedDocumentRequest, callback: google.cloud.discoveryengine.v1alpha.DocumentService.GetProcessedDocumentCallback): void; + + /** + * Calls GetProcessedDocument. + * @param request GetProcessedDocumentRequest message or plain object + * @returns Promise + */ + public getProcessedDocument(request: google.cloud.discoveryengine.v1alpha.IGetProcessedDocumentRequest): Promise; } namespace DocumentService { @@ -32653,6 +34653,13 @@ export namespace google { * @param [response] Operation */ type PurgeDocumentsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.discoveryengine.v1alpha.DocumentService|getProcessedDocument}. + * @param error Error, if any + * @param [response] ProcessedDocument + */ + type GetProcessedDocumentCallback = (error: (Error|null), response?: google.cloud.discoveryengine.v1alpha.ProcessedDocument) => void; } /** Properties of a GetDocumentRequest. */ @@ -33251,34 +35258,159 @@ export namespace google { public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteDocumentRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteDocumentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest; + + /** + * Creates a plain object from a DeleteDocumentRequest message. Also converts values to other types if specified. + * @param message DeleteDocumentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteDocumentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteDocumentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetProcessedDocumentRequest. */ + interface IGetProcessedDocumentRequest { + + /** GetProcessedDocumentRequest name */ + name?: (string|null); + + /** GetProcessedDocumentRequest processedDocumentType */ + processedDocumentType?: (google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest.ProcessedDocumentType|keyof typeof google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest.ProcessedDocumentType|null); + + /** GetProcessedDocumentRequest processedDocumentFormat */ + processedDocumentFormat?: (google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest.ProcessedDocumentFormat|keyof typeof google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest.ProcessedDocumentFormat|null); + } + + /** Represents a GetProcessedDocumentRequest. */ + class GetProcessedDocumentRequest implements IGetProcessedDocumentRequest { + + /** + * Constructs a new GetProcessedDocumentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1alpha.IGetProcessedDocumentRequest); + + /** GetProcessedDocumentRequest name. */ + public name: string; + + /** GetProcessedDocumentRequest processedDocumentType. */ + public processedDocumentType: (google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest.ProcessedDocumentType|keyof typeof google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest.ProcessedDocumentType); + + /** GetProcessedDocumentRequest processedDocumentFormat. */ + public processedDocumentFormat: (google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest.ProcessedDocumentFormat|keyof typeof google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest.ProcessedDocumentFormat); + + /** + * Creates a new GetProcessedDocumentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetProcessedDocumentRequest instance + */ + public static create(properties?: google.cloud.discoveryengine.v1alpha.IGetProcessedDocumentRequest): google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest; + + /** + * Encodes the specified GetProcessedDocumentRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest.verify|verify} messages. + * @param message GetProcessedDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1alpha.IGetProcessedDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetProcessedDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest.verify|verify} messages. + * @param message GetProcessedDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1alpha.IGetProcessedDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetProcessedDocumentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetProcessedDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest; + + /** + * Decodes a GetProcessedDocumentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetProcessedDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest; + + /** + * Verifies a GetProcessedDocumentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetProcessedDocumentRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteDocumentRequest + * @returns GetProcessedDocumentRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest; /** - * Creates a plain object from a DeleteDocumentRequest message. Also converts values to other types if specified. - * @param message DeleteDocumentRequest + * Creates a plain object from a GetProcessedDocumentRequest message. Also converts values to other types if specified. + * @param message GetProcessedDocumentRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.discoveryengine.v1alpha.DeleteDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteDocumentRequest to JSON. + * Converts this GetProcessedDocumentRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DeleteDocumentRequest + * Gets the default type url for GetProcessedDocumentRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace GetProcessedDocumentRequest { + + /** ProcessedDocumentType enum. */ + enum ProcessedDocumentType { + PROCESSED_DOCUMENT_TYPE_UNSPECIFIED = 0, + PARSED_DOCUMENT = 1, + CHUNKED_DOCUMENT = 2 + } + + /** ProcessedDocumentFormat enum. */ + enum ProcessedDocumentFormat { + PROCESSED_DOCUMENT_FORMAT_UNSPECIFIED = 0, + JSON = 1 + } + } + /** Properties of an Engine. */ interface IEngine { @@ -36609,6 +38741,390 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Represents a RankService */ + class RankService extends $protobuf.rpc.Service { + + /** + * Constructs a new RankService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new RankService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): RankService; + + /** + * Calls Rank. + * @param request RankRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RankResponse + */ + public rank(request: google.cloud.discoveryengine.v1alpha.IRankRequest, callback: google.cloud.discoveryengine.v1alpha.RankService.RankCallback): void; + + /** + * Calls Rank. + * @param request RankRequest message or plain object + * @returns Promise + */ + public rank(request: google.cloud.discoveryengine.v1alpha.IRankRequest): Promise; + } + + namespace RankService { + + /** + * Callback as used by {@link google.cloud.discoveryengine.v1alpha.RankService|rank}. + * @param error Error, if any + * @param [response] RankResponse + */ + type RankCallback = (error: (Error|null), response?: google.cloud.discoveryengine.v1alpha.RankResponse) => void; + } + + /** Properties of a RankingRecord. */ + interface IRankingRecord { + + /** RankingRecord id */ + id?: (string|null); + + /** RankingRecord title */ + title?: (string|null); + + /** RankingRecord content */ + content?: (string|null); + + /** RankingRecord score */ + score?: (number|null); + } + + /** Represents a RankingRecord. */ + class RankingRecord implements IRankingRecord { + + /** + * Constructs a new RankingRecord. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1alpha.IRankingRecord); + + /** RankingRecord id. */ + public id: string; + + /** RankingRecord title. */ + public title: string; + + /** RankingRecord content. */ + public content: string; + + /** RankingRecord score. */ + public score: number; + + /** + * Creates a new RankingRecord instance using the specified properties. + * @param [properties] Properties to set + * @returns RankingRecord instance + */ + public static create(properties?: google.cloud.discoveryengine.v1alpha.IRankingRecord): google.cloud.discoveryengine.v1alpha.RankingRecord; + + /** + * Encodes the specified RankingRecord message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.RankingRecord.verify|verify} messages. + * @param message RankingRecord message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1alpha.IRankingRecord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RankingRecord message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.RankingRecord.verify|verify} messages. + * @param message RankingRecord message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1alpha.IRankingRecord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RankingRecord message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RankingRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1alpha.RankingRecord; + + /** + * Decodes a RankingRecord message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RankingRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1alpha.RankingRecord; + + /** + * Verifies a RankingRecord message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RankingRecord message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RankingRecord + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1alpha.RankingRecord; + + /** + * Creates a plain object from a RankingRecord message. Also converts values to other types if specified. + * @param message RankingRecord + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1alpha.RankingRecord, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RankingRecord to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RankingRecord + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RankRequest. */ + interface IRankRequest { + + /** RankRequest rankingConfig */ + rankingConfig?: (string|null); + + /** RankRequest model */ + model?: (string|null); + + /** RankRequest topN */ + topN?: (number|null); + + /** RankRequest query */ + query?: (string|null); + + /** RankRequest records */ + records?: (google.cloud.discoveryengine.v1alpha.IRankingRecord[]|null); + + /** RankRequest ignoreRecordDetailsInResponse */ + ignoreRecordDetailsInResponse?: (boolean|null); + } + + /** Represents a RankRequest. */ + class RankRequest implements IRankRequest { + + /** + * Constructs a new RankRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1alpha.IRankRequest); + + /** RankRequest rankingConfig. */ + public rankingConfig: string; + + /** RankRequest model. */ + public model: string; + + /** RankRequest topN. */ + public topN: number; + + /** RankRequest query. */ + public query: string; + + /** RankRequest records. */ + public records: google.cloud.discoveryengine.v1alpha.IRankingRecord[]; + + /** RankRequest ignoreRecordDetailsInResponse. */ + public ignoreRecordDetailsInResponse: boolean; + + /** + * Creates a new RankRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RankRequest instance + */ + public static create(properties?: google.cloud.discoveryengine.v1alpha.IRankRequest): google.cloud.discoveryengine.v1alpha.RankRequest; + + /** + * Encodes the specified RankRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.RankRequest.verify|verify} messages. + * @param message RankRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1alpha.IRankRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RankRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.RankRequest.verify|verify} messages. + * @param message RankRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1alpha.IRankRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RankRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RankRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1alpha.RankRequest; + + /** + * Decodes a RankRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RankRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1alpha.RankRequest; + + /** + * Verifies a RankRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RankRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RankRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1alpha.RankRequest; + + /** + * Creates a plain object from a RankRequest message. Also converts values to other types if specified. + * @param message RankRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1alpha.RankRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RankRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RankRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RankResponse. */ + interface IRankResponse { + + /** RankResponse records */ + records?: (google.cloud.discoveryengine.v1alpha.IRankingRecord[]|null); + } + + /** Represents a RankResponse. */ + class RankResponse implements IRankResponse { + + /** + * Constructs a new RankResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.discoveryengine.v1alpha.IRankResponse); + + /** RankResponse records. */ + public records: google.cloud.discoveryengine.v1alpha.IRankingRecord[]; + + /** + * Creates a new RankResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RankResponse instance + */ + public static create(properties?: google.cloud.discoveryengine.v1alpha.IRankResponse): google.cloud.discoveryengine.v1alpha.RankResponse; + + /** + * Encodes the specified RankResponse message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.RankResponse.verify|verify} messages. + * @param message RankResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.discoveryengine.v1alpha.IRankResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RankResponse message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.RankResponse.verify|verify} messages. + * @param message RankResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.discoveryengine.v1alpha.IRankResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RankResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RankResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.discoveryengine.v1alpha.RankResponse; + + /** + * Decodes a RankResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RankResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.discoveryengine.v1alpha.RankResponse; + + /** + * Verifies a RankResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RankResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RankResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.discoveryengine.v1alpha.RankResponse; + + /** + * Creates a plain object from a RankResponse message. Also converts values to other types if specified. + * @param message RankResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.discoveryengine.v1alpha.RankResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RankResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RankResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Represents a RecommendationService */ class RecommendationService extends $protobuf.rpc.Service { @@ -38362,6 +40878,9 @@ export namespace google { /** TrainCustomModelResponse modelStatus */ modelStatus?: (string|null); + + /** TrainCustomModelResponse metrics */ + metrics?: ({ [k: string]: number }|null); } /** Represents a TrainCustomModelResponse. */ @@ -38382,6 +40901,9 @@ export namespace google { /** TrainCustomModelResponse modelStatus. */ public modelStatus: string; + /** TrainCustomModelResponse metrics. */ + public metrics: { [k: string]: number }; + /** * Creates a new TrainCustomModelResponse instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-cloud-discoveryengine/protos/protos.js b/packages/google-cloud-discoveryengine/protos/protos.js index adfb1e434bd..ea8c04306e4 100644 --- a/packages/google-cloud-discoveryengine/protos/protos.js +++ b/packages/google-cloud-discoveryengine/protos/protos.js @@ -42778,12 +42778,14 @@ * @property {number} INDUSTRY_VERTICAL_UNSPECIFIED=0 INDUSTRY_VERTICAL_UNSPECIFIED value * @property {number} GENERIC=1 GENERIC value * @property {number} MEDIA=2 MEDIA value + * @property {number} HEALTHCARE_FHIR=7 HEALTHCARE_FHIR value */ v1alpha.IndustryVertical = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "INDUSTRY_VERTICAL_UNSPECIFIED"] = 0; values[valuesById[1] = "GENERIC"] = 1; values[valuesById[2] = "MEDIA"] = 2; + values[valuesById[7] = "HEALTHCARE_FHIR"] = 7; return values; })(); @@ -42795,6 +42797,7 @@ * @property {number} SOLUTION_TYPE_RECOMMENDATION=1 SOLUTION_TYPE_RECOMMENDATION value * @property {number} SOLUTION_TYPE_SEARCH=2 SOLUTION_TYPE_SEARCH value * @property {number} SOLUTION_TYPE_CHAT=3 SOLUTION_TYPE_CHAT value + * @property {number} SOLUTION_TYPE_GENERATIVE_CHAT=4 SOLUTION_TYPE_GENERATIVE_CHAT value */ v1alpha.SolutionType = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -42802,6 +42805,7 @@ values[valuesById[1] = "SOLUTION_TYPE_RECOMMENDATION"] = 1; values[valuesById[2] = "SOLUTION_TYPE_SEARCH"] = 2; values[valuesById[3] = "SOLUTION_TYPE_CHAT"] = 3; + values[valuesById[4] = "SOLUTION_TYPE_GENERATIVE_CHAT"] = 4; return values; })(); @@ -45777,6 +45781,8 @@ * @property {string|null} [content] Chunk content * @property {google.cloud.discoveryengine.v1alpha.Chunk.IDocumentMetadata|null} [documentMetadata] Chunk documentMetadata * @property {google.protobuf.IStruct|null} [derivedStructData] Chunk derivedStructData + * @property {google.cloud.discoveryengine.v1alpha.Chunk.IPageSpan|null} [pageSpan] Chunk pageSpan + * @property {google.cloud.discoveryengine.v1alpha.Chunk.IChunkMetadata|null} [chunkMetadata] Chunk chunkMetadata */ /** @@ -45834,6 +45840,22 @@ */ Chunk.prototype.derivedStructData = null; + /** + * Chunk pageSpan. + * @member {google.cloud.discoveryengine.v1alpha.Chunk.IPageSpan|null|undefined} pageSpan + * @memberof google.cloud.discoveryengine.v1alpha.Chunk + * @instance + */ + Chunk.prototype.pageSpan = null; + + /** + * Chunk chunkMetadata. + * @member {google.cloud.discoveryengine.v1alpha.Chunk.IChunkMetadata|null|undefined} chunkMetadata + * @memberof google.cloud.discoveryengine.v1alpha.Chunk + * @instance + */ + Chunk.prototype.chunkMetadata = null; + /** * Creates a new Chunk instance using the specified properties. * @function create @@ -45868,6 +45890,10 @@ $root.google.protobuf.Struct.encode(message.derivedStructData, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.documentMetadata != null && Object.hasOwnProperty.call(message, "documentMetadata")) $root.google.cloud.discoveryengine.v1alpha.Chunk.DocumentMetadata.encode(message.documentMetadata, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.pageSpan != null && Object.hasOwnProperty.call(message, "pageSpan")) + $root.google.cloud.discoveryengine.v1alpha.Chunk.PageSpan.encode(message.pageSpan, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.chunkMetadata != null && Object.hasOwnProperty.call(message, "chunkMetadata")) + $root.google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata.encode(message.chunkMetadata, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; @@ -45922,6 +45948,14 @@ message.derivedStructData = $root.google.protobuf.Struct.decode(reader, reader.uint32()); break; } + case 6: { + message.pageSpan = $root.google.cloud.discoveryengine.v1alpha.Chunk.PageSpan.decode(reader, reader.uint32()); + break; + } + case 7: { + message.chunkMetadata = $root.google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -45976,6 +46010,16 @@ if (error) return "derivedStructData." + error; } + if (message.pageSpan != null && message.hasOwnProperty("pageSpan")) { + var error = $root.google.cloud.discoveryengine.v1alpha.Chunk.PageSpan.verify(message.pageSpan); + if (error) + return "pageSpan." + error; + } + if (message.chunkMetadata != null && message.hasOwnProperty("chunkMetadata")) { + var error = $root.google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata.verify(message.chunkMetadata); + if (error) + return "chunkMetadata." + error; + } return null; }; @@ -46007,6 +46051,16 @@ throw TypeError(".google.cloud.discoveryengine.v1alpha.Chunk.derivedStructData: object expected"); message.derivedStructData = $root.google.protobuf.Struct.fromObject(object.derivedStructData); } + if (object.pageSpan != null) { + if (typeof object.pageSpan !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.Chunk.pageSpan: object expected"); + message.pageSpan = $root.google.cloud.discoveryengine.v1alpha.Chunk.PageSpan.fromObject(object.pageSpan); + } + if (object.chunkMetadata != null) { + if (typeof object.chunkMetadata !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.Chunk.chunkMetadata: object expected"); + message.chunkMetadata = $root.google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata.fromObject(object.chunkMetadata); + } return message; }; @@ -46029,6 +46083,8 @@ object.content = ""; object.derivedStructData = null; object.documentMetadata = null; + object.pageSpan = null; + object.chunkMetadata = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -46040,6 +46096,10 @@ object.derivedStructData = $root.google.protobuf.Struct.toObject(message.derivedStructData, options); if (message.documentMetadata != null && message.hasOwnProperty("documentMetadata")) object.documentMetadata = $root.google.cloud.discoveryengine.v1alpha.Chunk.DocumentMetadata.toObject(message.documentMetadata, options); + if (message.pageSpan != null && message.hasOwnProperty("pageSpan")) + object.pageSpan = $root.google.cloud.discoveryengine.v1alpha.Chunk.PageSpan.toObject(message.pageSpan, options); + if (message.chunkMetadata != null && message.hasOwnProperty("chunkMetadata")) + object.chunkMetadata = $root.google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata.toObject(message.chunkMetadata, options); return object; }; @@ -46296,6 +46356,502 @@ return DocumentMetadata; })(); + Chunk.PageSpan = (function() { + + /** + * Properties of a PageSpan. + * @memberof google.cloud.discoveryengine.v1alpha.Chunk + * @interface IPageSpan + * @property {number|null} [pageStart] PageSpan pageStart + * @property {number|null} [pageEnd] PageSpan pageEnd + */ + + /** + * Constructs a new PageSpan. + * @memberof google.cloud.discoveryengine.v1alpha.Chunk + * @classdesc Represents a PageSpan. + * @implements IPageSpan + * @constructor + * @param {google.cloud.discoveryengine.v1alpha.Chunk.IPageSpan=} [properties] Properties to set + */ + function PageSpan(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PageSpan pageStart. + * @member {number} pageStart + * @memberof google.cloud.discoveryengine.v1alpha.Chunk.PageSpan + * @instance + */ + PageSpan.prototype.pageStart = 0; + + /** + * PageSpan pageEnd. + * @member {number} pageEnd + * @memberof google.cloud.discoveryengine.v1alpha.Chunk.PageSpan + * @instance + */ + PageSpan.prototype.pageEnd = 0; + + /** + * Creates a new PageSpan instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1alpha.Chunk.PageSpan + * @static + * @param {google.cloud.discoveryengine.v1alpha.Chunk.IPageSpan=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.Chunk.PageSpan} PageSpan instance + */ + PageSpan.create = function create(properties) { + return new PageSpan(properties); + }; + + /** + * Encodes the specified PageSpan message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.Chunk.PageSpan.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1alpha.Chunk.PageSpan + * @static + * @param {google.cloud.discoveryengine.v1alpha.Chunk.IPageSpan} message PageSpan message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PageSpan.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageStart != null && Object.hasOwnProperty.call(message, "pageStart")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.pageStart); + if (message.pageEnd != null && Object.hasOwnProperty.call(message, "pageEnd")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageEnd); + return writer; + }; + + /** + * Encodes the specified PageSpan message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.Chunk.PageSpan.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.Chunk.PageSpan + * @static + * @param {google.cloud.discoveryengine.v1alpha.Chunk.IPageSpan} message PageSpan message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PageSpan.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PageSpan message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1alpha.Chunk.PageSpan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1alpha.Chunk.PageSpan} PageSpan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PageSpan.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.Chunk.PageSpan(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.pageStart = reader.int32(); + break; + } + case 2: { + message.pageEnd = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PageSpan message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.Chunk.PageSpan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1alpha.Chunk.PageSpan} PageSpan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PageSpan.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PageSpan message. + * @function verify + * @memberof google.cloud.discoveryengine.v1alpha.Chunk.PageSpan + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PageSpan.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pageStart != null && message.hasOwnProperty("pageStart")) + if (!$util.isInteger(message.pageStart)) + return "pageStart: integer expected"; + if (message.pageEnd != null && message.hasOwnProperty("pageEnd")) + if (!$util.isInteger(message.pageEnd)) + return "pageEnd: integer expected"; + return null; + }; + + /** + * Creates a PageSpan message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1alpha.Chunk.PageSpan + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1alpha.Chunk.PageSpan} PageSpan + */ + PageSpan.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.Chunk.PageSpan) + return object; + var message = new $root.google.cloud.discoveryengine.v1alpha.Chunk.PageSpan(); + if (object.pageStart != null) + message.pageStart = object.pageStart | 0; + if (object.pageEnd != null) + message.pageEnd = object.pageEnd | 0; + return message; + }; + + /** + * Creates a plain object from a PageSpan message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1alpha.Chunk.PageSpan + * @static + * @param {google.cloud.discoveryengine.v1alpha.Chunk.PageSpan} message PageSpan + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PageSpan.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.pageStart = 0; + object.pageEnd = 0; + } + if (message.pageStart != null && message.hasOwnProperty("pageStart")) + object.pageStart = message.pageStart; + if (message.pageEnd != null && message.hasOwnProperty("pageEnd")) + object.pageEnd = message.pageEnd; + return object; + }; + + /** + * Converts this PageSpan to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1alpha.Chunk.PageSpan + * @instance + * @returns {Object.} JSON object + */ + PageSpan.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PageSpan + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1alpha.Chunk.PageSpan + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PageSpan.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.Chunk.PageSpan"; + }; + + return PageSpan; + })(); + + Chunk.ChunkMetadata = (function() { + + /** + * Properties of a ChunkMetadata. + * @memberof google.cloud.discoveryengine.v1alpha.Chunk + * @interface IChunkMetadata + * @property {Array.|null} [previousChunks] ChunkMetadata previousChunks + * @property {Array.|null} [nextChunks] ChunkMetadata nextChunks + */ + + /** + * Constructs a new ChunkMetadata. + * @memberof google.cloud.discoveryengine.v1alpha.Chunk + * @classdesc Represents a ChunkMetadata. + * @implements IChunkMetadata + * @constructor + * @param {google.cloud.discoveryengine.v1alpha.Chunk.IChunkMetadata=} [properties] Properties to set + */ + function ChunkMetadata(properties) { + this.previousChunks = []; + this.nextChunks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChunkMetadata previousChunks. + * @member {Array.} previousChunks + * @memberof google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata + * @instance + */ + ChunkMetadata.prototype.previousChunks = $util.emptyArray; + + /** + * ChunkMetadata nextChunks. + * @member {Array.} nextChunks + * @memberof google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata + * @instance + */ + ChunkMetadata.prototype.nextChunks = $util.emptyArray; + + /** + * Creates a new ChunkMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata + * @static + * @param {google.cloud.discoveryengine.v1alpha.Chunk.IChunkMetadata=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata} ChunkMetadata instance + */ + ChunkMetadata.create = function create(properties) { + return new ChunkMetadata(properties); + }; + + /** + * Encodes the specified ChunkMetadata message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata + * @static + * @param {google.cloud.discoveryengine.v1alpha.Chunk.IChunkMetadata} message ChunkMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChunkMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.previousChunks != null && message.previousChunks.length) + for (var i = 0; i < message.previousChunks.length; ++i) + $root.google.cloud.discoveryengine.v1alpha.Chunk.encode(message.previousChunks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextChunks != null && message.nextChunks.length) + for (var i = 0; i < message.nextChunks.length; ++i) + $root.google.cloud.discoveryengine.v1alpha.Chunk.encode(message.nextChunks[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ChunkMetadata message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata + * @static + * @param {google.cloud.discoveryengine.v1alpha.Chunk.IChunkMetadata} message ChunkMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChunkMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChunkMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata} ChunkMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChunkMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.previousChunks && message.previousChunks.length)) + message.previousChunks = []; + message.previousChunks.push($root.google.cloud.discoveryengine.v1alpha.Chunk.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.nextChunks && message.nextChunks.length)) + message.nextChunks = []; + message.nextChunks.push($root.google.cloud.discoveryengine.v1alpha.Chunk.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChunkMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata} ChunkMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChunkMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChunkMetadata message. + * @function verify + * @memberof google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChunkMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.previousChunks != null && message.hasOwnProperty("previousChunks")) { + if (!Array.isArray(message.previousChunks)) + return "previousChunks: array expected"; + for (var i = 0; i < message.previousChunks.length; ++i) { + var error = $root.google.cloud.discoveryengine.v1alpha.Chunk.verify(message.previousChunks[i]); + if (error) + return "previousChunks." + error; + } + } + if (message.nextChunks != null && message.hasOwnProperty("nextChunks")) { + if (!Array.isArray(message.nextChunks)) + return "nextChunks: array expected"; + for (var i = 0; i < message.nextChunks.length; ++i) { + var error = $root.google.cloud.discoveryengine.v1alpha.Chunk.verify(message.nextChunks[i]); + if (error) + return "nextChunks." + error; + } + } + return null; + }; + + /** + * Creates a ChunkMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata} ChunkMetadata + */ + ChunkMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata) + return object; + var message = new $root.google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata(); + if (object.previousChunks) { + if (!Array.isArray(object.previousChunks)) + throw TypeError(".google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata.previousChunks: array expected"); + message.previousChunks = []; + for (var i = 0; i < object.previousChunks.length; ++i) { + if (typeof object.previousChunks[i] !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata.previousChunks: object expected"); + message.previousChunks[i] = $root.google.cloud.discoveryengine.v1alpha.Chunk.fromObject(object.previousChunks[i]); + } + } + if (object.nextChunks) { + if (!Array.isArray(object.nextChunks)) + throw TypeError(".google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata.nextChunks: array expected"); + message.nextChunks = []; + for (var i = 0; i < object.nextChunks.length; ++i) { + if (typeof object.nextChunks[i] !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata.nextChunks: object expected"); + message.nextChunks[i] = $root.google.cloud.discoveryengine.v1alpha.Chunk.fromObject(object.nextChunks[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ChunkMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata + * @static + * @param {google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata} message ChunkMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChunkMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.previousChunks = []; + object.nextChunks = []; + } + if (message.previousChunks && message.previousChunks.length) { + object.previousChunks = []; + for (var j = 0; j < message.previousChunks.length; ++j) + object.previousChunks[j] = $root.google.cloud.discoveryengine.v1alpha.Chunk.toObject(message.previousChunks[j], options); + } + if (message.nextChunks && message.nextChunks.length) { + object.nextChunks = []; + for (var j = 0; j < message.nextChunks.length; ++j) + object.nextChunks[j] = $root.google.cloud.discoveryengine.v1alpha.Chunk.toObject(message.nextChunks[j], options); + } + return object; + }; + + /** + * Converts this ChunkMetadata to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata + * @instance + * @returns {Object.} JSON object + */ + ChunkMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChunkMetadata + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChunkMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.Chunk.ChunkMetadata"; + }; + + return ChunkMetadata; + })(); + return Chunk; })(); @@ -48876,24 +49432,28 @@ return BigQuerySource; })(); - v1alpha.ImportErrorConfig = (function() { + v1alpha.SpannerSource = (function() { /** - * Properties of an ImportErrorConfig. + * Properties of a SpannerSource. * @memberof google.cloud.discoveryengine.v1alpha - * @interface IImportErrorConfig - * @property {string|null} [gcsPrefix] ImportErrorConfig gcsPrefix + * @interface ISpannerSource + * @property {string|null} [projectId] SpannerSource projectId + * @property {string|null} [instanceId] SpannerSource instanceId + * @property {string|null} [databaseId] SpannerSource databaseId + * @property {string|null} [tableId] SpannerSource tableId + * @property {boolean|null} [enableDataBoost] SpannerSource enableDataBoost */ /** - * Constructs a new ImportErrorConfig. + * Constructs a new SpannerSource. * @memberof google.cloud.discoveryengine.v1alpha - * @classdesc Represents an ImportErrorConfig. - * @implements IImportErrorConfig + * @classdesc Represents a SpannerSource. + * @implements ISpannerSource * @constructor - * @param {google.cloud.discoveryengine.v1alpha.IImportErrorConfig=} [properties] Properties to set + * @param {google.cloud.discoveryengine.v1alpha.ISpannerSource=} [properties] Properties to set */ - function ImportErrorConfig(properties) { + function SpannerSource(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -48901,89 +49461,131 @@ } /** - * ImportErrorConfig gcsPrefix. - * @member {string|null|undefined} gcsPrefix - * @memberof google.cloud.discoveryengine.v1alpha.ImportErrorConfig + * SpannerSource projectId. + * @member {string} projectId + * @memberof google.cloud.discoveryengine.v1alpha.SpannerSource * @instance */ - ImportErrorConfig.prototype.gcsPrefix = null; + SpannerSource.prototype.projectId = ""; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * SpannerSource instanceId. + * @member {string} instanceId + * @memberof google.cloud.discoveryengine.v1alpha.SpannerSource + * @instance + */ + SpannerSource.prototype.instanceId = ""; /** - * ImportErrorConfig destination. - * @member {"gcsPrefix"|undefined} destination - * @memberof google.cloud.discoveryengine.v1alpha.ImportErrorConfig + * SpannerSource databaseId. + * @member {string} databaseId + * @memberof google.cloud.discoveryengine.v1alpha.SpannerSource * @instance */ - Object.defineProperty(ImportErrorConfig.prototype, "destination", { - get: $util.oneOfGetter($oneOfFields = ["gcsPrefix"]), - set: $util.oneOfSetter($oneOfFields) - }); + SpannerSource.prototype.databaseId = ""; /** - * Creates a new ImportErrorConfig instance using the specified properties. + * SpannerSource tableId. + * @member {string} tableId + * @memberof google.cloud.discoveryengine.v1alpha.SpannerSource + * @instance + */ + SpannerSource.prototype.tableId = ""; + + /** + * SpannerSource enableDataBoost. + * @member {boolean} enableDataBoost + * @memberof google.cloud.discoveryengine.v1alpha.SpannerSource + * @instance + */ + SpannerSource.prototype.enableDataBoost = false; + + /** + * Creates a new SpannerSource instance using the specified properties. * @function create - * @memberof google.cloud.discoveryengine.v1alpha.ImportErrorConfig + * @memberof google.cloud.discoveryengine.v1alpha.SpannerSource * @static - * @param {google.cloud.discoveryengine.v1alpha.IImportErrorConfig=} [properties] Properties to set - * @returns {google.cloud.discoveryengine.v1alpha.ImportErrorConfig} ImportErrorConfig instance + * @param {google.cloud.discoveryengine.v1alpha.ISpannerSource=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.SpannerSource} SpannerSource instance */ - ImportErrorConfig.create = function create(properties) { - return new ImportErrorConfig(properties); + SpannerSource.create = function create(properties) { + return new SpannerSource(properties); }; /** - * Encodes the specified ImportErrorConfig message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportErrorConfig.verify|verify} messages. + * Encodes the specified SpannerSource message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.SpannerSource.verify|verify} messages. * @function encode - * @memberof google.cloud.discoveryengine.v1alpha.ImportErrorConfig + * @memberof google.cloud.discoveryengine.v1alpha.SpannerSource * @static - * @param {google.cloud.discoveryengine.v1alpha.IImportErrorConfig} message ImportErrorConfig message or plain object to encode + * @param {google.cloud.discoveryengine.v1alpha.ISpannerSource} message SpannerSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportErrorConfig.encode = function encode(message, writer) { + SpannerSource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gcsPrefix != null && Object.hasOwnProperty.call(message, "gcsPrefix")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsPrefix); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.databaseId); + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.tableId); + if (message.enableDataBoost != null && Object.hasOwnProperty.call(message, "enableDataBoost")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.enableDataBoost); return writer; }; /** - * Encodes the specified ImportErrorConfig message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportErrorConfig.verify|verify} messages. + * Encodes the specified SpannerSource message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.SpannerSource.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.ImportErrorConfig + * @memberof google.cloud.discoveryengine.v1alpha.SpannerSource * @static - * @param {google.cloud.discoveryengine.v1alpha.IImportErrorConfig} message ImportErrorConfig message or plain object to encode + * @param {google.cloud.discoveryengine.v1alpha.ISpannerSource} message SpannerSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportErrorConfig.encodeDelimited = function encodeDelimited(message, writer) { + SpannerSource.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ImportErrorConfig message from the specified reader or buffer. + * Decodes a SpannerSource message from the specified reader or buffer. * @function decode - * @memberof google.cloud.discoveryengine.v1alpha.ImportErrorConfig + * @memberof google.cloud.discoveryengine.v1alpha.SpannerSource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.discoveryengine.v1alpha.ImportErrorConfig} ImportErrorConfig + * @returns {google.cloud.discoveryengine.v1alpha.SpannerSource} SpannerSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportErrorConfig.decode = function decode(reader, length) { + SpannerSource.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.SpannerSource(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.gcsPrefix = reader.string(); + message.projectId = reader.string(); + break; + } + case 2: { + message.instanceId = reader.string(); + break; + } + case 3: { + message.databaseId = reader.string(); + break; + } + case 4: { + message.tableId = reader.string(); + break; + } + case 5: { + message.enableDataBoost = reader.bool(); break; } default: @@ -48995,130 +49597,157 @@ }; /** - * Decodes an ImportErrorConfig message from the specified reader or buffer, length delimited. + * Decodes a SpannerSource message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.ImportErrorConfig + * @memberof google.cloud.discoveryengine.v1alpha.SpannerSource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.discoveryengine.v1alpha.ImportErrorConfig} ImportErrorConfig + * @returns {google.cloud.discoveryengine.v1alpha.SpannerSource} SpannerSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportErrorConfig.decodeDelimited = function decodeDelimited(reader) { + SpannerSource.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ImportErrorConfig message. + * Verifies a SpannerSource message. * @function verify - * @memberof google.cloud.discoveryengine.v1alpha.ImportErrorConfig + * @memberof google.cloud.discoveryengine.v1alpha.SpannerSource * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ImportErrorConfig.verify = function verify(message) { + SpannerSource.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.gcsPrefix != null && message.hasOwnProperty("gcsPrefix")) { - properties.destination = 1; - if (!$util.isString(message.gcsPrefix)) - return "gcsPrefix: string expected"; - } + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (!$util.isString(message.databaseId)) + return "databaseId: string expected"; + if (message.tableId != null && message.hasOwnProperty("tableId")) + if (!$util.isString(message.tableId)) + return "tableId: string expected"; + if (message.enableDataBoost != null && message.hasOwnProperty("enableDataBoost")) + if (typeof message.enableDataBoost !== "boolean") + return "enableDataBoost: boolean expected"; return null; }; /** - * Creates an ImportErrorConfig message from a plain object. Also converts values to their respective internal types. + * Creates a SpannerSource message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.discoveryengine.v1alpha.ImportErrorConfig + * @memberof google.cloud.discoveryengine.v1alpha.SpannerSource * @static * @param {Object.} object Plain object - * @returns {google.cloud.discoveryengine.v1alpha.ImportErrorConfig} ImportErrorConfig + * @returns {google.cloud.discoveryengine.v1alpha.SpannerSource} SpannerSource */ - ImportErrorConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig) + SpannerSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.SpannerSource) return object; - var message = new $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig(); - if (object.gcsPrefix != null) - message.gcsPrefix = String(object.gcsPrefix); + var message = new $root.google.cloud.discoveryengine.v1alpha.SpannerSource(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.databaseId != null) + message.databaseId = String(object.databaseId); + if (object.tableId != null) + message.tableId = String(object.tableId); + if (object.enableDataBoost != null) + message.enableDataBoost = Boolean(object.enableDataBoost); return message; }; /** - * Creates a plain object from an ImportErrorConfig message. Also converts values to other types if specified. + * Creates a plain object from a SpannerSource message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.discoveryengine.v1alpha.ImportErrorConfig + * @memberof google.cloud.discoveryengine.v1alpha.SpannerSource * @static - * @param {google.cloud.discoveryengine.v1alpha.ImportErrorConfig} message ImportErrorConfig + * @param {google.cloud.discoveryengine.v1alpha.SpannerSource} message SpannerSource * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ImportErrorConfig.toObject = function toObject(message, options) { + SpannerSource.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.gcsPrefix != null && message.hasOwnProperty("gcsPrefix")) { - object.gcsPrefix = message.gcsPrefix; - if (options.oneofs) - object.destination = "gcsPrefix"; + if (options.defaults) { + object.projectId = ""; + object.instanceId = ""; + object.databaseId = ""; + object.tableId = ""; + object.enableDataBoost = false; } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + object.databaseId = message.databaseId; + if (message.tableId != null && message.hasOwnProperty("tableId")) + object.tableId = message.tableId; + if (message.enableDataBoost != null && message.hasOwnProperty("enableDataBoost")) + object.enableDataBoost = message.enableDataBoost; return object; }; /** - * Converts this ImportErrorConfig to JSON. + * Converts this SpannerSource to JSON. * @function toJSON - * @memberof google.cloud.discoveryengine.v1alpha.ImportErrorConfig + * @memberof google.cloud.discoveryengine.v1alpha.SpannerSource * @instance * @returns {Object.} JSON object */ - ImportErrorConfig.prototype.toJSON = function toJSON() { + SpannerSource.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ImportErrorConfig + * Gets the default type url for SpannerSource * @function getTypeUrl - * @memberof google.cloud.discoveryengine.v1alpha.ImportErrorConfig + * @memberof google.cloud.discoveryengine.v1alpha.SpannerSource * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ImportErrorConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SpannerSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.ImportErrorConfig"; + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.SpannerSource"; }; - return ImportErrorConfig; + return SpannerSource; })(); - v1alpha.ImportUserEventsRequest = (function() { + v1alpha.BigtableOptions = (function() { /** - * Properties of an ImportUserEventsRequest. + * Properties of a BigtableOptions. * @memberof google.cloud.discoveryengine.v1alpha - * @interface IImportUserEventsRequest - * @property {google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.IInlineSource|null} [inlineSource] ImportUserEventsRequest inlineSource - * @property {google.cloud.discoveryengine.v1alpha.IGcsSource|null} [gcsSource] ImportUserEventsRequest gcsSource - * @property {google.cloud.discoveryengine.v1alpha.IBigQuerySource|null} [bigquerySource] ImportUserEventsRequest bigquerySource - * @property {string|null} [parent] ImportUserEventsRequest parent - * @property {google.cloud.discoveryengine.v1alpha.IImportErrorConfig|null} [errorConfig] ImportUserEventsRequest errorConfig + * @interface IBigtableOptions + * @property {string|null} [keyFieldName] BigtableOptions keyFieldName + * @property {Object.|null} [families] BigtableOptions families */ /** - * Constructs a new ImportUserEventsRequest. + * Constructs a new BigtableOptions. * @memberof google.cloud.discoveryengine.v1alpha - * @classdesc Represents an ImportUserEventsRequest. - * @implements IImportUserEventsRequest + * @classdesc Represents a BigtableOptions. + * @implements IBigtableOptions * @constructor - * @param {google.cloud.discoveryengine.v1alpha.IImportUserEventsRequest=} [properties] Properties to set + * @param {google.cloud.discoveryengine.v1alpha.IBigtableOptions=} [properties] Properties to set */ - function ImportUserEventsRequest(properties) { + function BigtableOptions(properties) { + this.families = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -49126,145 +49755,111 @@ } /** - * ImportUserEventsRequest inlineSource. - * @member {google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.IInlineSource|null|undefined} inlineSource - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest - * @instance - */ - ImportUserEventsRequest.prototype.inlineSource = null; - - /** - * ImportUserEventsRequest gcsSource. - * @member {google.cloud.discoveryengine.v1alpha.IGcsSource|null|undefined} gcsSource - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest - * @instance - */ - ImportUserEventsRequest.prototype.gcsSource = null; - - /** - * ImportUserEventsRequest bigquerySource. - * @member {google.cloud.discoveryengine.v1alpha.IBigQuerySource|null|undefined} bigquerySource - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest - * @instance - */ - ImportUserEventsRequest.prototype.bigquerySource = null; - - /** - * ImportUserEventsRequest parent. - * @member {string} parent - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest - * @instance - */ - ImportUserEventsRequest.prototype.parent = ""; - - /** - * ImportUserEventsRequest errorConfig. - * @member {google.cloud.discoveryengine.v1alpha.IImportErrorConfig|null|undefined} errorConfig - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest + * BigtableOptions keyFieldName. + * @member {string} keyFieldName + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions * @instance */ - ImportUserEventsRequest.prototype.errorConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + BigtableOptions.prototype.keyFieldName = ""; /** - * ImportUserEventsRequest source. - * @member {"inlineSource"|"gcsSource"|"bigquerySource"|undefined} source - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest + * BigtableOptions families. + * @member {Object.} families + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions * @instance */ - Object.defineProperty(ImportUserEventsRequest.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["inlineSource", "gcsSource", "bigquerySource"]), - set: $util.oneOfSetter($oneOfFields) - }); + BigtableOptions.prototype.families = $util.emptyObject; /** - * Creates a new ImportUserEventsRequest instance using the specified properties. + * Creates a new BigtableOptions instance using the specified properties. * @function create - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions * @static - * @param {google.cloud.discoveryengine.v1alpha.IImportUserEventsRequest=} [properties] Properties to set - * @returns {google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest} ImportUserEventsRequest instance + * @param {google.cloud.discoveryengine.v1alpha.IBigtableOptions=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.BigtableOptions} BigtableOptions instance */ - ImportUserEventsRequest.create = function create(properties) { - return new ImportUserEventsRequest(properties); + BigtableOptions.create = function create(properties) { + return new BigtableOptions(properties); }; /** - * Encodes the specified ImportUserEventsRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.verify|verify} messages. + * Encodes the specified BigtableOptions message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.BigtableOptions.verify|verify} messages. * @function encode - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions * @static - * @param {google.cloud.discoveryengine.v1alpha.IImportUserEventsRequest} message ImportUserEventsRequest message or plain object to encode + * @param {google.cloud.discoveryengine.v1alpha.IBigtableOptions} message BigtableOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportUserEventsRequest.encode = function encode(message, writer) { + BigtableOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.inlineSource != null && Object.hasOwnProperty.call(message, "inlineSource")) - $root.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource.encode(message.inlineSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) - $root.google.cloud.discoveryengine.v1alpha.GcsSource.encode(message.gcsSource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.bigquerySource != null && Object.hasOwnProperty.call(message, "bigquerySource")) - $root.google.cloud.discoveryengine.v1alpha.BigQuerySource.encode(message.bigquerySource, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.errorConfig != null && Object.hasOwnProperty.call(message, "errorConfig")) - $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.encode(message.errorConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.keyFieldName != null && Object.hasOwnProperty.call(message, "keyFieldName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.keyFieldName); + if (message.families != null && Object.hasOwnProperty.call(message, "families")) + for (var keys = Object.keys(message.families), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumnFamily.encode(message.families[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } return writer; }; /** - * Encodes the specified ImportUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.verify|verify} messages. + * Encodes the specified BigtableOptions message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.BigtableOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions * @static - * @param {google.cloud.discoveryengine.v1alpha.IImportUserEventsRequest} message ImportUserEventsRequest message or plain object to encode + * @param {google.cloud.discoveryengine.v1alpha.IBigtableOptions} message BigtableOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportUserEventsRequest.encodeDelimited = function encodeDelimited(message, writer) { + BigtableOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ImportUserEventsRequest message from the specified reader or buffer. + * Decodes a BigtableOptions message from the specified reader or buffer. * @function decode - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest} ImportUserEventsRequest + * @returns {google.cloud.discoveryengine.v1alpha.BigtableOptions} BigtableOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportUserEventsRequest.decode = function decode(reader, length) { + BigtableOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.BigtableOptions(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: { - message.inlineSource = $root.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource.decode(reader, reader.uint32()); - break; - } - case 3: { - message.gcsSource = $root.google.cloud.discoveryengine.v1alpha.GcsSource.decode(reader, reader.uint32()); - break; - } - case 4: { - message.bigquerySource = $root.google.cloud.discoveryengine.v1alpha.BigQuerySource.decode(reader, reader.uint32()); - break; - } case 1: { - message.parent = reader.string(); + message.keyFieldName = reader.string(); break; } - case 5: { - message.errorConfig = $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.decode(reader, reader.uint32()); + case 2: { + if (message.families === $util.emptyObject) + message.families = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumnFamily.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.families[key] = value; break; } default: @@ -49276,193 +49871,151 @@ }; /** - * Decodes an ImportUserEventsRequest message from the specified reader or buffer, length delimited. + * Decodes a BigtableOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest} ImportUserEventsRequest + * @returns {google.cloud.discoveryengine.v1alpha.BigtableOptions} BigtableOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportUserEventsRequest.decodeDelimited = function decodeDelimited(reader) { + BigtableOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ImportUserEventsRequest message. + * Verifies a BigtableOptions message. * @function verify - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ImportUserEventsRequest.verify = function verify(message) { + BigtableOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.inlineSource != null && message.hasOwnProperty("inlineSource")) { - properties.source = 1; - { - var error = $root.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource.verify(message.inlineSource); - if (error) - return "inlineSource." + error; - } - } - if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.discoveryengine.v1alpha.GcsSource.verify(message.gcsSource); - if (error) - return "gcsSource." + error; - } - } - if (message.bigquerySource != null && message.hasOwnProperty("bigquerySource")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.discoveryengine.v1alpha.BigQuerySource.verify(message.bigquerySource); + if (message.keyFieldName != null && message.hasOwnProperty("keyFieldName")) + if (!$util.isString(message.keyFieldName)) + return "keyFieldName: string expected"; + if (message.families != null && message.hasOwnProperty("families")) { + if (!$util.isObject(message.families)) + return "families: object expected"; + var key = Object.keys(message.families); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumnFamily.verify(message.families[key[i]]); if (error) - return "bigquerySource." + error; + return "families." + error; } } - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.errorConfig != null && message.hasOwnProperty("errorConfig")) { - var error = $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.verify(message.errorConfig); - if (error) - return "errorConfig." + error; - } return null; }; /** - * Creates an ImportUserEventsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BigtableOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions * @static * @param {Object.} object Plain object - * @returns {google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest} ImportUserEventsRequest + * @returns {google.cloud.discoveryengine.v1alpha.BigtableOptions} BigtableOptions */ - ImportUserEventsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest) + BigtableOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.BigtableOptions) return object; - var message = new $root.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest(); - if (object.inlineSource != null) { - if (typeof object.inlineSource !== "object") - throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.inlineSource: object expected"); - message.inlineSource = $root.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource.fromObject(object.inlineSource); - } - if (object.gcsSource != null) { - if (typeof object.gcsSource !== "object") - throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.gcsSource: object expected"); - message.gcsSource = $root.google.cloud.discoveryengine.v1alpha.GcsSource.fromObject(object.gcsSource); - } - if (object.bigquerySource != null) { - if (typeof object.bigquerySource !== "object") - throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.bigquerySource: object expected"); - message.bigquerySource = $root.google.cloud.discoveryengine.v1alpha.BigQuerySource.fromObject(object.bigquerySource); - } - if (object.parent != null) - message.parent = String(object.parent); - if (object.errorConfig != null) { - if (typeof object.errorConfig !== "object") - throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.errorConfig: object expected"); - message.errorConfig = $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.fromObject(object.errorConfig); + var message = new $root.google.cloud.discoveryengine.v1alpha.BigtableOptions(); + if (object.keyFieldName != null) + message.keyFieldName = String(object.keyFieldName); + if (object.families) { + if (typeof object.families !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.BigtableOptions.families: object expected"); + message.families = {}; + for (var keys = Object.keys(object.families), i = 0; i < keys.length; ++i) { + if (typeof object.families[keys[i]] !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.BigtableOptions.families: object expected"); + message.families[keys[i]] = $root.google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumnFamily.fromObject(object.families[keys[i]]); + } } return message; }; /** - * Creates a plain object from an ImportUserEventsRequest message. Also converts values to other types if specified. + * Creates a plain object from a BigtableOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions * @static - * @param {google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest} message ImportUserEventsRequest + * @param {google.cloud.discoveryengine.v1alpha.BigtableOptions} message BigtableOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ImportUserEventsRequest.toObject = function toObject(message, options) { + BigtableOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.errorConfig = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.inlineSource != null && message.hasOwnProperty("inlineSource")) { - object.inlineSource = $root.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource.toObject(message.inlineSource, options); - if (options.oneofs) - object.source = "inlineSource"; - } - if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { - object.gcsSource = $root.google.cloud.discoveryengine.v1alpha.GcsSource.toObject(message.gcsSource, options); - if (options.oneofs) - object.source = "gcsSource"; - } - if (message.bigquerySource != null && message.hasOwnProperty("bigquerySource")) { - object.bigquerySource = $root.google.cloud.discoveryengine.v1alpha.BigQuerySource.toObject(message.bigquerySource, options); - if (options.oneofs) - object.source = "bigquerySource"; + if (options.objects || options.defaults) + object.families = {}; + if (options.defaults) + object.keyFieldName = ""; + if (message.keyFieldName != null && message.hasOwnProperty("keyFieldName")) + object.keyFieldName = message.keyFieldName; + var keys2; + if (message.families && (keys2 = Object.keys(message.families)).length) { + object.families = {}; + for (var j = 0; j < keys2.length; ++j) + object.families[keys2[j]] = $root.google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumnFamily.toObject(message.families[keys2[j]], options); } - if (message.errorConfig != null && message.hasOwnProperty("errorConfig")) - object.errorConfig = $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.toObject(message.errorConfig, options); return object; }; /** - * Converts this ImportUserEventsRequest to JSON. + * Converts this BigtableOptions to JSON. * @function toJSON - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions * @instance * @returns {Object.} JSON object */ - ImportUserEventsRequest.prototype.toJSON = function toJSON() { + BigtableOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ImportUserEventsRequest + * Gets the default type url for BigtableOptions * @function getTypeUrl - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ImportUserEventsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BigtableOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest"; + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.BigtableOptions"; }; - ImportUserEventsRequest.InlineSource = (function() { + BigtableOptions.BigtableColumnFamily = (function() { /** - * Properties of an InlineSource. - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest - * @interface IInlineSource - * @property {Array.|null} [userEvents] InlineSource userEvents + * Properties of a BigtableColumnFamily. + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions + * @interface IBigtableColumnFamily + * @property {string|null} [fieldName] BigtableColumnFamily fieldName + * @property {google.cloud.discoveryengine.v1alpha.BigtableOptions.Encoding|null} [encoding] BigtableColumnFamily encoding + * @property {google.cloud.discoveryengine.v1alpha.BigtableOptions.Type|null} [type] BigtableColumnFamily type + * @property {Array.|null} [columns] BigtableColumnFamily columns */ /** - * Constructs a new InlineSource. - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest - * @classdesc Represents an InlineSource. - * @implements IInlineSource + * Constructs a new BigtableColumnFamily. + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions + * @classdesc Represents a BigtableColumnFamily. + * @implements IBigtableColumnFamily * @constructor - * @param {google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.IInlineSource=} [properties] Properties to set + * @param {google.cloud.discoveryengine.v1alpha.BigtableOptions.IBigtableColumnFamily=} [properties] Properties to set */ - function InlineSource(properties) { - this.userEvents = []; + function BigtableColumnFamily(properties) { + this.columns = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -49470,78 +50023,120 @@ } /** - * InlineSource userEvents. - * @member {Array.} userEvents - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + * BigtableColumnFamily fieldName. + * @member {string} fieldName + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumnFamily * @instance */ - InlineSource.prototype.userEvents = $util.emptyArray; + BigtableColumnFamily.prototype.fieldName = ""; /** - * Creates a new InlineSource instance using the specified properties. + * BigtableColumnFamily encoding. + * @member {google.cloud.discoveryengine.v1alpha.BigtableOptions.Encoding} encoding + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumnFamily + * @instance + */ + BigtableColumnFamily.prototype.encoding = 0; + + /** + * BigtableColumnFamily type. + * @member {google.cloud.discoveryengine.v1alpha.BigtableOptions.Type} type + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumnFamily + * @instance + */ + BigtableColumnFamily.prototype.type = 0; + + /** + * BigtableColumnFamily columns. + * @member {Array.} columns + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumnFamily + * @instance + */ + BigtableColumnFamily.prototype.columns = $util.emptyArray; + + /** + * Creates a new BigtableColumnFamily instance using the specified properties. * @function create - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumnFamily * @static - * @param {google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.IInlineSource=} [properties] Properties to set - * @returns {google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource} InlineSource instance + * @param {google.cloud.discoveryengine.v1alpha.BigtableOptions.IBigtableColumnFamily=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumnFamily} BigtableColumnFamily instance */ - InlineSource.create = function create(properties) { - return new InlineSource(properties); + BigtableColumnFamily.create = function create(properties) { + return new BigtableColumnFamily(properties); }; /** - * Encodes the specified InlineSource message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource.verify|verify} messages. + * Encodes the specified BigtableColumnFamily message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumnFamily.verify|verify} messages. * @function encode - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumnFamily * @static - * @param {google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.IInlineSource} message InlineSource message or plain object to encode + * @param {google.cloud.discoveryengine.v1alpha.BigtableOptions.IBigtableColumnFamily} message BigtableColumnFamily message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InlineSource.encode = function encode(message, writer) { + BigtableColumnFamily.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.userEvents != null && message.userEvents.length) - for (var i = 0; i < message.userEvents.length; ++i) - $root.google.cloud.discoveryengine.v1alpha.UserEvent.encode(message.userEvents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fieldName != null && Object.hasOwnProperty.call(message, "fieldName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fieldName); + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.encoding); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); + if (message.columns != null && message.columns.length) + for (var i = 0; i < message.columns.length; ++i) + $root.google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumn.encode(message.columns[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified InlineSource message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource.verify|verify} messages. + * Encodes the specified BigtableColumnFamily message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumnFamily.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumnFamily * @static - * @param {google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.IInlineSource} message InlineSource message or plain object to encode + * @param {google.cloud.discoveryengine.v1alpha.BigtableOptions.IBigtableColumnFamily} message BigtableColumnFamily message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InlineSource.encodeDelimited = function encodeDelimited(message, writer) { + BigtableColumnFamily.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an InlineSource message from the specified reader or buffer. + * Decodes a BigtableColumnFamily message from the specified reader or buffer. * @function decode - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumnFamily * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource} InlineSource + * @returns {google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumnFamily} BigtableColumnFamily * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - InlineSource.decode = function decode(reader, length) { + BigtableColumnFamily.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumnFamily(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.userEvents && message.userEvents.length)) - message.userEvents = []; - message.userEvents.push($root.google.cloud.discoveryengine.v1alpha.UserEvent.decode(reader, reader.uint32())); + message.fieldName = reader.string(); + break; + } + case 2: { + message.encoding = reader.int32(); + break; + } + case 3: { + message.type = reader.int32(); + break; + } + case 4: { + if (!(message.columns && message.columns.length)) + message.columns = []; + message.columns.push($root.google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumn.decode(reader, reader.uint32())); break; } default: @@ -49553,146 +50148,641 @@ }; /** - * Decodes an InlineSource message from the specified reader or buffer, length delimited. + * Decodes a BigtableColumnFamily message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumnFamily * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource} InlineSource + * @returns {google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumnFamily} BigtableColumnFamily * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - InlineSource.decodeDelimited = function decodeDelimited(reader) { + BigtableColumnFamily.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an InlineSource message. + * Verifies a BigtableColumnFamily message. * @function verify - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumnFamily * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - InlineSource.verify = function verify(message) { + BigtableColumnFamily.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.userEvents != null && message.hasOwnProperty("userEvents")) { - if (!Array.isArray(message.userEvents)) - return "userEvents: array expected"; - for (var i = 0; i < message.userEvents.length; ++i) { - var error = $root.google.cloud.discoveryengine.v1alpha.UserEvent.verify(message.userEvents[i]); + if (message.fieldName != null && message.hasOwnProperty("fieldName")) + if (!$util.isString(message.fieldName)) + return "fieldName: string expected"; + if (message.encoding != null && message.hasOwnProperty("encoding")) + switch (message.encoding) { + default: + return "encoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.columns != null && message.hasOwnProperty("columns")) { + if (!Array.isArray(message.columns)) + return "columns: array expected"; + for (var i = 0; i < message.columns.length; ++i) { + var error = $root.google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumn.verify(message.columns[i]); if (error) - return "userEvents." + error; + return "columns." + error; } } return null; }; /** - * Creates an InlineSource message from a plain object. Also converts values to their respective internal types. + * Creates a BigtableColumnFamily message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumnFamily * @static * @param {Object.} object Plain object - * @returns {google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource} InlineSource + * @returns {google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumnFamily} BigtableColumnFamily */ - InlineSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource) + BigtableColumnFamily.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumnFamily) return object; - var message = new $root.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource(); - if (object.userEvents) { - if (!Array.isArray(object.userEvents)) - throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource.userEvents: array expected"); - message.userEvents = []; - for (var i = 0; i < object.userEvents.length; ++i) { - if (typeof object.userEvents[i] !== "object") - throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource.userEvents: object expected"); - message.userEvents[i] = $root.google.cloud.discoveryengine.v1alpha.UserEvent.fromObject(object.userEvents[i]); + var message = new $root.google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumnFamily(); + if (object.fieldName != null) + message.fieldName = String(object.fieldName); + switch (object.encoding) { + default: + if (typeof object.encoding === "number") { + message.encoding = object.encoding; + break; + } + break; + case "ENCODING_UNSPECIFIED": + case 0: + message.encoding = 0; + break; + case "TEXT": + case 1: + message.encoding = 1; + break; + case "BINARY": + case 2: + message.encoding = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "STRING": + case 1: + message.type = 1; + break; + case "NUMBER": + case 2: + message.type = 2; + break; + case "INTEGER": + case 3: + message.type = 3; + break; + case "VAR_INTEGER": + case 4: + message.type = 4; + break; + case "BIG_NUMERIC": + case 5: + message.type = 5; + break; + case "BOOLEAN": + case 6: + message.type = 6; + break; + case "JSON": + case 7: + message.type = 7; + break; + } + if (object.columns) { + if (!Array.isArray(object.columns)) + throw TypeError(".google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumnFamily.columns: array expected"); + message.columns = []; + for (var i = 0; i < object.columns.length; ++i) { + if (typeof object.columns[i] !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumnFamily.columns: object expected"); + message.columns[i] = $root.google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumn.fromObject(object.columns[i]); } } return message; }; /** - * Creates a plain object from an InlineSource message. Also converts values to other types if specified. + * Creates a plain object from a BigtableColumnFamily message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumnFamily * @static - * @param {google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource} message InlineSource + * @param {google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumnFamily} message BigtableColumnFamily * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InlineSource.toObject = function toObject(message, options) { + BigtableColumnFamily.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.userEvents = []; - if (message.userEvents && message.userEvents.length) { - object.userEvents = []; - for (var j = 0; j < message.userEvents.length; ++j) - object.userEvents[j] = $root.google.cloud.discoveryengine.v1alpha.UserEvent.toObject(message.userEvents[j], options); + object.columns = []; + if (options.defaults) { + object.fieldName = ""; + object.encoding = options.enums === String ? "ENCODING_UNSPECIFIED" : 0; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + } + if (message.fieldName != null && message.hasOwnProperty("fieldName")) + object.fieldName = message.fieldName; + if (message.encoding != null && message.hasOwnProperty("encoding")) + object.encoding = options.enums === String ? $root.google.cloud.discoveryengine.v1alpha.BigtableOptions.Encoding[message.encoding] === undefined ? message.encoding : $root.google.cloud.discoveryengine.v1alpha.BigtableOptions.Encoding[message.encoding] : message.encoding; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.discoveryengine.v1alpha.BigtableOptions.Type[message.type] === undefined ? message.type : $root.google.cloud.discoveryengine.v1alpha.BigtableOptions.Type[message.type] : message.type; + if (message.columns && message.columns.length) { + object.columns = []; + for (var j = 0; j < message.columns.length; ++j) + object.columns[j] = $root.google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumn.toObject(message.columns[j], options); } return object; }; /** - * Converts this InlineSource to JSON. + * Converts this BigtableColumnFamily to JSON. * @function toJSON - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumnFamily * @instance * @returns {Object.} JSON object */ - InlineSource.prototype.toJSON = function toJSON() { + BigtableColumnFamily.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for InlineSource + * Gets the default type url for BigtableColumnFamily * @function getTypeUrl - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumnFamily * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - InlineSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BigtableColumnFamily.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource"; + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumnFamily"; }; - return InlineSource; + return BigtableColumnFamily; })(); - return ImportUserEventsRequest; + BigtableOptions.BigtableColumn = (function() { + + /** + * Properties of a BigtableColumn. + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions + * @interface IBigtableColumn + * @property {Uint8Array|null} [qualifier] BigtableColumn qualifier + * @property {string|null} [fieldName] BigtableColumn fieldName + * @property {google.cloud.discoveryengine.v1alpha.BigtableOptions.Encoding|null} [encoding] BigtableColumn encoding + * @property {google.cloud.discoveryengine.v1alpha.BigtableOptions.Type|null} [type] BigtableColumn type + */ + + /** + * Constructs a new BigtableColumn. + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions + * @classdesc Represents a BigtableColumn. + * @implements IBigtableColumn + * @constructor + * @param {google.cloud.discoveryengine.v1alpha.BigtableOptions.IBigtableColumn=} [properties] Properties to set + */ + function BigtableColumn(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BigtableColumn qualifier. + * @member {Uint8Array} qualifier + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumn + * @instance + */ + BigtableColumn.prototype.qualifier = $util.newBuffer([]); + + /** + * BigtableColumn fieldName. + * @member {string} fieldName + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumn + * @instance + */ + BigtableColumn.prototype.fieldName = ""; + + /** + * BigtableColumn encoding. + * @member {google.cloud.discoveryengine.v1alpha.BigtableOptions.Encoding} encoding + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumn + * @instance + */ + BigtableColumn.prototype.encoding = 0; + + /** + * BigtableColumn type. + * @member {google.cloud.discoveryengine.v1alpha.BigtableOptions.Type} type + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumn + * @instance + */ + BigtableColumn.prototype.type = 0; + + /** + * Creates a new BigtableColumn instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumn + * @static + * @param {google.cloud.discoveryengine.v1alpha.BigtableOptions.IBigtableColumn=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumn} BigtableColumn instance + */ + BigtableColumn.create = function create(properties) { + return new BigtableColumn(properties); + }; + + /** + * Encodes the specified BigtableColumn message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumn.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumn + * @static + * @param {google.cloud.discoveryengine.v1alpha.BigtableOptions.IBigtableColumn} message BigtableColumn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigtableColumn.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.qualifier != null && Object.hasOwnProperty.call(message, "qualifier")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.qualifier); + if (message.fieldName != null && Object.hasOwnProperty.call(message, "fieldName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fieldName); + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.encoding); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.type); + return writer; + }; + + /** + * Encodes the specified BigtableColumn message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumn.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumn + * @static + * @param {google.cloud.discoveryengine.v1alpha.BigtableOptions.IBigtableColumn} message BigtableColumn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigtableColumn.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BigtableColumn message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumn} BigtableColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigtableColumn.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumn(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.qualifier = reader.bytes(); + break; + } + case 2: { + message.fieldName = reader.string(); + break; + } + case 3: { + message.encoding = reader.int32(); + break; + } + case 4: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BigtableColumn message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumn} BigtableColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigtableColumn.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigtableColumn message. + * @function verify + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumn + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigtableColumn.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.qualifier != null && message.hasOwnProperty("qualifier")) + if (!(message.qualifier && typeof message.qualifier.length === "number" || $util.isString(message.qualifier))) + return "qualifier: buffer expected"; + if (message.fieldName != null && message.hasOwnProperty("fieldName")) + if (!$util.isString(message.fieldName)) + return "fieldName: string expected"; + if (message.encoding != null && message.hasOwnProperty("encoding")) + switch (message.encoding) { + default: + return "encoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + return null; + }; + + /** + * Creates a BigtableColumn message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumn + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumn} BigtableColumn + */ + BigtableColumn.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumn) + return object; + var message = new $root.google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumn(); + if (object.qualifier != null) + if (typeof object.qualifier === "string") + $util.base64.decode(object.qualifier, message.qualifier = $util.newBuffer($util.base64.length(object.qualifier)), 0); + else if (object.qualifier.length >= 0) + message.qualifier = object.qualifier; + if (object.fieldName != null) + message.fieldName = String(object.fieldName); + switch (object.encoding) { + default: + if (typeof object.encoding === "number") { + message.encoding = object.encoding; + break; + } + break; + case "ENCODING_UNSPECIFIED": + case 0: + message.encoding = 0; + break; + case "TEXT": + case 1: + message.encoding = 1; + break; + case "BINARY": + case 2: + message.encoding = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "STRING": + case 1: + message.type = 1; + break; + case "NUMBER": + case 2: + message.type = 2; + break; + case "INTEGER": + case 3: + message.type = 3; + break; + case "VAR_INTEGER": + case 4: + message.type = 4; + break; + case "BIG_NUMERIC": + case 5: + message.type = 5; + break; + case "BOOLEAN": + case 6: + message.type = 6; + break; + case "JSON": + case 7: + message.type = 7; + break; + } + return message; + }; + + /** + * Creates a plain object from a BigtableColumn message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumn + * @static + * @param {google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumn} message BigtableColumn + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigtableColumn.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.qualifier = ""; + else { + object.qualifier = []; + if (options.bytes !== Array) + object.qualifier = $util.newBuffer(object.qualifier); + } + object.fieldName = ""; + object.encoding = options.enums === String ? "ENCODING_UNSPECIFIED" : 0; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + } + if (message.qualifier != null && message.hasOwnProperty("qualifier")) + object.qualifier = options.bytes === String ? $util.base64.encode(message.qualifier, 0, message.qualifier.length) : options.bytes === Array ? Array.prototype.slice.call(message.qualifier) : message.qualifier; + if (message.fieldName != null && message.hasOwnProperty("fieldName")) + object.fieldName = message.fieldName; + if (message.encoding != null && message.hasOwnProperty("encoding")) + object.encoding = options.enums === String ? $root.google.cloud.discoveryengine.v1alpha.BigtableOptions.Encoding[message.encoding] === undefined ? message.encoding : $root.google.cloud.discoveryengine.v1alpha.BigtableOptions.Encoding[message.encoding] : message.encoding; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.discoveryengine.v1alpha.BigtableOptions.Type[message.type] === undefined ? message.type : $root.google.cloud.discoveryengine.v1alpha.BigtableOptions.Type[message.type] : message.type; + return object; + }; + + /** + * Converts this BigtableColumn to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumn + * @instance + * @returns {Object.} JSON object + */ + BigtableColumn.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BigtableColumn + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumn + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BigtableColumn.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.BigtableOptions.BigtableColumn"; + }; + + return BigtableColumn; + })(); + + /** + * Type enum. + * @name google.cloud.discoveryengine.v1alpha.BigtableOptions.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} STRING=1 STRING value + * @property {number} NUMBER=2 NUMBER value + * @property {number} INTEGER=3 INTEGER value + * @property {number} VAR_INTEGER=4 VAR_INTEGER value + * @property {number} BIG_NUMERIC=5 BIG_NUMERIC value + * @property {number} BOOLEAN=6 BOOLEAN value + * @property {number} JSON=7 JSON value + */ + BigtableOptions.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STRING"] = 1; + values[valuesById[2] = "NUMBER"] = 2; + values[valuesById[3] = "INTEGER"] = 3; + values[valuesById[4] = "VAR_INTEGER"] = 4; + values[valuesById[5] = "BIG_NUMERIC"] = 5; + values[valuesById[6] = "BOOLEAN"] = 6; + values[valuesById[7] = "JSON"] = 7; + return values; + })(); + + /** + * Encoding enum. + * @name google.cloud.discoveryengine.v1alpha.BigtableOptions.Encoding + * @enum {number} + * @property {number} ENCODING_UNSPECIFIED=0 ENCODING_UNSPECIFIED value + * @property {number} TEXT=1 TEXT value + * @property {number} BINARY=2 BINARY value + */ + BigtableOptions.Encoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENCODING_UNSPECIFIED"] = 0; + values[valuesById[1] = "TEXT"] = 1; + values[valuesById[2] = "BINARY"] = 2; + return values; + })(); + + return BigtableOptions; })(); - v1alpha.ImportUserEventsResponse = (function() { + v1alpha.BigtableSource = (function() { /** - * Properties of an ImportUserEventsResponse. + * Properties of a BigtableSource. * @memberof google.cloud.discoveryengine.v1alpha - * @interface IImportUserEventsResponse - * @property {Array.|null} [errorSamples] ImportUserEventsResponse errorSamples - * @property {google.cloud.discoveryengine.v1alpha.IImportErrorConfig|null} [errorConfig] ImportUserEventsResponse errorConfig - * @property {number|Long|null} [joinedEventsCount] ImportUserEventsResponse joinedEventsCount - * @property {number|Long|null} [unjoinedEventsCount] ImportUserEventsResponse unjoinedEventsCount + * @interface IBigtableSource + * @property {string|null} [projectId] BigtableSource projectId + * @property {string|null} [instanceId] BigtableSource instanceId + * @property {string|null} [tableId] BigtableSource tableId + * @property {google.cloud.discoveryengine.v1alpha.IBigtableOptions|null} [bigtableOptions] BigtableSource bigtableOptions */ /** - * Constructs a new ImportUserEventsResponse. + * Constructs a new BigtableSource. * @memberof google.cloud.discoveryengine.v1alpha - * @classdesc Represents an ImportUserEventsResponse. - * @implements IImportUserEventsResponse + * @classdesc Represents a BigtableSource. + * @implements IBigtableSource * @constructor - * @param {google.cloud.discoveryengine.v1alpha.IImportUserEventsResponse=} [properties] Properties to set + * @param {google.cloud.discoveryengine.v1alpha.IBigtableSource=} [properties] Properties to set */ - function ImportUserEventsResponse(properties) { - this.errorSamples = []; + function BigtableSource(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -49700,120 +50790,117 @@ } /** - * ImportUserEventsResponse errorSamples. - * @member {Array.} errorSamples - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse + * BigtableSource projectId. + * @member {string} projectId + * @memberof google.cloud.discoveryengine.v1alpha.BigtableSource * @instance */ - ImportUserEventsResponse.prototype.errorSamples = $util.emptyArray; + BigtableSource.prototype.projectId = ""; /** - * ImportUserEventsResponse errorConfig. - * @member {google.cloud.discoveryengine.v1alpha.IImportErrorConfig|null|undefined} errorConfig - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse + * BigtableSource instanceId. + * @member {string} instanceId + * @memberof google.cloud.discoveryengine.v1alpha.BigtableSource * @instance */ - ImportUserEventsResponse.prototype.errorConfig = null; + BigtableSource.prototype.instanceId = ""; /** - * ImportUserEventsResponse joinedEventsCount. - * @member {number|Long} joinedEventsCount - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse + * BigtableSource tableId. + * @member {string} tableId + * @memberof google.cloud.discoveryengine.v1alpha.BigtableSource * @instance */ - ImportUserEventsResponse.prototype.joinedEventsCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + BigtableSource.prototype.tableId = ""; /** - * ImportUserEventsResponse unjoinedEventsCount. - * @member {number|Long} unjoinedEventsCount - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse + * BigtableSource bigtableOptions. + * @member {google.cloud.discoveryengine.v1alpha.IBigtableOptions|null|undefined} bigtableOptions + * @memberof google.cloud.discoveryengine.v1alpha.BigtableSource * @instance */ - ImportUserEventsResponse.prototype.unjoinedEventsCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + BigtableSource.prototype.bigtableOptions = null; /** - * Creates a new ImportUserEventsResponse instance using the specified properties. + * Creates a new BigtableSource instance using the specified properties. * @function create - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse + * @memberof google.cloud.discoveryengine.v1alpha.BigtableSource * @static - * @param {google.cloud.discoveryengine.v1alpha.IImportUserEventsResponse=} [properties] Properties to set - * @returns {google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse} ImportUserEventsResponse instance + * @param {google.cloud.discoveryengine.v1alpha.IBigtableSource=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.BigtableSource} BigtableSource instance */ - ImportUserEventsResponse.create = function create(properties) { - return new ImportUserEventsResponse(properties); + BigtableSource.create = function create(properties) { + return new BigtableSource(properties); }; /** - * Encodes the specified ImportUserEventsResponse message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse.verify|verify} messages. + * Encodes the specified BigtableSource message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.BigtableSource.verify|verify} messages. * @function encode - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse + * @memberof google.cloud.discoveryengine.v1alpha.BigtableSource * @static - * @param {google.cloud.discoveryengine.v1alpha.IImportUserEventsResponse} message ImportUserEventsResponse message or plain object to encode + * @param {google.cloud.discoveryengine.v1alpha.IBigtableSource} message BigtableSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportUserEventsResponse.encode = function encode(message, writer) { + BigtableSource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.errorSamples != null && message.errorSamples.length) - for (var i = 0; i < message.errorSamples.length; ++i) - $root.google.rpc.Status.encode(message.errorSamples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.errorConfig != null && Object.hasOwnProperty.call(message, "errorConfig")) - $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.encode(message.errorConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.joinedEventsCount != null && Object.hasOwnProperty.call(message, "joinedEventsCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.joinedEventsCount); - if (message.unjoinedEventsCount != null && Object.hasOwnProperty.call(message, "unjoinedEventsCount")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.unjoinedEventsCount); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tableId); + if (message.bigtableOptions != null && Object.hasOwnProperty.call(message, "bigtableOptions")) + $root.google.cloud.discoveryengine.v1alpha.BigtableOptions.encode(message.bigtableOptions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified ImportUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse.verify|verify} messages. + * Encodes the specified BigtableSource message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.BigtableSource.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse + * @memberof google.cloud.discoveryengine.v1alpha.BigtableSource * @static - * @param {google.cloud.discoveryengine.v1alpha.IImportUserEventsResponse} message ImportUserEventsResponse message or plain object to encode + * @param {google.cloud.discoveryengine.v1alpha.IBigtableSource} message BigtableSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportUserEventsResponse.encodeDelimited = function encodeDelimited(message, writer) { + BigtableSource.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ImportUserEventsResponse message from the specified reader or buffer. + * Decodes a BigtableSource message from the specified reader or buffer. * @function decode - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse + * @memberof google.cloud.discoveryengine.v1alpha.BigtableSource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse} ImportUserEventsResponse + * @returns {google.cloud.discoveryengine.v1alpha.BigtableSource} BigtableSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportUserEventsResponse.decode = function decode(reader, length) { + BigtableSource.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.BigtableSource(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.errorSamples && message.errorSamples.length)) - message.errorSamples = []; - message.errorSamples.push($root.google.rpc.Status.decode(reader, reader.uint32())); + message.projectId = reader.string(); break; } case 2: { - message.errorConfig = $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.decode(reader, reader.uint32()); + message.instanceId = reader.string(); break; } case 3: { - message.joinedEventsCount = reader.int64(); + message.tableId = reader.string(); break; } case 4: { - message.unjoinedEventsCount = reader.int64(); + message.bigtableOptions = $root.google.cloud.discoveryengine.v1alpha.BigtableOptions.decode(reader, reader.uint32()); break; } default: @@ -49825,201 +50912,153 @@ }; /** - * Decodes an ImportUserEventsResponse message from the specified reader or buffer, length delimited. + * Decodes a BigtableSource message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse + * @memberof google.cloud.discoveryengine.v1alpha.BigtableSource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse} ImportUserEventsResponse + * @returns {google.cloud.discoveryengine.v1alpha.BigtableSource} BigtableSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportUserEventsResponse.decodeDelimited = function decodeDelimited(reader) { + BigtableSource.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ImportUserEventsResponse message. + * Verifies a BigtableSource message. * @function verify - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse + * @memberof google.cloud.discoveryengine.v1alpha.BigtableSource * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ImportUserEventsResponse.verify = function verify(message) { + BigtableSource.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.errorSamples != null && message.hasOwnProperty("errorSamples")) { - if (!Array.isArray(message.errorSamples)) - return "errorSamples: array expected"; - for (var i = 0; i < message.errorSamples.length; ++i) { - var error = $root.google.rpc.Status.verify(message.errorSamples[i]); - if (error) - return "errorSamples." + error; - } - } - if (message.errorConfig != null && message.hasOwnProperty("errorConfig")) { - var error = $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.verify(message.errorConfig); + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.tableId != null && message.hasOwnProperty("tableId")) + if (!$util.isString(message.tableId)) + return "tableId: string expected"; + if (message.bigtableOptions != null && message.hasOwnProperty("bigtableOptions")) { + var error = $root.google.cloud.discoveryengine.v1alpha.BigtableOptions.verify(message.bigtableOptions); if (error) - return "errorConfig." + error; + return "bigtableOptions." + error; } - if (message.joinedEventsCount != null && message.hasOwnProperty("joinedEventsCount")) - if (!$util.isInteger(message.joinedEventsCount) && !(message.joinedEventsCount && $util.isInteger(message.joinedEventsCount.low) && $util.isInteger(message.joinedEventsCount.high))) - return "joinedEventsCount: integer|Long expected"; - if (message.unjoinedEventsCount != null && message.hasOwnProperty("unjoinedEventsCount")) - if (!$util.isInteger(message.unjoinedEventsCount) && !(message.unjoinedEventsCount && $util.isInteger(message.unjoinedEventsCount.low) && $util.isInteger(message.unjoinedEventsCount.high))) - return "unjoinedEventsCount: integer|Long expected"; return null; }; /** - * Creates an ImportUserEventsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a BigtableSource message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse + * @memberof google.cloud.discoveryengine.v1alpha.BigtableSource * @static * @param {Object.} object Plain object - * @returns {google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse} ImportUserEventsResponse + * @returns {google.cloud.discoveryengine.v1alpha.BigtableSource} BigtableSource */ - ImportUserEventsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse) + BigtableSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.BigtableSource) return object; - var message = new $root.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse(); - if (object.errorSamples) { - if (!Array.isArray(object.errorSamples)) - throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse.errorSamples: array expected"); - message.errorSamples = []; - for (var i = 0; i < object.errorSamples.length; ++i) { - if (typeof object.errorSamples[i] !== "object") - throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse.errorSamples: object expected"); - message.errorSamples[i] = $root.google.rpc.Status.fromObject(object.errorSamples[i]); - } - } - if (object.errorConfig != null) { - if (typeof object.errorConfig !== "object") - throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse.errorConfig: object expected"); - message.errorConfig = $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.fromObject(object.errorConfig); + var message = new $root.google.cloud.discoveryengine.v1alpha.BigtableSource(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.tableId != null) + message.tableId = String(object.tableId); + if (object.bigtableOptions != null) { + if (typeof object.bigtableOptions !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.BigtableSource.bigtableOptions: object expected"); + message.bigtableOptions = $root.google.cloud.discoveryengine.v1alpha.BigtableOptions.fromObject(object.bigtableOptions); } - if (object.joinedEventsCount != null) - if ($util.Long) - (message.joinedEventsCount = $util.Long.fromValue(object.joinedEventsCount)).unsigned = false; - else if (typeof object.joinedEventsCount === "string") - message.joinedEventsCount = parseInt(object.joinedEventsCount, 10); - else if (typeof object.joinedEventsCount === "number") - message.joinedEventsCount = object.joinedEventsCount; - else if (typeof object.joinedEventsCount === "object") - message.joinedEventsCount = new $util.LongBits(object.joinedEventsCount.low >>> 0, object.joinedEventsCount.high >>> 0).toNumber(); - if (object.unjoinedEventsCount != null) - if ($util.Long) - (message.unjoinedEventsCount = $util.Long.fromValue(object.unjoinedEventsCount)).unsigned = false; - else if (typeof object.unjoinedEventsCount === "string") - message.unjoinedEventsCount = parseInt(object.unjoinedEventsCount, 10); - else if (typeof object.unjoinedEventsCount === "number") - message.unjoinedEventsCount = object.unjoinedEventsCount; - else if (typeof object.unjoinedEventsCount === "object") - message.unjoinedEventsCount = new $util.LongBits(object.unjoinedEventsCount.low >>> 0, object.unjoinedEventsCount.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from an ImportUserEventsResponse message. Also converts values to other types if specified. + * Creates a plain object from a BigtableSource message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse + * @memberof google.cloud.discoveryengine.v1alpha.BigtableSource * @static - * @param {google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse} message ImportUserEventsResponse + * @param {google.cloud.discoveryengine.v1alpha.BigtableSource} message BigtableSource * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ImportUserEventsResponse.toObject = function toObject(message, options) { + BigtableSource.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.errorSamples = []; if (options.defaults) { - object.errorConfig = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.joinedEventsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.joinedEventsCount = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.unjoinedEventsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.unjoinedEventsCount = options.longs === String ? "0" : 0; - } - if (message.errorSamples && message.errorSamples.length) { - object.errorSamples = []; - for (var j = 0; j < message.errorSamples.length; ++j) - object.errorSamples[j] = $root.google.rpc.Status.toObject(message.errorSamples[j], options); + object.projectId = ""; + object.instanceId = ""; + object.tableId = ""; + object.bigtableOptions = null; } - if (message.errorConfig != null && message.hasOwnProperty("errorConfig")) - object.errorConfig = $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.toObject(message.errorConfig, options); - if (message.joinedEventsCount != null && message.hasOwnProperty("joinedEventsCount")) - if (typeof message.joinedEventsCount === "number") - object.joinedEventsCount = options.longs === String ? String(message.joinedEventsCount) : message.joinedEventsCount; - else - object.joinedEventsCount = options.longs === String ? $util.Long.prototype.toString.call(message.joinedEventsCount) : options.longs === Number ? new $util.LongBits(message.joinedEventsCount.low >>> 0, message.joinedEventsCount.high >>> 0).toNumber() : message.joinedEventsCount; - if (message.unjoinedEventsCount != null && message.hasOwnProperty("unjoinedEventsCount")) - if (typeof message.unjoinedEventsCount === "number") - object.unjoinedEventsCount = options.longs === String ? String(message.unjoinedEventsCount) : message.unjoinedEventsCount; - else - object.unjoinedEventsCount = options.longs === String ? $util.Long.prototype.toString.call(message.unjoinedEventsCount) : options.longs === Number ? new $util.LongBits(message.unjoinedEventsCount.low >>> 0, message.unjoinedEventsCount.high >>> 0).toNumber() : message.unjoinedEventsCount; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.tableId != null && message.hasOwnProperty("tableId")) + object.tableId = message.tableId; + if (message.bigtableOptions != null && message.hasOwnProperty("bigtableOptions")) + object.bigtableOptions = $root.google.cloud.discoveryengine.v1alpha.BigtableOptions.toObject(message.bigtableOptions, options); return object; }; /** - * Converts this ImportUserEventsResponse to JSON. + * Converts this BigtableSource to JSON. * @function toJSON - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse + * @memberof google.cloud.discoveryengine.v1alpha.BigtableSource * @instance * @returns {Object.} JSON object */ - ImportUserEventsResponse.prototype.toJSON = function toJSON() { + BigtableSource.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ImportUserEventsResponse + * Gets the default type url for BigtableSource * @function getTypeUrl - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse + * @memberof google.cloud.discoveryengine.v1alpha.BigtableSource * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ImportUserEventsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BigtableSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse"; + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.BigtableSource"; }; - return ImportUserEventsResponse; + return BigtableSource; })(); - v1alpha.ImportUserEventsMetadata = (function() { + v1alpha.FhirStoreSource = (function() { /** - * Properties of an ImportUserEventsMetadata. + * Properties of a FhirStoreSource. * @memberof google.cloud.discoveryengine.v1alpha - * @interface IImportUserEventsMetadata - * @property {google.protobuf.ITimestamp|null} [createTime] ImportUserEventsMetadata createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] ImportUserEventsMetadata updateTime - * @property {number|Long|null} [successCount] ImportUserEventsMetadata successCount - * @property {number|Long|null} [failureCount] ImportUserEventsMetadata failureCount + * @interface IFhirStoreSource + * @property {string|null} [fhirStore] FhirStoreSource fhirStore + * @property {string|null} [gcsStagingDir] FhirStoreSource gcsStagingDir */ /** - * Constructs a new ImportUserEventsMetadata. + * Constructs a new FhirStoreSource. * @memberof google.cloud.discoveryengine.v1alpha - * @classdesc Represents an ImportUserEventsMetadata. - * @implements IImportUserEventsMetadata + * @classdesc Represents a FhirStoreSource. + * @implements IFhirStoreSource * @constructor - * @param {google.cloud.discoveryengine.v1alpha.IImportUserEventsMetadata=} [properties] Properties to set + * @param {google.cloud.discoveryengine.v1alpha.IFhirStoreSource=} [properties] Properties to set */ - function ImportUserEventsMetadata(properties) { + function FhirStoreSource(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -50027,117 +51066,89 @@ } /** - * ImportUserEventsMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata - * @instance - */ - ImportUserEventsMetadata.prototype.createTime = null; - - /** - * ImportUserEventsMetadata updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata - * @instance - */ - ImportUserEventsMetadata.prototype.updateTime = null; - - /** - * ImportUserEventsMetadata successCount. - * @member {number|Long} successCount - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata + * FhirStoreSource fhirStore. + * @member {string} fhirStore + * @memberof google.cloud.discoveryengine.v1alpha.FhirStoreSource * @instance */ - ImportUserEventsMetadata.prototype.successCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + FhirStoreSource.prototype.fhirStore = ""; /** - * ImportUserEventsMetadata failureCount. - * @member {number|Long} failureCount - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata + * FhirStoreSource gcsStagingDir. + * @member {string} gcsStagingDir + * @memberof google.cloud.discoveryengine.v1alpha.FhirStoreSource * @instance */ - ImportUserEventsMetadata.prototype.failureCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + FhirStoreSource.prototype.gcsStagingDir = ""; /** - * Creates a new ImportUserEventsMetadata instance using the specified properties. + * Creates a new FhirStoreSource instance using the specified properties. * @function create - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata + * @memberof google.cloud.discoveryengine.v1alpha.FhirStoreSource * @static - * @param {google.cloud.discoveryengine.v1alpha.IImportUserEventsMetadata=} [properties] Properties to set - * @returns {google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata} ImportUserEventsMetadata instance + * @param {google.cloud.discoveryengine.v1alpha.IFhirStoreSource=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.FhirStoreSource} FhirStoreSource instance */ - ImportUserEventsMetadata.create = function create(properties) { - return new ImportUserEventsMetadata(properties); + FhirStoreSource.create = function create(properties) { + return new FhirStoreSource(properties); }; /** - * Encodes the specified ImportUserEventsMetadata message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata.verify|verify} messages. + * Encodes the specified FhirStoreSource message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.FhirStoreSource.verify|verify} messages. * @function encode - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata + * @memberof google.cloud.discoveryengine.v1alpha.FhirStoreSource * @static - * @param {google.cloud.discoveryengine.v1alpha.IImportUserEventsMetadata} message ImportUserEventsMetadata message or plain object to encode + * @param {google.cloud.discoveryengine.v1alpha.IFhirStoreSource} message FhirStoreSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportUserEventsMetadata.encode = function encode(message, writer) { + FhirStoreSource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.successCount != null && Object.hasOwnProperty.call(message, "successCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.successCount); - if (message.failureCount != null && Object.hasOwnProperty.call(message, "failureCount")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.failureCount); + if (message.fhirStore != null && Object.hasOwnProperty.call(message, "fhirStore")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fhirStore); + if (message.gcsStagingDir != null && Object.hasOwnProperty.call(message, "gcsStagingDir")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.gcsStagingDir); return writer; }; /** - * Encodes the specified ImportUserEventsMetadata message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata.verify|verify} messages. + * Encodes the specified FhirStoreSource message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.FhirStoreSource.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata + * @memberof google.cloud.discoveryengine.v1alpha.FhirStoreSource * @static - * @param {google.cloud.discoveryengine.v1alpha.IImportUserEventsMetadata} message ImportUserEventsMetadata message or plain object to encode + * @param {google.cloud.discoveryengine.v1alpha.IFhirStoreSource} message FhirStoreSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportUserEventsMetadata.encodeDelimited = function encodeDelimited(message, writer) { + FhirStoreSource.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ImportUserEventsMetadata message from the specified reader or buffer. + * Decodes a FhirStoreSource message from the specified reader or buffer. * @function decode - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata + * @memberof google.cloud.discoveryengine.v1alpha.FhirStoreSource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata} ImportUserEventsMetadata + * @returns {google.cloud.discoveryengine.v1alpha.FhirStoreSource} FhirStoreSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportUserEventsMetadata.decode = function decode(reader, length) { + FhirStoreSource.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.FhirStoreSource(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.fhirStore = reader.string(); break; } case 2: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.successCount = reader.int64(); - break; - } - case 4: { - message.failureCount = reader.int64(); + message.gcsStagingDir = reader.string(); break; } default: @@ -50149,188 +51160,136 @@ }; /** - * Decodes an ImportUserEventsMetadata message from the specified reader or buffer, length delimited. + * Decodes a FhirStoreSource message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata + * @memberof google.cloud.discoveryengine.v1alpha.FhirStoreSource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata} ImportUserEventsMetadata + * @returns {google.cloud.discoveryengine.v1alpha.FhirStoreSource} FhirStoreSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportUserEventsMetadata.decodeDelimited = function decodeDelimited(reader) { + FhirStoreSource.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ImportUserEventsMetadata message. + * Verifies a FhirStoreSource message. * @function verify - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata + * @memberof google.cloud.discoveryengine.v1alpha.FhirStoreSource * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ImportUserEventsMetadata.verify = function verify(message) { + FhirStoreSource.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.successCount != null && message.hasOwnProperty("successCount")) - if (!$util.isInteger(message.successCount) && !(message.successCount && $util.isInteger(message.successCount.low) && $util.isInteger(message.successCount.high))) - return "successCount: integer|Long expected"; - if (message.failureCount != null && message.hasOwnProperty("failureCount")) - if (!$util.isInteger(message.failureCount) && !(message.failureCount && $util.isInteger(message.failureCount.low) && $util.isInteger(message.failureCount.high))) - return "failureCount: integer|Long expected"; + if (message.fhirStore != null && message.hasOwnProperty("fhirStore")) + if (!$util.isString(message.fhirStore)) + return "fhirStore: string expected"; + if (message.gcsStagingDir != null && message.hasOwnProperty("gcsStagingDir")) + if (!$util.isString(message.gcsStagingDir)) + return "gcsStagingDir: string expected"; return null; }; /** - * Creates an ImportUserEventsMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a FhirStoreSource message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata + * @memberof google.cloud.discoveryengine.v1alpha.FhirStoreSource * @static * @param {Object.} object Plain object - * @returns {google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata} ImportUserEventsMetadata + * @returns {google.cloud.discoveryengine.v1alpha.FhirStoreSource} FhirStoreSource */ - ImportUserEventsMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata) + FhirStoreSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.FhirStoreSource) return object; - var message = new $root.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata(); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.successCount != null) - if ($util.Long) - (message.successCount = $util.Long.fromValue(object.successCount)).unsigned = false; - else if (typeof object.successCount === "string") - message.successCount = parseInt(object.successCount, 10); - else if (typeof object.successCount === "number") - message.successCount = object.successCount; - else if (typeof object.successCount === "object") - message.successCount = new $util.LongBits(object.successCount.low >>> 0, object.successCount.high >>> 0).toNumber(); - if (object.failureCount != null) - if ($util.Long) - (message.failureCount = $util.Long.fromValue(object.failureCount)).unsigned = false; - else if (typeof object.failureCount === "string") - message.failureCount = parseInt(object.failureCount, 10); - else if (typeof object.failureCount === "number") - message.failureCount = object.failureCount; - else if (typeof object.failureCount === "object") - message.failureCount = new $util.LongBits(object.failureCount.low >>> 0, object.failureCount.high >>> 0).toNumber(); + var message = new $root.google.cloud.discoveryengine.v1alpha.FhirStoreSource(); + if (object.fhirStore != null) + message.fhirStore = String(object.fhirStore); + if (object.gcsStagingDir != null) + message.gcsStagingDir = String(object.gcsStagingDir); return message; }; /** - * Creates a plain object from an ImportUserEventsMetadata message. Also converts values to other types if specified. + * Creates a plain object from a FhirStoreSource message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata + * @memberof google.cloud.discoveryengine.v1alpha.FhirStoreSource * @static - * @param {google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata} message ImportUserEventsMetadata + * @param {google.cloud.discoveryengine.v1alpha.FhirStoreSource} message FhirStoreSource * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ImportUserEventsMetadata.toObject = function toObject(message, options) { + FhirStoreSource.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.createTime = null; - object.updateTime = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.successCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.successCount = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.failureCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.failureCount = options.longs === String ? "0" : 0; + object.fhirStore = ""; + object.gcsStagingDir = ""; } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.successCount != null && message.hasOwnProperty("successCount")) - if (typeof message.successCount === "number") - object.successCount = options.longs === String ? String(message.successCount) : message.successCount; - else - object.successCount = options.longs === String ? $util.Long.prototype.toString.call(message.successCount) : options.longs === Number ? new $util.LongBits(message.successCount.low >>> 0, message.successCount.high >>> 0).toNumber() : message.successCount; - if (message.failureCount != null && message.hasOwnProperty("failureCount")) - if (typeof message.failureCount === "number") - object.failureCount = options.longs === String ? String(message.failureCount) : message.failureCount; - else - object.failureCount = options.longs === String ? $util.Long.prototype.toString.call(message.failureCount) : options.longs === Number ? new $util.LongBits(message.failureCount.low >>> 0, message.failureCount.high >>> 0).toNumber() : message.failureCount; + if (message.fhirStore != null && message.hasOwnProperty("fhirStore")) + object.fhirStore = message.fhirStore; + if (message.gcsStagingDir != null && message.hasOwnProperty("gcsStagingDir")) + object.gcsStagingDir = message.gcsStagingDir; return object; }; /** - * Converts this ImportUserEventsMetadata to JSON. + * Converts this FhirStoreSource to JSON. * @function toJSON - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata + * @memberof google.cloud.discoveryengine.v1alpha.FhirStoreSource * @instance * @returns {Object.} JSON object */ - ImportUserEventsMetadata.prototype.toJSON = function toJSON() { + FhirStoreSource.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ImportUserEventsMetadata + * Gets the default type url for FhirStoreSource * @function getTypeUrl - * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata + * @memberof google.cloud.discoveryengine.v1alpha.FhirStoreSource * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ImportUserEventsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FhirStoreSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata"; + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.FhirStoreSource"; }; - return ImportUserEventsMetadata; + return FhirStoreSource; })(); - v1alpha.ImportDocumentsMetadata = (function() { + v1alpha.CloudSqlSource = (function() { /** - * Properties of an ImportDocumentsMetadata. + * Properties of a CloudSqlSource. * @memberof google.cloud.discoveryengine.v1alpha - * @interface IImportDocumentsMetadata - * @property {google.protobuf.ITimestamp|null} [createTime] ImportDocumentsMetadata createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] ImportDocumentsMetadata updateTime - * @property {number|Long|null} [successCount] ImportDocumentsMetadata successCount - * @property {number|Long|null} [failureCount] ImportDocumentsMetadata failureCount + * @interface ICloudSqlSource + * @property {string|null} [projectId] CloudSqlSource projectId + * @property {string|null} [instanceId] CloudSqlSource instanceId + * @property {string|null} [databaseId] CloudSqlSource databaseId + * @property {string|null} [tableId] CloudSqlSource tableId + * @property {string|null} [gcsStagingDir] CloudSqlSource gcsStagingDir + * @property {boolean|null} [offload] CloudSqlSource offload */ /** - * Constructs a new ImportDocumentsMetadata. + * Constructs a new CloudSqlSource. * @memberof google.cloud.discoveryengine.v1alpha - * @classdesc Represents an ImportDocumentsMetadata. - * @implements IImportDocumentsMetadata + * @classdesc Represents a CloudSqlSource. + * @implements ICloudSqlSource * @constructor - * @param {google.cloud.discoveryengine.v1alpha.IImportDocumentsMetadata=} [properties] Properties to set + * @param {google.cloud.discoveryengine.v1alpha.ICloudSqlSource=} [properties] Properties to set */ - function ImportDocumentsMetadata(properties) { + function CloudSqlSource(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -50338,117 +51297,145 @@ } /** - * ImportDocumentsMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata + * CloudSqlSource projectId. + * @member {string} projectId + * @memberof google.cloud.discoveryengine.v1alpha.CloudSqlSource * @instance */ - ImportDocumentsMetadata.prototype.createTime = null; + CloudSqlSource.prototype.projectId = ""; /** - * ImportDocumentsMetadata updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata + * CloudSqlSource instanceId. + * @member {string} instanceId + * @memberof google.cloud.discoveryengine.v1alpha.CloudSqlSource * @instance */ - ImportDocumentsMetadata.prototype.updateTime = null; + CloudSqlSource.prototype.instanceId = ""; /** - * ImportDocumentsMetadata successCount. - * @member {number|Long} successCount - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata + * CloudSqlSource databaseId. + * @member {string} databaseId + * @memberof google.cloud.discoveryengine.v1alpha.CloudSqlSource * @instance */ - ImportDocumentsMetadata.prototype.successCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + CloudSqlSource.prototype.databaseId = ""; /** - * ImportDocumentsMetadata failureCount. - * @member {number|Long} failureCount - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata + * CloudSqlSource tableId. + * @member {string} tableId + * @memberof google.cloud.discoveryengine.v1alpha.CloudSqlSource * @instance */ - ImportDocumentsMetadata.prototype.failureCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + CloudSqlSource.prototype.tableId = ""; /** - * Creates a new ImportDocumentsMetadata instance using the specified properties. + * CloudSqlSource gcsStagingDir. + * @member {string} gcsStagingDir + * @memberof google.cloud.discoveryengine.v1alpha.CloudSqlSource + * @instance + */ + CloudSqlSource.prototype.gcsStagingDir = ""; + + /** + * CloudSqlSource offload. + * @member {boolean} offload + * @memberof google.cloud.discoveryengine.v1alpha.CloudSqlSource + * @instance + */ + CloudSqlSource.prototype.offload = false; + + /** + * Creates a new CloudSqlSource instance using the specified properties. * @function create - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata + * @memberof google.cloud.discoveryengine.v1alpha.CloudSqlSource * @static - * @param {google.cloud.discoveryengine.v1alpha.IImportDocumentsMetadata=} [properties] Properties to set - * @returns {google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata} ImportDocumentsMetadata instance + * @param {google.cloud.discoveryengine.v1alpha.ICloudSqlSource=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.CloudSqlSource} CloudSqlSource instance */ - ImportDocumentsMetadata.create = function create(properties) { - return new ImportDocumentsMetadata(properties); + CloudSqlSource.create = function create(properties) { + return new CloudSqlSource(properties); }; /** - * Encodes the specified ImportDocumentsMetadata message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata.verify|verify} messages. + * Encodes the specified CloudSqlSource message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.CloudSqlSource.verify|verify} messages. * @function encode - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata + * @memberof google.cloud.discoveryengine.v1alpha.CloudSqlSource * @static - * @param {google.cloud.discoveryengine.v1alpha.IImportDocumentsMetadata} message ImportDocumentsMetadata message or plain object to encode + * @param {google.cloud.discoveryengine.v1alpha.ICloudSqlSource} message CloudSqlSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportDocumentsMetadata.encode = function encode(message, writer) { + CloudSqlSource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.successCount != null && Object.hasOwnProperty.call(message, "successCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.successCount); - if (message.failureCount != null && Object.hasOwnProperty.call(message, "failureCount")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.failureCount); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.databaseId); + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.tableId); + if (message.gcsStagingDir != null && Object.hasOwnProperty.call(message, "gcsStagingDir")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.gcsStagingDir); + if (message.offload != null && Object.hasOwnProperty.call(message, "offload")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.offload); return writer; }; /** - * Encodes the specified ImportDocumentsMetadata message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata.verify|verify} messages. + * Encodes the specified CloudSqlSource message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.CloudSqlSource.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata + * @memberof google.cloud.discoveryengine.v1alpha.CloudSqlSource * @static - * @param {google.cloud.discoveryengine.v1alpha.IImportDocumentsMetadata} message ImportDocumentsMetadata message or plain object to encode + * @param {google.cloud.discoveryengine.v1alpha.ICloudSqlSource} message CloudSqlSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportDocumentsMetadata.encodeDelimited = function encodeDelimited(message, writer) { + CloudSqlSource.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ImportDocumentsMetadata message from the specified reader or buffer. + * Decodes a CloudSqlSource message from the specified reader or buffer. * @function decode - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata + * @memberof google.cloud.discoveryengine.v1alpha.CloudSqlSource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata} ImportDocumentsMetadata + * @returns {google.cloud.discoveryengine.v1alpha.CloudSqlSource} CloudSqlSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportDocumentsMetadata.decode = function decode(reader, length) { + CloudSqlSource.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.CloudSqlSource(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.projectId = reader.string(); break; } case 2: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.instanceId = reader.string(); break; } case 3: { - message.successCount = reader.int64(); + message.databaseId = reader.string(); break; } case 4: { - message.failureCount = reader.int64(); + message.tableId = reader.string(); + break; + } + case 5: { + message.gcsStagingDir = reader.string(); + break; + } + case 6: { + message.offload = reader.bool(); break; } default: @@ -50460,192 +51447,166 @@ }; /** - * Decodes an ImportDocumentsMetadata message from the specified reader or buffer, length delimited. + * Decodes a CloudSqlSource message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata + * @memberof google.cloud.discoveryengine.v1alpha.CloudSqlSource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata} ImportDocumentsMetadata + * @returns {google.cloud.discoveryengine.v1alpha.CloudSqlSource} CloudSqlSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportDocumentsMetadata.decodeDelimited = function decodeDelimited(reader) { + CloudSqlSource.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ImportDocumentsMetadata message. + * Verifies a CloudSqlSource message. * @function verify - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata + * @memberof google.cloud.discoveryengine.v1alpha.CloudSqlSource * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ImportDocumentsMetadata.verify = function verify(message) { + CloudSqlSource.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.successCount != null && message.hasOwnProperty("successCount")) - if (!$util.isInteger(message.successCount) && !(message.successCount && $util.isInteger(message.successCount.low) && $util.isInteger(message.successCount.high))) - return "successCount: integer|Long expected"; - if (message.failureCount != null && message.hasOwnProperty("failureCount")) - if (!$util.isInteger(message.failureCount) && !(message.failureCount && $util.isInteger(message.failureCount.low) && $util.isInteger(message.failureCount.high))) - return "failureCount: integer|Long expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (!$util.isString(message.databaseId)) + return "databaseId: string expected"; + if (message.tableId != null && message.hasOwnProperty("tableId")) + if (!$util.isString(message.tableId)) + return "tableId: string expected"; + if (message.gcsStagingDir != null && message.hasOwnProperty("gcsStagingDir")) + if (!$util.isString(message.gcsStagingDir)) + return "gcsStagingDir: string expected"; + if (message.offload != null && message.hasOwnProperty("offload")) + if (typeof message.offload !== "boolean") + return "offload: boolean expected"; return null; }; /** - * Creates an ImportDocumentsMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a CloudSqlSource message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata + * @memberof google.cloud.discoveryengine.v1alpha.CloudSqlSource * @static * @param {Object.} object Plain object - * @returns {google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata} ImportDocumentsMetadata + * @returns {google.cloud.discoveryengine.v1alpha.CloudSqlSource} CloudSqlSource */ - ImportDocumentsMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata) + CloudSqlSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.CloudSqlSource) return object; - var message = new $root.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata(); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.successCount != null) - if ($util.Long) - (message.successCount = $util.Long.fromValue(object.successCount)).unsigned = false; - else if (typeof object.successCount === "string") - message.successCount = parseInt(object.successCount, 10); - else if (typeof object.successCount === "number") - message.successCount = object.successCount; - else if (typeof object.successCount === "object") - message.successCount = new $util.LongBits(object.successCount.low >>> 0, object.successCount.high >>> 0).toNumber(); - if (object.failureCount != null) - if ($util.Long) - (message.failureCount = $util.Long.fromValue(object.failureCount)).unsigned = false; - else if (typeof object.failureCount === "string") - message.failureCount = parseInt(object.failureCount, 10); - else if (typeof object.failureCount === "number") - message.failureCount = object.failureCount; - else if (typeof object.failureCount === "object") - message.failureCount = new $util.LongBits(object.failureCount.low >>> 0, object.failureCount.high >>> 0).toNumber(); + var message = new $root.google.cloud.discoveryengine.v1alpha.CloudSqlSource(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.databaseId != null) + message.databaseId = String(object.databaseId); + if (object.tableId != null) + message.tableId = String(object.tableId); + if (object.gcsStagingDir != null) + message.gcsStagingDir = String(object.gcsStagingDir); + if (object.offload != null) + message.offload = Boolean(object.offload); return message; }; /** - * Creates a plain object from an ImportDocumentsMetadata message. Also converts values to other types if specified. + * Creates a plain object from a CloudSqlSource message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata + * @memberof google.cloud.discoveryengine.v1alpha.CloudSqlSource * @static - * @param {google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata} message ImportDocumentsMetadata + * @param {google.cloud.discoveryengine.v1alpha.CloudSqlSource} message CloudSqlSource * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ImportDocumentsMetadata.toObject = function toObject(message, options) { + CloudSqlSource.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.createTime = null; - object.updateTime = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.successCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.successCount = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.failureCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.failureCount = options.longs === String ? "0" : 0; + object.projectId = ""; + object.instanceId = ""; + object.databaseId = ""; + object.tableId = ""; + object.gcsStagingDir = ""; + object.offload = false; } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.successCount != null && message.hasOwnProperty("successCount")) - if (typeof message.successCount === "number") - object.successCount = options.longs === String ? String(message.successCount) : message.successCount; - else - object.successCount = options.longs === String ? $util.Long.prototype.toString.call(message.successCount) : options.longs === Number ? new $util.LongBits(message.successCount.low >>> 0, message.successCount.high >>> 0).toNumber() : message.successCount; - if (message.failureCount != null && message.hasOwnProperty("failureCount")) - if (typeof message.failureCount === "number") - object.failureCount = options.longs === String ? String(message.failureCount) : message.failureCount; - else - object.failureCount = options.longs === String ? $util.Long.prototype.toString.call(message.failureCount) : options.longs === Number ? new $util.LongBits(message.failureCount.low >>> 0, message.failureCount.high >>> 0).toNumber() : message.failureCount; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + object.databaseId = message.databaseId; + if (message.tableId != null && message.hasOwnProperty("tableId")) + object.tableId = message.tableId; + if (message.gcsStagingDir != null && message.hasOwnProperty("gcsStagingDir")) + object.gcsStagingDir = message.gcsStagingDir; + if (message.offload != null && message.hasOwnProperty("offload")) + object.offload = message.offload; return object; }; /** - * Converts this ImportDocumentsMetadata to JSON. + * Converts this CloudSqlSource to JSON. * @function toJSON - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata + * @memberof google.cloud.discoveryengine.v1alpha.CloudSqlSource * @instance * @returns {Object.} JSON object */ - ImportDocumentsMetadata.prototype.toJSON = function toJSON() { + CloudSqlSource.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ImportDocumentsMetadata + * Gets the default type url for CloudSqlSource * @function getTypeUrl - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata + * @memberof google.cloud.discoveryengine.v1alpha.CloudSqlSource * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ImportDocumentsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CloudSqlSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata"; + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.CloudSqlSource"; }; - return ImportDocumentsMetadata; + return CloudSqlSource; })(); - v1alpha.ImportDocumentsRequest = (function() { + v1alpha.FirestoreSource = (function() { /** - * Properties of an ImportDocumentsRequest. + * Properties of a FirestoreSource. * @memberof google.cloud.discoveryengine.v1alpha - * @interface IImportDocumentsRequest - * @property {google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.IInlineSource|null} [inlineSource] ImportDocumentsRequest inlineSource - * @property {google.cloud.discoveryengine.v1alpha.IGcsSource|null} [gcsSource] ImportDocumentsRequest gcsSource - * @property {google.cloud.discoveryengine.v1alpha.IBigQuerySource|null} [bigquerySource] ImportDocumentsRequest bigquerySource - * @property {string|null} [parent] ImportDocumentsRequest parent - * @property {google.cloud.discoveryengine.v1alpha.IImportErrorConfig|null} [errorConfig] ImportDocumentsRequest errorConfig - * @property {google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode|null} [reconciliationMode] ImportDocumentsRequest reconciliationMode - * @property {boolean|null} [autoGenerateIds] ImportDocumentsRequest autoGenerateIds - * @property {string|null} [idField] ImportDocumentsRequest idField + * @interface IFirestoreSource + * @property {string|null} [projectId] FirestoreSource projectId + * @property {string|null} [databaseId] FirestoreSource databaseId + * @property {string|null} [collectionId] FirestoreSource collectionId + * @property {string|null} [gcsStagingDir] FirestoreSource gcsStagingDir */ /** - * Constructs a new ImportDocumentsRequest. + * Constructs a new FirestoreSource. * @memberof google.cloud.discoveryengine.v1alpha - * @classdesc Represents an ImportDocumentsRequest. - * @implements IImportDocumentsRequest + * @classdesc Represents a FirestoreSource. + * @implements IFirestoreSource * @constructor - * @param {google.cloud.discoveryengine.v1alpha.IImportDocumentsRequest=} [properties] Properties to set + * @param {google.cloud.discoveryengine.v1alpha.IFirestoreSource=} [properties] Properties to set */ - function ImportDocumentsRequest(properties) { + function FirestoreSource(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -50653,187 +51614,117 @@ } /** - * ImportDocumentsRequest inlineSource. - * @member {google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.IInlineSource|null|undefined} inlineSource - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest - * @instance - */ - ImportDocumentsRequest.prototype.inlineSource = null; - - /** - * ImportDocumentsRequest gcsSource. - * @member {google.cloud.discoveryengine.v1alpha.IGcsSource|null|undefined} gcsSource - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest - * @instance - */ - ImportDocumentsRequest.prototype.gcsSource = null; - - /** - * ImportDocumentsRequest bigquerySource. - * @member {google.cloud.discoveryengine.v1alpha.IBigQuerySource|null|undefined} bigquerySource - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest - * @instance - */ - ImportDocumentsRequest.prototype.bigquerySource = null; - - /** - * ImportDocumentsRequest parent. - * @member {string} parent - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest - * @instance - */ - ImportDocumentsRequest.prototype.parent = ""; - - /** - * ImportDocumentsRequest errorConfig. - * @member {google.cloud.discoveryengine.v1alpha.IImportErrorConfig|null|undefined} errorConfig - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest - * @instance - */ - ImportDocumentsRequest.prototype.errorConfig = null; - - /** - * ImportDocumentsRequest reconciliationMode. - * @member {google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode} reconciliationMode - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * FirestoreSource projectId. + * @member {string} projectId + * @memberof google.cloud.discoveryengine.v1alpha.FirestoreSource * @instance */ - ImportDocumentsRequest.prototype.reconciliationMode = 0; + FirestoreSource.prototype.projectId = ""; /** - * ImportDocumentsRequest autoGenerateIds. - * @member {boolean} autoGenerateIds - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * FirestoreSource databaseId. + * @member {string} databaseId + * @memberof google.cloud.discoveryengine.v1alpha.FirestoreSource * @instance */ - ImportDocumentsRequest.prototype.autoGenerateIds = false; + FirestoreSource.prototype.databaseId = ""; /** - * ImportDocumentsRequest idField. - * @member {string} idField - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * FirestoreSource collectionId. + * @member {string} collectionId + * @memberof google.cloud.discoveryengine.v1alpha.FirestoreSource * @instance */ - ImportDocumentsRequest.prototype.idField = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + FirestoreSource.prototype.collectionId = ""; /** - * ImportDocumentsRequest source. - * @member {"inlineSource"|"gcsSource"|"bigquerySource"|undefined} source - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * FirestoreSource gcsStagingDir. + * @member {string} gcsStagingDir + * @memberof google.cloud.discoveryengine.v1alpha.FirestoreSource * @instance */ - Object.defineProperty(ImportDocumentsRequest.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["inlineSource", "gcsSource", "bigquerySource"]), - set: $util.oneOfSetter($oneOfFields) - }); + FirestoreSource.prototype.gcsStagingDir = ""; /** - * Creates a new ImportDocumentsRequest instance using the specified properties. + * Creates a new FirestoreSource instance using the specified properties. * @function create - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * @memberof google.cloud.discoveryengine.v1alpha.FirestoreSource * @static - * @param {google.cloud.discoveryengine.v1alpha.IImportDocumentsRequest=} [properties] Properties to set - * @returns {google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest} ImportDocumentsRequest instance + * @param {google.cloud.discoveryengine.v1alpha.IFirestoreSource=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.FirestoreSource} FirestoreSource instance */ - ImportDocumentsRequest.create = function create(properties) { - return new ImportDocumentsRequest(properties); + FirestoreSource.create = function create(properties) { + return new FirestoreSource(properties); }; /** - * Encodes the specified ImportDocumentsRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.verify|verify} messages. + * Encodes the specified FirestoreSource message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.FirestoreSource.verify|verify} messages. * @function encode - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * @memberof google.cloud.discoveryengine.v1alpha.FirestoreSource * @static - * @param {google.cloud.discoveryengine.v1alpha.IImportDocumentsRequest} message ImportDocumentsRequest message or plain object to encode + * @param {google.cloud.discoveryengine.v1alpha.IFirestoreSource} message FirestoreSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportDocumentsRequest.encode = function encode(message, writer) { + FirestoreSource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.inlineSource != null && Object.hasOwnProperty.call(message, "inlineSource")) - $root.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource.encode(message.inlineSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) - $root.google.cloud.discoveryengine.v1alpha.GcsSource.encode(message.gcsSource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.bigquerySource != null && Object.hasOwnProperty.call(message, "bigquerySource")) - $root.google.cloud.discoveryengine.v1alpha.BigQuerySource.encode(message.bigquerySource, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.errorConfig != null && Object.hasOwnProperty.call(message, "errorConfig")) - $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.encode(message.errorConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.reconciliationMode != null && Object.hasOwnProperty.call(message, "reconciliationMode")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.reconciliationMode); - if (message.autoGenerateIds != null && Object.hasOwnProperty.call(message, "autoGenerateIds")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.autoGenerateIds); - if (message.idField != null && Object.hasOwnProperty.call(message, "idField")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.idField); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.databaseId); + if (message.collectionId != null && Object.hasOwnProperty.call(message, "collectionId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.collectionId); + if (message.gcsStagingDir != null && Object.hasOwnProperty.call(message, "gcsStagingDir")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.gcsStagingDir); return writer; }; /** - * Encodes the specified ImportDocumentsRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.verify|verify} messages. + * Encodes the specified FirestoreSource message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.FirestoreSource.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * @memberof google.cloud.discoveryengine.v1alpha.FirestoreSource * @static - * @param {google.cloud.discoveryengine.v1alpha.IImportDocumentsRequest} message ImportDocumentsRequest message or plain object to encode + * @param {google.cloud.discoveryengine.v1alpha.IFirestoreSource} message FirestoreSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportDocumentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + FirestoreSource.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ImportDocumentsRequest message from the specified reader or buffer. + * Decodes a FirestoreSource message from the specified reader or buffer. * @function decode - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * @memberof google.cloud.discoveryengine.v1alpha.FirestoreSource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest} ImportDocumentsRequest + * @returns {google.cloud.discoveryengine.v1alpha.FirestoreSource} FirestoreSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportDocumentsRequest.decode = function decode(reader, length) { + FirestoreSource.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.FirestoreSource(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: { - message.inlineSource = $root.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource.decode(reader, reader.uint32()); - break; - } - case 3: { - message.gcsSource = $root.google.cloud.discoveryengine.v1alpha.GcsSource.decode(reader, reader.uint32()); - break; - } - case 4: { - message.bigquerySource = $root.google.cloud.discoveryengine.v1alpha.BigQuerySource.decode(reader, reader.uint32()); - break; - } case 1: { - message.parent = reader.string(); - break; - } - case 5: { - message.errorConfig = $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.decode(reader, reader.uint32()); + message.projectId = reader.string(); break; } - case 6: { - message.reconciliationMode = reader.int32(); + case 2: { + message.databaseId = reader.string(); break; } - case 8: { - message.autoGenerateIds = reader.bool(); + case 3: { + message.collectionId = reader.string(); break; } - case 9: { - message.idField = reader.string(); + case 4: { + message.gcsStagingDir = reader.string(); break; } default: @@ -50845,485 +51736,147 @@ }; /** - * Decodes an ImportDocumentsRequest message from the specified reader or buffer, length delimited. + * Decodes a FirestoreSource message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * @memberof google.cloud.discoveryengine.v1alpha.FirestoreSource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest} ImportDocumentsRequest + * @returns {google.cloud.discoveryengine.v1alpha.FirestoreSource} FirestoreSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportDocumentsRequest.decodeDelimited = function decodeDelimited(reader) { + FirestoreSource.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ImportDocumentsRequest message. + * Verifies a FirestoreSource message. * @function verify - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * @memberof google.cloud.discoveryengine.v1alpha.FirestoreSource * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ImportDocumentsRequest.verify = function verify(message) { + FirestoreSource.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.inlineSource != null && message.hasOwnProperty("inlineSource")) { - properties.source = 1; - { - var error = $root.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource.verify(message.inlineSource); - if (error) - return "inlineSource." + error; - } - } - if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.discoveryengine.v1alpha.GcsSource.verify(message.gcsSource); - if (error) - return "gcsSource." + error; - } - } - if (message.bigquerySource != null && message.hasOwnProperty("bigquerySource")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.discoveryengine.v1alpha.BigQuerySource.verify(message.bigquerySource); - if (error) - return "bigquerySource." + error; - } - } - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.errorConfig != null && message.hasOwnProperty("errorConfig")) { - var error = $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.verify(message.errorConfig); - if (error) - return "errorConfig." + error; - } - if (message.reconciliationMode != null && message.hasOwnProperty("reconciliationMode")) - switch (message.reconciliationMode) { - default: - return "reconciliationMode: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.autoGenerateIds != null && message.hasOwnProperty("autoGenerateIds")) - if (typeof message.autoGenerateIds !== "boolean") - return "autoGenerateIds: boolean expected"; - if (message.idField != null && message.hasOwnProperty("idField")) - if (!$util.isString(message.idField)) - return "idField: string expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (!$util.isString(message.databaseId)) + return "databaseId: string expected"; + if (message.collectionId != null && message.hasOwnProperty("collectionId")) + if (!$util.isString(message.collectionId)) + return "collectionId: string expected"; + if (message.gcsStagingDir != null && message.hasOwnProperty("gcsStagingDir")) + if (!$util.isString(message.gcsStagingDir)) + return "gcsStagingDir: string expected"; return null; }; /** - * Creates an ImportDocumentsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a FirestoreSource message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * @memberof google.cloud.discoveryengine.v1alpha.FirestoreSource * @static * @param {Object.} object Plain object - * @returns {google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest} ImportDocumentsRequest + * @returns {google.cloud.discoveryengine.v1alpha.FirestoreSource} FirestoreSource */ - ImportDocumentsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest) + FirestoreSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.FirestoreSource) return object; - var message = new $root.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest(); - if (object.inlineSource != null) { - if (typeof object.inlineSource !== "object") - throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.inlineSource: object expected"); - message.inlineSource = $root.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource.fromObject(object.inlineSource); - } - if (object.gcsSource != null) { - if (typeof object.gcsSource !== "object") - throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.gcsSource: object expected"); - message.gcsSource = $root.google.cloud.discoveryengine.v1alpha.GcsSource.fromObject(object.gcsSource); - } - if (object.bigquerySource != null) { - if (typeof object.bigquerySource !== "object") - throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.bigquerySource: object expected"); - message.bigquerySource = $root.google.cloud.discoveryengine.v1alpha.BigQuerySource.fromObject(object.bigquerySource); - } - if (object.parent != null) - message.parent = String(object.parent); - if (object.errorConfig != null) { - if (typeof object.errorConfig !== "object") - throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.errorConfig: object expected"); - message.errorConfig = $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.fromObject(object.errorConfig); - } - switch (object.reconciliationMode) { - default: - if (typeof object.reconciliationMode === "number") { - message.reconciliationMode = object.reconciliationMode; - break; - } - break; - case "RECONCILIATION_MODE_UNSPECIFIED": - case 0: - message.reconciliationMode = 0; - break; - case "INCREMENTAL": - case 1: - message.reconciliationMode = 1; - break; - case "FULL": - case 2: - message.reconciliationMode = 2; - break; - } - if (object.autoGenerateIds != null) - message.autoGenerateIds = Boolean(object.autoGenerateIds); - if (object.idField != null) - message.idField = String(object.idField); + var message = new $root.google.cloud.discoveryengine.v1alpha.FirestoreSource(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.databaseId != null) + message.databaseId = String(object.databaseId); + if (object.collectionId != null) + message.collectionId = String(object.collectionId); + if (object.gcsStagingDir != null) + message.gcsStagingDir = String(object.gcsStagingDir); return message; }; /** - * Creates a plain object from an ImportDocumentsRequest message. Also converts values to other types if specified. + * Creates a plain object from a FirestoreSource message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * @memberof google.cloud.discoveryengine.v1alpha.FirestoreSource * @static - * @param {google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest} message ImportDocumentsRequest + * @param {google.cloud.discoveryengine.v1alpha.FirestoreSource} message FirestoreSource * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ImportDocumentsRequest.toObject = function toObject(message, options) { + FirestoreSource.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.errorConfig = null; - object.reconciliationMode = options.enums === String ? "RECONCILIATION_MODE_UNSPECIFIED" : 0; - object.autoGenerateIds = false; - object.idField = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.inlineSource != null && message.hasOwnProperty("inlineSource")) { - object.inlineSource = $root.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource.toObject(message.inlineSource, options); - if (options.oneofs) - object.source = "inlineSource"; - } - if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { - object.gcsSource = $root.google.cloud.discoveryengine.v1alpha.GcsSource.toObject(message.gcsSource, options); - if (options.oneofs) - object.source = "gcsSource"; - } - if (message.bigquerySource != null && message.hasOwnProperty("bigquerySource")) { - object.bigquerySource = $root.google.cloud.discoveryengine.v1alpha.BigQuerySource.toObject(message.bigquerySource, options); - if (options.oneofs) - object.source = "bigquerySource"; + object.projectId = ""; + object.databaseId = ""; + object.collectionId = ""; + object.gcsStagingDir = ""; } - if (message.errorConfig != null && message.hasOwnProperty("errorConfig")) - object.errorConfig = $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.toObject(message.errorConfig, options); - if (message.reconciliationMode != null && message.hasOwnProperty("reconciliationMode")) - object.reconciliationMode = options.enums === String ? $root.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode[message.reconciliationMode] === undefined ? message.reconciliationMode : $root.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode[message.reconciliationMode] : message.reconciliationMode; - if (message.autoGenerateIds != null && message.hasOwnProperty("autoGenerateIds")) - object.autoGenerateIds = message.autoGenerateIds; - if (message.idField != null && message.hasOwnProperty("idField")) - object.idField = message.idField; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + object.databaseId = message.databaseId; + if (message.collectionId != null && message.hasOwnProperty("collectionId")) + object.collectionId = message.collectionId; + if (message.gcsStagingDir != null && message.hasOwnProperty("gcsStagingDir")) + object.gcsStagingDir = message.gcsStagingDir; return object; }; /** - * Converts this ImportDocumentsRequest to JSON. + * Converts this FirestoreSource to JSON. * @function toJSON - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * @memberof google.cloud.discoveryengine.v1alpha.FirestoreSource * @instance * @returns {Object.} JSON object */ - ImportDocumentsRequest.prototype.toJSON = function toJSON() { + FirestoreSource.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ImportDocumentsRequest + * Gets the default type url for FirestoreSource * @function getTypeUrl - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * @memberof google.cloud.discoveryengine.v1alpha.FirestoreSource * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ImportDocumentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FirestoreSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest"; + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.FirestoreSource"; }; - ImportDocumentsRequest.InlineSource = (function() { - - /** - * Properties of an InlineSource. - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest - * @interface IInlineSource - * @property {Array.|null} [documents] InlineSource documents - */ - - /** - * Constructs a new InlineSource. - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest - * @classdesc Represents an InlineSource. - * @implements IInlineSource - * @constructor - * @param {google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.IInlineSource=} [properties] Properties to set - */ - function InlineSource(properties) { - this.documents = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InlineSource documents. - * @member {Array.} documents - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource - * @instance - */ - InlineSource.prototype.documents = $util.emptyArray; - - /** - * Creates a new InlineSource instance using the specified properties. - * @function create - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource - * @static - * @param {google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.IInlineSource=} [properties] Properties to set - * @returns {google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource} InlineSource instance - */ - InlineSource.create = function create(properties) { - return new InlineSource(properties); - }; - - /** - * Encodes the specified InlineSource message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource.verify|verify} messages. - * @function encode - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource - * @static - * @param {google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.IInlineSource} message InlineSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InlineSource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.documents != null && message.documents.length) - for (var i = 0; i < message.documents.length; ++i) - $root.google.cloud.discoveryengine.v1alpha.Document.encode(message.documents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified InlineSource message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource - * @static - * @param {google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.IInlineSource} message InlineSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InlineSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InlineSource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource} InlineSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InlineSource.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.documents && message.documents.length)) - message.documents = []; - message.documents.push($root.google.cloud.discoveryengine.v1alpha.Document.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InlineSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource} InlineSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InlineSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InlineSource message. - * @function verify - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InlineSource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.documents != null && message.hasOwnProperty("documents")) { - if (!Array.isArray(message.documents)) - return "documents: array expected"; - for (var i = 0; i < message.documents.length; ++i) { - var error = $root.google.cloud.discoveryengine.v1alpha.Document.verify(message.documents[i]); - if (error) - return "documents." + error; - } - } - return null; - }; - - /** - * Creates an InlineSource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource} InlineSource - */ - InlineSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource) - return object; - var message = new $root.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource(); - if (object.documents) { - if (!Array.isArray(object.documents)) - throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource.documents: array expected"); - message.documents = []; - for (var i = 0; i < object.documents.length; ++i) { - if (typeof object.documents[i] !== "object") - throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource.documents: object expected"); - message.documents[i] = $root.google.cloud.discoveryengine.v1alpha.Document.fromObject(object.documents[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an InlineSource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource - * @static - * @param {google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource} message InlineSource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InlineSource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.documents = []; - if (message.documents && message.documents.length) { - object.documents = []; - for (var j = 0; j < message.documents.length; ++j) - object.documents[j] = $root.google.cloud.discoveryengine.v1alpha.Document.toObject(message.documents[j], options); - } - return object; - }; - - /** - * Converts this InlineSource to JSON. - * @function toJSON - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource - * @instance - * @returns {Object.} JSON object - */ - InlineSource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InlineSource - * @function getTypeUrl - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InlineSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource"; - }; - - return InlineSource; - })(); - - /** - * ReconciliationMode enum. - * @name google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode - * @enum {number} - * @property {number} RECONCILIATION_MODE_UNSPECIFIED=0 RECONCILIATION_MODE_UNSPECIFIED value - * @property {number} INCREMENTAL=1 INCREMENTAL value - * @property {number} FULL=2 FULL value - */ - ImportDocumentsRequest.ReconciliationMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RECONCILIATION_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "INCREMENTAL"] = 1; - values[valuesById[2] = "FULL"] = 2; - return values; - })(); - - return ImportDocumentsRequest; + return FirestoreSource; })(); - v1alpha.ImportDocumentsResponse = (function() { + v1alpha.ImportErrorConfig = (function() { /** - * Properties of an ImportDocumentsResponse. + * Properties of an ImportErrorConfig. * @memberof google.cloud.discoveryengine.v1alpha - * @interface IImportDocumentsResponse - * @property {Array.|null} [errorSamples] ImportDocumentsResponse errorSamples - * @property {google.cloud.discoveryengine.v1alpha.IImportErrorConfig|null} [errorConfig] ImportDocumentsResponse errorConfig + * @interface IImportErrorConfig + * @property {string|null} [gcsPrefix] ImportErrorConfig gcsPrefix */ /** - * Constructs a new ImportDocumentsResponse. + * Constructs a new ImportErrorConfig. * @memberof google.cloud.discoveryengine.v1alpha - * @classdesc Represents an ImportDocumentsResponse. - * @implements IImportDocumentsResponse + * @classdesc Represents an ImportErrorConfig. + * @implements IImportErrorConfig * @constructor - * @param {google.cloud.discoveryengine.v1alpha.IImportDocumentsResponse=} [properties] Properties to set + * @param {google.cloud.discoveryengine.v1alpha.IImportErrorConfig=} [properties] Properties to set */ - function ImportDocumentsResponse(properties) { - this.errorSamples = []; + function ImportErrorConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -51331,92 +51884,89 @@ } /** - * ImportDocumentsResponse errorSamples. - * @member {Array.} errorSamples - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse + * ImportErrorConfig gcsPrefix. + * @member {string|null|undefined} gcsPrefix + * @memberof google.cloud.discoveryengine.v1alpha.ImportErrorConfig * @instance */ - ImportDocumentsResponse.prototype.errorSamples = $util.emptyArray; + ImportErrorConfig.prototype.gcsPrefix = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * ImportDocumentsResponse errorConfig. - * @member {google.cloud.discoveryengine.v1alpha.IImportErrorConfig|null|undefined} errorConfig - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse + * ImportErrorConfig destination. + * @member {"gcsPrefix"|undefined} destination + * @memberof google.cloud.discoveryengine.v1alpha.ImportErrorConfig * @instance */ - ImportDocumentsResponse.prototype.errorConfig = null; + Object.defineProperty(ImportErrorConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsPrefix"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new ImportDocumentsResponse instance using the specified properties. + * Creates a new ImportErrorConfig instance using the specified properties. * @function create - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse + * @memberof google.cloud.discoveryengine.v1alpha.ImportErrorConfig * @static - * @param {google.cloud.discoveryengine.v1alpha.IImportDocumentsResponse=} [properties] Properties to set - * @returns {google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse} ImportDocumentsResponse instance + * @param {google.cloud.discoveryengine.v1alpha.IImportErrorConfig=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.ImportErrorConfig} ImportErrorConfig instance */ - ImportDocumentsResponse.create = function create(properties) { - return new ImportDocumentsResponse(properties); + ImportErrorConfig.create = function create(properties) { + return new ImportErrorConfig(properties); }; /** - * Encodes the specified ImportDocumentsResponse message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse.verify|verify} messages. + * Encodes the specified ImportErrorConfig message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportErrorConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse + * @memberof google.cloud.discoveryengine.v1alpha.ImportErrorConfig * @static - * @param {google.cloud.discoveryengine.v1alpha.IImportDocumentsResponse} message ImportDocumentsResponse message or plain object to encode + * @param {google.cloud.discoveryengine.v1alpha.IImportErrorConfig} message ImportErrorConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportDocumentsResponse.encode = function encode(message, writer) { + ImportErrorConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.errorSamples != null && message.errorSamples.length) - for (var i = 0; i < message.errorSamples.length; ++i) - $root.google.rpc.Status.encode(message.errorSamples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.errorConfig != null && Object.hasOwnProperty.call(message, "errorConfig")) - $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.encode(message.errorConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.gcsPrefix != null && Object.hasOwnProperty.call(message, "gcsPrefix")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsPrefix); return writer; }; /** - * Encodes the specified ImportDocumentsResponse message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse.verify|verify} messages. + * Encodes the specified ImportErrorConfig message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportErrorConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse + * @memberof google.cloud.discoveryengine.v1alpha.ImportErrorConfig * @static - * @param {google.cloud.discoveryengine.v1alpha.IImportDocumentsResponse} message ImportDocumentsResponse message or plain object to encode + * @param {google.cloud.discoveryengine.v1alpha.IImportErrorConfig} message ImportErrorConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportDocumentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + ImportErrorConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ImportDocumentsResponse message from the specified reader or buffer. + * Decodes an ImportErrorConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse + * @memberof google.cloud.discoveryengine.v1alpha.ImportErrorConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse} ImportDocumentsResponse + * @returns {google.cloud.discoveryengine.v1alpha.ImportErrorConfig} ImportErrorConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportDocumentsResponse.decode = function decode(reader, length) { + ImportErrorConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.errorSamples && message.errorSamples.length)) - message.errorSamples = []; - message.errorSamples.push($root.google.rpc.Status.decode(reader, reader.uint32())); - break; - } - case 2: { - message.errorConfig = $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.decode(reader, reader.uint32()); + message.gcsPrefix = reader.string(); break; } default: @@ -51428,155 +51978,130 @@ }; /** - * Decodes an ImportDocumentsResponse message from the specified reader or buffer, length delimited. + * Decodes an ImportErrorConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse + * @memberof google.cloud.discoveryengine.v1alpha.ImportErrorConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse} ImportDocumentsResponse + * @returns {google.cloud.discoveryengine.v1alpha.ImportErrorConfig} ImportErrorConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportDocumentsResponse.decodeDelimited = function decodeDelimited(reader) { + ImportErrorConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ImportDocumentsResponse message. + * Verifies an ImportErrorConfig message. * @function verify - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse + * @memberof google.cloud.discoveryengine.v1alpha.ImportErrorConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ImportDocumentsResponse.verify = function verify(message) { + ImportErrorConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.errorSamples != null && message.hasOwnProperty("errorSamples")) { - if (!Array.isArray(message.errorSamples)) - return "errorSamples: array expected"; - for (var i = 0; i < message.errorSamples.length; ++i) { - var error = $root.google.rpc.Status.verify(message.errorSamples[i]); - if (error) - return "errorSamples." + error; - } - } - if (message.errorConfig != null && message.hasOwnProperty("errorConfig")) { - var error = $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.verify(message.errorConfig); - if (error) - return "errorConfig." + error; + var properties = {}; + if (message.gcsPrefix != null && message.hasOwnProperty("gcsPrefix")) { + properties.destination = 1; + if (!$util.isString(message.gcsPrefix)) + return "gcsPrefix: string expected"; } return null; }; /** - * Creates an ImportDocumentsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an ImportErrorConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse + * @memberof google.cloud.discoveryengine.v1alpha.ImportErrorConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse} ImportDocumentsResponse + * @returns {google.cloud.discoveryengine.v1alpha.ImportErrorConfig} ImportErrorConfig */ - ImportDocumentsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse) + ImportErrorConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig) return object; - var message = new $root.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse(); - if (object.errorSamples) { - if (!Array.isArray(object.errorSamples)) - throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse.errorSamples: array expected"); - message.errorSamples = []; - for (var i = 0; i < object.errorSamples.length; ++i) { - if (typeof object.errorSamples[i] !== "object") - throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse.errorSamples: object expected"); - message.errorSamples[i] = $root.google.rpc.Status.fromObject(object.errorSamples[i]); - } - } - if (object.errorConfig != null) { - if (typeof object.errorConfig !== "object") - throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse.errorConfig: object expected"); - message.errorConfig = $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.fromObject(object.errorConfig); - } + var message = new $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig(); + if (object.gcsPrefix != null) + message.gcsPrefix = String(object.gcsPrefix); return message; }; /** - * Creates a plain object from an ImportDocumentsResponse message. Also converts values to other types if specified. + * Creates a plain object from an ImportErrorConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse + * @memberof google.cloud.discoveryengine.v1alpha.ImportErrorConfig * @static - * @param {google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse} message ImportDocumentsResponse + * @param {google.cloud.discoveryengine.v1alpha.ImportErrorConfig} message ImportErrorConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ImportDocumentsResponse.toObject = function toObject(message, options) { + ImportErrorConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.errorSamples = []; - if (options.defaults) - object.errorConfig = null; - if (message.errorSamples && message.errorSamples.length) { - object.errorSamples = []; - for (var j = 0; j < message.errorSamples.length; ++j) - object.errorSamples[j] = $root.google.rpc.Status.toObject(message.errorSamples[j], options); + if (message.gcsPrefix != null && message.hasOwnProperty("gcsPrefix")) { + object.gcsPrefix = message.gcsPrefix; + if (options.oneofs) + object.destination = "gcsPrefix"; } - if (message.errorConfig != null && message.hasOwnProperty("errorConfig")) - object.errorConfig = $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.toObject(message.errorConfig, options); return object; }; /** - * Converts this ImportDocumentsResponse to JSON. + * Converts this ImportErrorConfig to JSON. * @function toJSON - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse + * @memberof google.cloud.discoveryengine.v1alpha.ImportErrorConfig * @instance * @returns {Object.} JSON object */ - ImportDocumentsResponse.prototype.toJSON = function toJSON() { + ImportErrorConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ImportDocumentsResponse + * Gets the default type url for ImportErrorConfig * @function getTypeUrl - * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse + * @memberof google.cloud.discoveryengine.v1alpha.ImportErrorConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ImportDocumentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ImportErrorConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse"; + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.ImportErrorConfig"; }; - return ImportDocumentsResponse; + return ImportErrorConfig; })(); - v1alpha.ImportSuggestionDenyListEntriesRequest = (function() { + v1alpha.ImportUserEventsRequest = (function() { /** - * Properties of an ImportSuggestionDenyListEntriesRequest. + * Properties of an ImportUserEventsRequest. * @memberof google.cloud.discoveryengine.v1alpha - * @interface IImportSuggestionDenyListEntriesRequest - * @property {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.IInlineSource|null} [inlineSource] ImportSuggestionDenyListEntriesRequest inlineSource - * @property {google.cloud.discoveryengine.v1alpha.IGcsSource|null} [gcsSource] ImportSuggestionDenyListEntriesRequest gcsSource - * @property {string|null} [parent] ImportSuggestionDenyListEntriesRequest parent + * @interface IImportUserEventsRequest + * @property {google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.IInlineSource|null} [inlineSource] ImportUserEventsRequest inlineSource + * @property {google.cloud.discoveryengine.v1alpha.IGcsSource|null} [gcsSource] ImportUserEventsRequest gcsSource + * @property {google.cloud.discoveryengine.v1alpha.IBigQuerySource|null} [bigquerySource] ImportUserEventsRequest bigquerySource + * @property {string|null} [parent] ImportUserEventsRequest parent + * @property {google.cloud.discoveryengine.v1alpha.IImportErrorConfig|null} [errorConfig] ImportUserEventsRequest errorConfig */ /** - * Constructs a new ImportSuggestionDenyListEntriesRequest. + * Constructs a new ImportUserEventsRequest. * @memberof google.cloud.discoveryengine.v1alpha - * @classdesc Represents an ImportSuggestionDenyListEntriesRequest. - * @implements IImportSuggestionDenyListEntriesRequest + * @classdesc Represents an ImportUserEventsRequest. + * @implements IImportUserEventsRequest * @constructor - * @param {google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesRequest=} [properties] Properties to set + * @param {google.cloud.discoveryengine.v1alpha.IImportUserEventsRequest=} [properties] Properties to set */ - function ImportSuggestionDenyListEntriesRequest(properties) { + function ImportUserEventsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -51584,119 +52109,147 @@ } /** - * ImportSuggestionDenyListEntriesRequest inlineSource. - * @member {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.IInlineSource|null|undefined} inlineSource - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest + * ImportUserEventsRequest inlineSource. + * @member {google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.IInlineSource|null|undefined} inlineSource + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest * @instance */ - ImportSuggestionDenyListEntriesRequest.prototype.inlineSource = null; + ImportUserEventsRequest.prototype.inlineSource = null; /** - * ImportSuggestionDenyListEntriesRequest gcsSource. + * ImportUserEventsRequest gcsSource. * @member {google.cloud.discoveryengine.v1alpha.IGcsSource|null|undefined} gcsSource - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest * @instance */ - ImportSuggestionDenyListEntriesRequest.prototype.gcsSource = null; + ImportUserEventsRequest.prototype.gcsSource = null; /** - * ImportSuggestionDenyListEntriesRequest parent. + * ImportUserEventsRequest bigquerySource. + * @member {google.cloud.discoveryengine.v1alpha.IBigQuerySource|null|undefined} bigquerySource + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest + * @instance + */ + ImportUserEventsRequest.prototype.bigquerySource = null; + + /** + * ImportUserEventsRequest parent. * @member {string} parent - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest * @instance */ - ImportSuggestionDenyListEntriesRequest.prototype.parent = ""; + ImportUserEventsRequest.prototype.parent = ""; + + /** + * ImportUserEventsRequest errorConfig. + * @member {google.cloud.discoveryengine.v1alpha.IImportErrorConfig|null|undefined} errorConfig + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest + * @instance + */ + ImportUserEventsRequest.prototype.errorConfig = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** - * ImportSuggestionDenyListEntriesRequest source. - * @member {"inlineSource"|"gcsSource"|undefined} source - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest + * ImportUserEventsRequest source. + * @member {"inlineSource"|"gcsSource"|"bigquerySource"|undefined} source + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest * @instance */ - Object.defineProperty(ImportSuggestionDenyListEntriesRequest.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["inlineSource", "gcsSource"]), + Object.defineProperty(ImportUserEventsRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["inlineSource", "gcsSource", "bigquerySource"]), set: $util.oneOfSetter($oneOfFields) }); /** - * Creates a new ImportSuggestionDenyListEntriesRequest instance using the specified properties. + * Creates a new ImportUserEventsRequest instance using the specified properties. * @function create - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest * @static - * @param {google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesRequest=} [properties] Properties to set - * @returns {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest} ImportSuggestionDenyListEntriesRequest instance + * @param {google.cloud.discoveryengine.v1alpha.IImportUserEventsRequest=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest} ImportUserEventsRequest instance */ - ImportSuggestionDenyListEntriesRequest.create = function create(properties) { - return new ImportSuggestionDenyListEntriesRequest(properties); + ImportUserEventsRequest.create = function create(properties) { + return new ImportUserEventsRequest(properties); }; /** - * Encodes the specified ImportSuggestionDenyListEntriesRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.verify|verify} messages. + * Encodes the specified ImportUserEventsRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest * @static - * @param {google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesRequest} message ImportSuggestionDenyListEntriesRequest message or plain object to encode + * @param {google.cloud.discoveryengine.v1alpha.IImportUserEventsRequest} message ImportUserEventsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportSuggestionDenyListEntriesRequest.encode = function encode(message, writer) { + ImportUserEventsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.inlineSource != null && Object.hasOwnProperty.call(message, "inlineSource")) - $root.google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource.encode(message.inlineSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource.encode(message.inlineSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) $root.google.cloud.discoveryengine.v1alpha.GcsSource.encode(message.gcsSource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.bigquerySource != null && Object.hasOwnProperty.call(message, "bigquerySource")) + $root.google.cloud.discoveryengine.v1alpha.BigQuerySource.encode(message.bigquerySource, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.errorConfig != null && Object.hasOwnProperty.call(message, "errorConfig")) + $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.encode(message.errorConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; /** - * Encodes the specified ImportSuggestionDenyListEntriesRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.verify|verify} messages. + * Encodes the specified ImportUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest * @static - * @param {google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesRequest} message ImportSuggestionDenyListEntriesRequest message or plain object to encode + * @param {google.cloud.discoveryengine.v1alpha.IImportUserEventsRequest} message ImportUserEventsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportSuggestionDenyListEntriesRequest.encodeDelimited = function encodeDelimited(message, writer) { + ImportUserEventsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ImportSuggestionDenyListEntriesRequest message from the specified reader or buffer. + * Decodes an ImportUserEventsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest} ImportSuggestionDenyListEntriesRequest + * @returns {google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest} ImportUserEventsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportSuggestionDenyListEntriesRequest.decode = function decode(reader, length) { + ImportUserEventsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 2: { - message.inlineSource = $root.google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource.decode(reader, reader.uint32()); + message.inlineSource = $root.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource.decode(reader, reader.uint32()); break; } case 3: { message.gcsSource = $root.google.cloud.discoveryengine.v1alpha.GcsSource.decode(reader, reader.uint32()); break; } + case 4: { + message.bigquerySource = $root.google.cloud.discoveryengine.v1alpha.BigQuerySource.decode(reader, reader.uint32()); + break; + } case 1: { message.parent = reader.string(); break; } + case 5: { + message.errorConfig = $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -51706,37 +52259,37 @@ }; /** - * Decodes an ImportSuggestionDenyListEntriesRequest message from the specified reader or buffer, length delimited. + * Decodes an ImportUserEventsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest} ImportSuggestionDenyListEntriesRequest + * @returns {google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest} ImportUserEventsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportSuggestionDenyListEntriesRequest.decodeDelimited = function decodeDelimited(reader) { + ImportUserEventsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ImportSuggestionDenyListEntriesRequest message. + * Verifies an ImportUserEventsRequest message. * @function verify - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ImportSuggestionDenyListEntriesRequest.verify = function verify(message) { + ImportUserEventsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; if (message.inlineSource != null && message.hasOwnProperty("inlineSource")) { properties.source = 1; { - var error = $root.google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource.verify(message.inlineSource); + var error = $root.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource.verify(message.inlineSource); if (error) return "inlineSource." + error; } @@ -51751,58 +52304,85 @@ return "gcsSource." + error; } } + if (message.bigquerySource != null && message.hasOwnProperty("bigquerySource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.discoveryengine.v1alpha.BigQuerySource.verify(message.bigquerySource); + if (error) + return "bigquerySource." + error; + } + } if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; + if (message.errorConfig != null && message.hasOwnProperty("errorConfig")) { + var error = $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.verify(message.errorConfig); + if (error) + return "errorConfig." + error; + } return null; }; /** - * Creates an ImportSuggestionDenyListEntriesRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ImportUserEventsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest} ImportSuggestionDenyListEntriesRequest + * @returns {google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest} ImportUserEventsRequest */ - ImportSuggestionDenyListEntriesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest) + ImportUserEventsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest) return object; - var message = new $root.google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest(); + var message = new $root.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest(); if (object.inlineSource != null) { if (typeof object.inlineSource !== "object") - throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.inlineSource: object expected"); - message.inlineSource = $root.google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource.fromObject(object.inlineSource); + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.inlineSource: object expected"); + message.inlineSource = $root.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource.fromObject(object.inlineSource); } if (object.gcsSource != null) { if (typeof object.gcsSource !== "object") - throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.gcsSource: object expected"); + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.gcsSource: object expected"); message.gcsSource = $root.google.cloud.discoveryengine.v1alpha.GcsSource.fromObject(object.gcsSource); } + if (object.bigquerySource != null) { + if (typeof object.bigquerySource !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.bigquerySource: object expected"); + message.bigquerySource = $root.google.cloud.discoveryengine.v1alpha.BigQuerySource.fromObject(object.bigquerySource); + } if (object.parent != null) message.parent = String(object.parent); + if (object.errorConfig != null) { + if (typeof object.errorConfig !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.errorConfig: object expected"); + message.errorConfig = $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.fromObject(object.errorConfig); + } return message; }; /** - * Creates a plain object from an ImportSuggestionDenyListEntriesRequest message. Also converts values to other types if specified. + * Creates a plain object from an ImportUserEventsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest * @static - * @param {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest} message ImportSuggestionDenyListEntriesRequest + * @param {google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest} message ImportUserEventsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ImportSuggestionDenyListEntriesRequest.toObject = function toObject(message, options) { + ImportUserEventsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.parent = ""; + object.errorConfig = null; + } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; if (message.inlineSource != null && message.hasOwnProperty("inlineSource")) { - object.inlineSource = $root.google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource.toObject(message.inlineSource, options); + object.inlineSource = $root.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource.toObject(message.inlineSource, options); if (options.oneofs) object.source = "inlineSource"; } @@ -51811,54 +52391,61 @@ if (options.oneofs) object.source = "gcsSource"; } + if (message.bigquerySource != null && message.hasOwnProperty("bigquerySource")) { + object.bigquerySource = $root.google.cloud.discoveryengine.v1alpha.BigQuerySource.toObject(message.bigquerySource, options); + if (options.oneofs) + object.source = "bigquerySource"; + } + if (message.errorConfig != null && message.hasOwnProperty("errorConfig")) + object.errorConfig = $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.toObject(message.errorConfig, options); return object; }; /** - * Converts this ImportSuggestionDenyListEntriesRequest to JSON. + * Converts this ImportUserEventsRequest to JSON. * @function toJSON - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest * @instance * @returns {Object.} JSON object */ - ImportSuggestionDenyListEntriesRequest.prototype.toJSON = function toJSON() { + ImportUserEventsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ImportSuggestionDenyListEntriesRequest + * Gets the default type url for ImportUserEventsRequest * @function getTypeUrl - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ImportSuggestionDenyListEntriesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ImportUserEventsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest"; + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest"; }; - ImportSuggestionDenyListEntriesRequest.InlineSource = (function() { + ImportUserEventsRequest.InlineSource = (function() { /** * Properties of an InlineSource. - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest * @interface IInlineSource - * @property {Array.|null} [entries] InlineSource entries + * @property {Array.|null} [userEvents] InlineSource userEvents */ /** * Constructs a new InlineSource. - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest * @classdesc Represents an InlineSource. * @implements IInlineSource * @constructor - * @param {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.IInlineSource=} [properties] Properties to set + * @param {google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.IInlineSource=} [properties] Properties to set */ function InlineSource(properties) { - this.entries = []; + this.userEvents = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -51866,49 +52453,49 @@ } /** - * InlineSource entries. - * @member {Array.} entries - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource + * InlineSource userEvents. + * @member {Array.} userEvents + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource * @instance */ - InlineSource.prototype.entries = $util.emptyArray; + InlineSource.prototype.userEvents = $util.emptyArray; /** * Creates a new InlineSource instance using the specified properties. * @function create - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource * @static - * @param {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.IInlineSource=} [properties] Properties to set - * @returns {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource} InlineSource instance + * @param {google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.IInlineSource=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource} InlineSource instance */ InlineSource.create = function create(properties) { return new InlineSource(properties); }; /** - * Encodes the specified InlineSource message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource.verify|verify} messages. + * Encodes the specified InlineSource message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource.verify|verify} messages. * @function encode - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource * @static - * @param {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.IInlineSource} message InlineSource message or plain object to encode + * @param {google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.IInlineSource} message InlineSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ InlineSource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.entries != null && message.entries.length) - for (var i = 0; i < message.entries.length; ++i) - $root.google.cloud.discoveryengine.v1alpha.SuggestionDenyListEntry.encode(message.entries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.userEvents != null && message.userEvents.length) + for (var i = 0; i < message.userEvents.length; ++i) + $root.google.cloud.discoveryengine.v1alpha.UserEvent.encode(message.userEvents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified InlineSource message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource.verify|verify} messages. + * Encodes the specified InlineSource message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource * @static - * @param {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.IInlineSource} message InlineSource message or plain object to encode + * @param {google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.IInlineSource} message InlineSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -51919,25 +52506,25 @@ /** * Decodes an InlineSource message from the specified reader or buffer. * @function decode - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource} InlineSource + * @returns {google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource} InlineSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ InlineSource.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.entries && message.entries.length)) - message.entries = []; - message.entries.push($root.google.cloud.discoveryengine.v1alpha.SuggestionDenyListEntry.decode(reader, reader.uint32())); + if (!(message.userEvents && message.userEvents.length)) + message.userEvents = []; + message.userEvents.push($root.google.cloud.discoveryengine.v1alpha.UserEvent.decode(reader, reader.uint32())); break; } default: @@ -51951,10 +52538,10 @@ /** * Decodes an InlineSource message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource} InlineSource + * @returns {google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource} InlineSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -51967,7 +52554,7 @@ /** * Verifies an InlineSource message. * @function verify - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -51975,13 +52562,13 @@ InlineSource.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.entries != null && message.hasOwnProperty("entries")) { - if (!Array.isArray(message.entries)) - return "entries: array expected"; - for (var i = 0; i < message.entries.length; ++i) { - var error = $root.google.cloud.discoveryengine.v1alpha.SuggestionDenyListEntry.verify(message.entries[i]); + if (message.userEvents != null && message.hasOwnProperty("userEvents")) { + if (!Array.isArray(message.userEvents)) + return "userEvents: array expected"; + for (var i = 0; i < message.userEvents.length; ++i) { + var error = $root.google.cloud.discoveryengine.v1alpha.UserEvent.verify(message.userEvents[i]); if (error) - return "entries." + error; + return "userEvents." + error; } } return null; @@ -51990,23 +52577,23 @@ /** * Creates an InlineSource message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource * @static * @param {Object.} object Plain object - * @returns {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource} InlineSource + * @returns {google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource} InlineSource */ InlineSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource) + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource) return object; - var message = new $root.google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource(); - if (object.entries) { - if (!Array.isArray(object.entries)) - throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource.entries: array expected"); - message.entries = []; - for (var i = 0; i < object.entries.length; ++i) { - if (typeof object.entries[i] !== "object") - throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource.entries: object expected"); - message.entries[i] = $root.google.cloud.discoveryengine.v1alpha.SuggestionDenyListEntry.fromObject(object.entries[i]); + var message = new $root.google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource(); + if (object.userEvents) { + if (!Array.isArray(object.userEvents)) + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource.userEvents: array expected"); + message.userEvents = []; + for (var i = 0; i < object.userEvents.length; ++i) { + if (typeof object.userEvents[i] !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource.userEvents: object expected"); + message.userEvents[i] = $root.google.cloud.discoveryengine.v1alpha.UserEvent.fromObject(object.userEvents[i]); } } return message; @@ -52015,9 +52602,9 @@ /** * Creates a plain object from an InlineSource message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource * @static - * @param {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource} message InlineSource + * @param {google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource} message InlineSource * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -52026,11 +52613,11 @@ options = {}; var object = {}; if (options.arrays || options.defaults) - object.entries = []; - if (message.entries && message.entries.length) { - object.entries = []; - for (var j = 0; j < message.entries.length; ++j) - object.entries[j] = $root.google.cloud.discoveryengine.v1alpha.SuggestionDenyListEntry.toObject(message.entries[j], options); + object.userEvents = []; + if (message.userEvents && message.userEvents.length) { + object.userEvents = []; + for (var j = 0; j < message.userEvents.length; ++j) + object.userEvents[j] = $root.google.cloud.discoveryengine.v1alpha.UserEvent.toObject(message.userEvents[j], options); } return object; }; @@ -52038,7 +52625,7 @@ /** * Converts this InlineSource to JSON. * @function toJSON - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource * @instance * @returns {Object.} JSON object */ @@ -52049,7 +52636,7 @@ /** * Gets the default type url for InlineSource * @function getTypeUrl - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -52058,35 +52645,36 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource"; + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.ImportUserEventsRequest.InlineSource"; }; return InlineSource; })(); - return ImportSuggestionDenyListEntriesRequest; + return ImportUserEventsRequest; })(); - v1alpha.ImportSuggestionDenyListEntriesResponse = (function() { + v1alpha.ImportUserEventsResponse = (function() { /** - * Properties of an ImportSuggestionDenyListEntriesResponse. + * Properties of an ImportUserEventsResponse. * @memberof google.cloud.discoveryengine.v1alpha - * @interface IImportSuggestionDenyListEntriesResponse - * @property {Array.|null} [errorSamples] ImportSuggestionDenyListEntriesResponse errorSamples - * @property {number|Long|null} [importedEntriesCount] ImportSuggestionDenyListEntriesResponse importedEntriesCount - * @property {number|Long|null} [failedEntriesCount] ImportSuggestionDenyListEntriesResponse failedEntriesCount + * @interface IImportUserEventsResponse + * @property {Array.|null} [errorSamples] ImportUserEventsResponse errorSamples + * @property {google.cloud.discoveryengine.v1alpha.IImportErrorConfig|null} [errorConfig] ImportUserEventsResponse errorConfig + * @property {number|Long|null} [joinedEventsCount] ImportUserEventsResponse joinedEventsCount + * @property {number|Long|null} [unjoinedEventsCount] ImportUserEventsResponse unjoinedEventsCount */ /** - * Constructs a new ImportSuggestionDenyListEntriesResponse. + * Constructs a new ImportUserEventsResponse. * @memberof google.cloud.discoveryengine.v1alpha - * @classdesc Represents an ImportSuggestionDenyListEntriesResponse. - * @implements IImportSuggestionDenyListEntriesResponse + * @classdesc Represents an ImportUserEventsResponse. + * @implements IImportUserEventsResponse * @constructor - * @param {google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesResponse=} [properties] Properties to set + * @param {google.cloud.discoveryengine.v1alpha.IImportUserEventsResponse=} [properties] Properties to set */ - function ImportSuggestionDenyListEntriesResponse(properties) { + function ImportUserEventsResponse(properties) { this.errorSamples = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) @@ -52095,91 +52683,101 @@ } /** - * ImportSuggestionDenyListEntriesResponse errorSamples. + * ImportUserEventsResponse errorSamples. * @member {Array.} errorSamples - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse * @instance */ - ImportSuggestionDenyListEntriesResponse.prototype.errorSamples = $util.emptyArray; + ImportUserEventsResponse.prototype.errorSamples = $util.emptyArray; /** - * ImportSuggestionDenyListEntriesResponse importedEntriesCount. - * @member {number|Long} importedEntriesCount - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse + * ImportUserEventsResponse errorConfig. + * @member {google.cloud.discoveryengine.v1alpha.IImportErrorConfig|null|undefined} errorConfig + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse * @instance */ - ImportSuggestionDenyListEntriesResponse.prototype.importedEntriesCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + ImportUserEventsResponse.prototype.errorConfig = null; /** - * ImportSuggestionDenyListEntriesResponse failedEntriesCount. - * @member {number|Long} failedEntriesCount - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse + * ImportUserEventsResponse joinedEventsCount. + * @member {number|Long} joinedEventsCount + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse * @instance */ - ImportSuggestionDenyListEntriesResponse.prototype.failedEntriesCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + ImportUserEventsResponse.prototype.joinedEventsCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new ImportSuggestionDenyListEntriesResponse instance using the specified properties. + * ImportUserEventsResponse unjoinedEventsCount. + * @member {number|Long} unjoinedEventsCount + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse + * @instance + */ + ImportUserEventsResponse.prototype.unjoinedEventsCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ImportUserEventsResponse instance using the specified properties. * @function create - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse * @static - * @param {google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesResponse=} [properties] Properties to set - * @returns {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse} ImportSuggestionDenyListEntriesResponse instance + * @param {google.cloud.discoveryengine.v1alpha.IImportUserEventsResponse=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse} ImportUserEventsResponse instance */ - ImportSuggestionDenyListEntriesResponse.create = function create(properties) { - return new ImportSuggestionDenyListEntriesResponse(properties); + ImportUserEventsResponse.create = function create(properties) { + return new ImportUserEventsResponse(properties); }; /** - * Encodes the specified ImportSuggestionDenyListEntriesResponse message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse.verify|verify} messages. + * Encodes the specified ImportUserEventsResponse message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse * @static - * @param {google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesResponse} message ImportSuggestionDenyListEntriesResponse message or plain object to encode + * @param {google.cloud.discoveryengine.v1alpha.IImportUserEventsResponse} message ImportUserEventsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportSuggestionDenyListEntriesResponse.encode = function encode(message, writer) { + ImportUserEventsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.errorSamples != null && message.errorSamples.length) for (var i = 0; i < message.errorSamples.length; ++i) $root.google.rpc.Status.encode(message.errorSamples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.importedEntriesCount != null && Object.hasOwnProperty.call(message, "importedEntriesCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.importedEntriesCount); - if (message.failedEntriesCount != null && Object.hasOwnProperty.call(message, "failedEntriesCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.failedEntriesCount); + if (message.errorConfig != null && Object.hasOwnProperty.call(message, "errorConfig")) + $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.encode(message.errorConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.joinedEventsCount != null && Object.hasOwnProperty.call(message, "joinedEventsCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.joinedEventsCount); + if (message.unjoinedEventsCount != null && Object.hasOwnProperty.call(message, "unjoinedEventsCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.unjoinedEventsCount); return writer; }; /** - * Encodes the specified ImportSuggestionDenyListEntriesResponse message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse.verify|verify} messages. + * Encodes the specified ImportUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse * @static - * @param {google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesResponse} message ImportSuggestionDenyListEntriesResponse message or plain object to encode + * @param {google.cloud.discoveryengine.v1alpha.IImportUserEventsResponse} message ImportUserEventsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportSuggestionDenyListEntriesResponse.encodeDelimited = function encodeDelimited(message, writer) { + ImportUserEventsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ImportSuggestionDenyListEntriesResponse message from the specified reader or buffer. + * Decodes an ImportUserEventsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse} ImportSuggestionDenyListEntriesResponse + * @returns {google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse} ImportUserEventsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportSuggestionDenyListEntriesResponse.decode = function decode(reader, length) { + ImportUserEventsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -52190,11 +52788,15 @@ break; } case 2: { - message.importedEntriesCount = reader.int64(); + message.errorConfig = $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.decode(reader, reader.uint32()); break; } case 3: { - message.failedEntriesCount = reader.int64(); + message.joinedEventsCount = reader.int64(); + break; + } + case 4: { + message.unjoinedEventsCount = reader.int64(); break; } default: @@ -52206,30 +52808,30 @@ }; /** - * Decodes an ImportSuggestionDenyListEntriesResponse message from the specified reader or buffer, length delimited. + * Decodes an ImportUserEventsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse} ImportSuggestionDenyListEntriesResponse + * @returns {google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse} ImportUserEventsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportSuggestionDenyListEntriesResponse.decodeDelimited = function decodeDelimited(reader) { + ImportUserEventsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ImportSuggestionDenyListEntriesResponse message. + * Verifies an ImportUserEventsResponse message. * @function verify - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ImportSuggestionDenyListEntriesResponse.verify = function verify(message) { + ImportUserEventsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.errorSamples != null && message.hasOwnProperty("errorSamples")) { @@ -52241,151 +52843,166 @@ return "errorSamples." + error; } } - if (message.importedEntriesCount != null && message.hasOwnProperty("importedEntriesCount")) - if (!$util.isInteger(message.importedEntriesCount) && !(message.importedEntriesCount && $util.isInteger(message.importedEntriesCount.low) && $util.isInteger(message.importedEntriesCount.high))) - return "importedEntriesCount: integer|Long expected"; - if (message.failedEntriesCount != null && message.hasOwnProperty("failedEntriesCount")) - if (!$util.isInteger(message.failedEntriesCount) && !(message.failedEntriesCount && $util.isInteger(message.failedEntriesCount.low) && $util.isInteger(message.failedEntriesCount.high))) - return "failedEntriesCount: integer|Long expected"; + if (message.errorConfig != null && message.hasOwnProperty("errorConfig")) { + var error = $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.verify(message.errorConfig); + if (error) + return "errorConfig." + error; + } + if (message.joinedEventsCount != null && message.hasOwnProperty("joinedEventsCount")) + if (!$util.isInteger(message.joinedEventsCount) && !(message.joinedEventsCount && $util.isInteger(message.joinedEventsCount.low) && $util.isInteger(message.joinedEventsCount.high))) + return "joinedEventsCount: integer|Long expected"; + if (message.unjoinedEventsCount != null && message.hasOwnProperty("unjoinedEventsCount")) + if (!$util.isInteger(message.unjoinedEventsCount) && !(message.unjoinedEventsCount && $util.isInteger(message.unjoinedEventsCount.low) && $util.isInteger(message.unjoinedEventsCount.high))) + return "unjoinedEventsCount: integer|Long expected"; return null; }; /** - * Creates an ImportSuggestionDenyListEntriesResponse message from a plain object. Also converts values to their respective internal types. + * Creates an ImportUserEventsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse} ImportSuggestionDenyListEntriesResponse + * @returns {google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse} ImportUserEventsResponse */ - ImportSuggestionDenyListEntriesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse) + ImportUserEventsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse) return object; - var message = new $root.google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse(); + var message = new $root.google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse(); if (object.errorSamples) { if (!Array.isArray(object.errorSamples)) - throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse.errorSamples: array expected"); + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse.errorSamples: array expected"); message.errorSamples = []; for (var i = 0; i < object.errorSamples.length; ++i) { if (typeof object.errorSamples[i] !== "object") - throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse.errorSamples: object expected"); + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse.errorSamples: object expected"); message.errorSamples[i] = $root.google.rpc.Status.fromObject(object.errorSamples[i]); } } - if (object.importedEntriesCount != null) + if (object.errorConfig != null) { + if (typeof object.errorConfig !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse.errorConfig: object expected"); + message.errorConfig = $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.fromObject(object.errorConfig); + } + if (object.joinedEventsCount != null) if ($util.Long) - (message.importedEntriesCount = $util.Long.fromValue(object.importedEntriesCount)).unsigned = false; - else if (typeof object.importedEntriesCount === "string") - message.importedEntriesCount = parseInt(object.importedEntriesCount, 10); - else if (typeof object.importedEntriesCount === "number") - message.importedEntriesCount = object.importedEntriesCount; - else if (typeof object.importedEntriesCount === "object") - message.importedEntriesCount = new $util.LongBits(object.importedEntriesCount.low >>> 0, object.importedEntriesCount.high >>> 0).toNumber(); - if (object.failedEntriesCount != null) + (message.joinedEventsCount = $util.Long.fromValue(object.joinedEventsCount)).unsigned = false; + else if (typeof object.joinedEventsCount === "string") + message.joinedEventsCount = parseInt(object.joinedEventsCount, 10); + else if (typeof object.joinedEventsCount === "number") + message.joinedEventsCount = object.joinedEventsCount; + else if (typeof object.joinedEventsCount === "object") + message.joinedEventsCount = new $util.LongBits(object.joinedEventsCount.low >>> 0, object.joinedEventsCount.high >>> 0).toNumber(); + if (object.unjoinedEventsCount != null) if ($util.Long) - (message.failedEntriesCount = $util.Long.fromValue(object.failedEntriesCount)).unsigned = false; - else if (typeof object.failedEntriesCount === "string") - message.failedEntriesCount = parseInt(object.failedEntriesCount, 10); - else if (typeof object.failedEntriesCount === "number") - message.failedEntriesCount = object.failedEntriesCount; - else if (typeof object.failedEntriesCount === "object") - message.failedEntriesCount = new $util.LongBits(object.failedEntriesCount.low >>> 0, object.failedEntriesCount.high >>> 0).toNumber(); + (message.unjoinedEventsCount = $util.Long.fromValue(object.unjoinedEventsCount)).unsigned = false; + else if (typeof object.unjoinedEventsCount === "string") + message.unjoinedEventsCount = parseInt(object.unjoinedEventsCount, 10); + else if (typeof object.unjoinedEventsCount === "number") + message.unjoinedEventsCount = object.unjoinedEventsCount; + else if (typeof object.unjoinedEventsCount === "object") + message.unjoinedEventsCount = new $util.LongBits(object.unjoinedEventsCount.low >>> 0, object.unjoinedEventsCount.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from an ImportSuggestionDenyListEntriesResponse message. Also converts values to other types if specified. + * Creates a plain object from an ImportUserEventsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse * @static - * @param {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse} message ImportSuggestionDenyListEntriesResponse + * @param {google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse} message ImportUserEventsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ImportSuggestionDenyListEntriesResponse.toObject = function toObject(message, options) { + ImportUserEventsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.errorSamples = []; if (options.defaults) { + object.errorConfig = null; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.importedEntriesCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.joinedEventsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.importedEntriesCount = options.longs === String ? "0" : 0; + object.joinedEventsCount = options.longs === String ? "0" : 0; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.failedEntriesCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.unjoinedEventsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.failedEntriesCount = options.longs === String ? "0" : 0; + object.unjoinedEventsCount = options.longs === String ? "0" : 0; } if (message.errorSamples && message.errorSamples.length) { object.errorSamples = []; for (var j = 0; j < message.errorSamples.length; ++j) object.errorSamples[j] = $root.google.rpc.Status.toObject(message.errorSamples[j], options); } - if (message.importedEntriesCount != null && message.hasOwnProperty("importedEntriesCount")) - if (typeof message.importedEntriesCount === "number") - object.importedEntriesCount = options.longs === String ? String(message.importedEntriesCount) : message.importedEntriesCount; + if (message.errorConfig != null && message.hasOwnProperty("errorConfig")) + object.errorConfig = $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.toObject(message.errorConfig, options); + if (message.joinedEventsCount != null && message.hasOwnProperty("joinedEventsCount")) + if (typeof message.joinedEventsCount === "number") + object.joinedEventsCount = options.longs === String ? String(message.joinedEventsCount) : message.joinedEventsCount; else - object.importedEntriesCount = options.longs === String ? $util.Long.prototype.toString.call(message.importedEntriesCount) : options.longs === Number ? new $util.LongBits(message.importedEntriesCount.low >>> 0, message.importedEntriesCount.high >>> 0).toNumber() : message.importedEntriesCount; - if (message.failedEntriesCount != null && message.hasOwnProperty("failedEntriesCount")) - if (typeof message.failedEntriesCount === "number") - object.failedEntriesCount = options.longs === String ? String(message.failedEntriesCount) : message.failedEntriesCount; + object.joinedEventsCount = options.longs === String ? $util.Long.prototype.toString.call(message.joinedEventsCount) : options.longs === Number ? new $util.LongBits(message.joinedEventsCount.low >>> 0, message.joinedEventsCount.high >>> 0).toNumber() : message.joinedEventsCount; + if (message.unjoinedEventsCount != null && message.hasOwnProperty("unjoinedEventsCount")) + if (typeof message.unjoinedEventsCount === "number") + object.unjoinedEventsCount = options.longs === String ? String(message.unjoinedEventsCount) : message.unjoinedEventsCount; else - object.failedEntriesCount = options.longs === String ? $util.Long.prototype.toString.call(message.failedEntriesCount) : options.longs === Number ? new $util.LongBits(message.failedEntriesCount.low >>> 0, message.failedEntriesCount.high >>> 0).toNumber() : message.failedEntriesCount; + object.unjoinedEventsCount = options.longs === String ? $util.Long.prototype.toString.call(message.unjoinedEventsCount) : options.longs === Number ? new $util.LongBits(message.unjoinedEventsCount.low >>> 0, message.unjoinedEventsCount.high >>> 0).toNumber() : message.unjoinedEventsCount; return object; }; /** - * Converts this ImportSuggestionDenyListEntriesResponse to JSON. + * Converts this ImportUserEventsResponse to JSON. * @function toJSON - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse * @instance * @returns {Object.} JSON object */ - ImportSuggestionDenyListEntriesResponse.prototype.toJSON = function toJSON() { + ImportUserEventsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ImportSuggestionDenyListEntriesResponse + * Gets the default type url for ImportUserEventsResponse * @function getTypeUrl - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ImportSuggestionDenyListEntriesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ImportUserEventsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse"; + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.ImportUserEventsResponse"; }; - return ImportSuggestionDenyListEntriesResponse; + return ImportUserEventsResponse; })(); - v1alpha.ImportSuggestionDenyListEntriesMetadata = (function() { + v1alpha.ImportUserEventsMetadata = (function() { /** - * Properties of an ImportSuggestionDenyListEntriesMetadata. + * Properties of an ImportUserEventsMetadata. * @memberof google.cloud.discoveryengine.v1alpha - * @interface IImportSuggestionDenyListEntriesMetadata - * @property {google.protobuf.ITimestamp|null} [createTime] ImportSuggestionDenyListEntriesMetadata createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] ImportSuggestionDenyListEntriesMetadata updateTime + * @interface IImportUserEventsMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] ImportUserEventsMetadata createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ImportUserEventsMetadata updateTime + * @property {number|Long|null} [successCount] ImportUserEventsMetadata successCount + * @property {number|Long|null} [failureCount] ImportUserEventsMetadata failureCount */ /** - * Constructs a new ImportSuggestionDenyListEntriesMetadata. + * Constructs a new ImportUserEventsMetadata. * @memberof google.cloud.discoveryengine.v1alpha - * @classdesc Represents an ImportSuggestionDenyListEntriesMetadata. - * @implements IImportSuggestionDenyListEntriesMetadata + * @classdesc Represents an ImportUserEventsMetadata. + * @implements IImportUserEventsMetadata * @constructor - * @param {google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesMetadata=} [properties] Properties to set + * @param {google.cloud.discoveryengine.v1alpha.IImportUserEventsMetadata=} [properties] Properties to set */ - function ImportSuggestionDenyListEntriesMetadata(properties) { + function ImportUserEventsMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -52393,80 +53010,100 @@ } /** - * ImportSuggestionDenyListEntriesMetadata createTime. + * ImportUserEventsMetadata createTime. * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata * @instance */ - ImportSuggestionDenyListEntriesMetadata.prototype.createTime = null; + ImportUserEventsMetadata.prototype.createTime = null; /** - * ImportSuggestionDenyListEntriesMetadata updateTime. + * ImportUserEventsMetadata updateTime. * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata * @instance */ - ImportSuggestionDenyListEntriesMetadata.prototype.updateTime = null; + ImportUserEventsMetadata.prototype.updateTime = null; /** - * Creates a new ImportSuggestionDenyListEntriesMetadata instance using the specified properties. + * ImportUserEventsMetadata successCount. + * @member {number|Long} successCount + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata + * @instance + */ + ImportUserEventsMetadata.prototype.successCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ImportUserEventsMetadata failureCount. + * @member {number|Long} failureCount + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata + * @instance + */ + ImportUserEventsMetadata.prototype.failureCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ImportUserEventsMetadata instance using the specified properties. * @function create - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata * @static - * @param {google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesMetadata=} [properties] Properties to set - * @returns {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata} ImportSuggestionDenyListEntriesMetadata instance + * @param {google.cloud.discoveryengine.v1alpha.IImportUserEventsMetadata=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata} ImportUserEventsMetadata instance */ - ImportSuggestionDenyListEntriesMetadata.create = function create(properties) { - return new ImportSuggestionDenyListEntriesMetadata(properties); + ImportUserEventsMetadata.create = function create(properties) { + return new ImportUserEventsMetadata(properties); }; /** - * Encodes the specified ImportSuggestionDenyListEntriesMetadata message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata.verify|verify} messages. + * Encodes the specified ImportUserEventsMetadata message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata * @static - * @param {google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesMetadata} message ImportSuggestionDenyListEntriesMetadata message or plain object to encode + * @param {google.cloud.discoveryengine.v1alpha.IImportUserEventsMetadata} message ImportUserEventsMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportSuggestionDenyListEntriesMetadata.encode = function encode(message, writer) { + ImportUserEventsMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.successCount != null && Object.hasOwnProperty.call(message, "successCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.successCount); + if (message.failureCount != null && Object.hasOwnProperty.call(message, "failureCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.failureCount); return writer; }; /** - * Encodes the specified ImportSuggestionDenyListEntriesMetadata message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata.verify|verify} messages. + * Encodes the specified ImportUserEventsMetadata message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata * @static - * @param {google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesMetadata} message ImportSuggestionDenyListEntriesMetadata message or plain object to encode + * @param {google.cloud.discoveryengine.v1alpha.IImportUserEventsMetadata} message ImportUserEventsMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportSuggestionDenyListEntriesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + ImportUserEventsMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ImportSuggestionDenyListEntriesMetadata message from the specified reader or buffer. + * Decodes an ImportUserEventsMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata} ImportSuggestionDenyListEntriesMetadata + * @returns {google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata} ImportUserEventsMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportSuggestionDenyListEntriesMetadata.decode = function decode(reader, length) { + ImportUserEventsMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -52478,6 +53115,14 @@ message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } + case 3: { + message.successCount = reader.int64(); + break; + } + case 4: { + message.failureCount = reader.int64(); + break; + } default: reader.skipType(tag & 7); break; @@ -52487,30 +53132,30 @@ }; /** - * Decodes an ImportSuggestionDenyListEntriesMetadata message from the specified reader or buffer, length delimited. + * Decodes an ImportUserEventsMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata} ImportSuggestionDenyListEntriesMetadata + * @returns {google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata} ImportUserEventsMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportSuggestionDenyListEntriesMetadata.decodeDelimited = function decodeDelimited(reader) { + ImportUserEventsMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ImportSuggestionDenyListEntriesMetadata message. + * Verifies an ImportUserEventsMetadata message. * @function verify - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ImportSuggestionDenyListEntriesMetadata.verify = function verify(message) { + ImportUserEventsMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.createTime != null && message.hasOwnProperty("createTime")) { @@ -52523,114 +53168,153 @@ if (error) return "updateTime." + error; } + if (message.successCount != null && message.hasOwnProperty("successCount")) + if (!$util.isInteger(message.successCount) && !(message.successCount && $util.isInteger(message.successCount.low) && $util.isInteger(message.successCount.high))) + return "successCount: integer|Long expected"; + if (message.failureCount != null && message.hasOwnProperty("failureCount")) + if (!$util.isInteger(message.failureCount) && !(message.failureCount && $util.isInteger(message.failureCount.low) && $util.isInteger(message.failureCount.high))) + return "failureCount: integer|Long expected"; return null; }; /** - * Creates an ImportSuggestionDenyListEntriesMetadata message from a plain object. Also converts values to their respective internal types. + * Creates an ImportUserEventsMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata} ImportSuggestionDenyListEntriesMetadata + * @returns {google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata} ImportUserEventsMetadata */ - ImportSuggestionDenyListEntriesMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata) + ImportUserEventsMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata) return object; - var message = new $root.google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata(); + var message = new $root.google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata(); if (object.createTime != null) { if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata.createTime: object expected"); + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata.createTime: object expected"); message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); } if (object.updateTime != null) { if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata.updateTime: object expected"); + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata.updateTime: object expected"); message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); } + if (object.successCount != null) + if ($util.Long) + (message.successCount = $util.Long.fromValue(object.successCount)).unsigned = false; + else if (typeof object.successCount === "string") + message.successCount = parseInt(object.successCount, 10); + else if (typeof object.successCount === "number") + message.successCount = object.successCount; + else if (typeof object.successCount === "object") + message.successCount = new $util.LongBits(object.successCount.low >>> 0, object.successCount.high >>> 0).toNumber(); + if (object.failureCount != null) + if ($util.Long) + (message.failureCount = $util.Long.fromValue(object.failureCount)).unsigned = false; + else if (typeof object.failureCount === "string") + message.failureCount = parseInt(object.failureCount, 10); + else if (typeof object.failureCount === "number") + message.failureCount = object.failureCount; + else if (typeof object.failureCount === "object") + message.failureCount = new $util.LongBits(object.failureCount.low >>> 0, object.failureCount.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from an ImportSuggestionDenyListEntriesMetadata message. Also converts values to other types if specified. + * Creates a plain object from an ImportUserEventsMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata * @static - * @param {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata} message ImportSuggestionDenyListEntriesMetadata + * @param {google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata} message ImportUserEventsMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ImportSuggestionDenyListEntriesMetadata.toObject = function toObject(message, options) { + ImportUserEventsMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.createTime = null; object.updateTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.successCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.successCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.failureCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.failureCount = options.longs === String ? "0" : 0; } if (message.createTime != null && message.hasOwnProperty("createTime")) object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); if (message.updateTime != null && message.hasOwnProperty("updateTime")) object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.successCount != null && message.hasOwnProperty("successCount")) + if (typeof message.successCount === "number") + object.successCount = options.longs === String ? String(message.successCount) : message.successCount; + else + object.successCount = options.longs === String ? $util.Long.prototype.toString.call(message.successCount) : options.longs === Number ? new $util.LongBits(message.successCount.low >>> 0, message.successCount.high >>> 0).toNumber() : message.successCount; + if (message.failureCount != null && message.hasOwnProperty("failureCount")) + if (typeof message.failureCount === "number") + object.failureCount = options.longs === String ? String(message.failureCount) : message.failureCount; + else + object.failureCount = options.longs === String ? $util.Long.prototype.toString.call(message.failureCount) : options.longs === Number ? new $util.LongBits(message.failureCount.low >>> 0, message.failureCount.high >>> 0).toNumber() : message.failureCount; return object; }; /** - * Converts this ImportSuggestionDenyListEntriesMetadata to JSON. + * Converts this ImportUserEventsMetadata to JSON. * @function toJSON - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata * @instance * @returns {Object.} JSON object */ - ImportSuggestionDenyListEntriesMetadata.prototype.toJSON = function toJSON() { + ImportUserEventsMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ImportSuggestionDenyListEntriesMetadata + * Gets the default type url for ImportUserEventsMetadata * @function getTypeUrl - * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata + * @memberof google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ImportSuggestionDenyListEntriesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ImportUserEventsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata"; + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.ImportUserEventsMetadata"; }; - return ImportSuggestionDenyListEntriesMetadata; + return ImportUserEventsMetadata; })(); - v1alpha.Document = (function() { + v1alpha.ImportDocumentsMetadata = (function() { /** - * Properties of a Document. + * Properties of an ImportDocumentsMetadata. * @memberof google.cloud.discoveryengine.v1alpha - * @interface IDocument - * @property {google.protobuf.IStruct|null} [structData] Document structData - * @property {string|null} [jsonData] Document jsonData - * @property {string|null} [name] Document name - * @property {string|null} [id] Document id - * @property {string|null} [schemaId] Document schemaId - * @property {google.cloud.discoveryengine.v1alpha.Document.IContent|null} [content] Document content - * @property {string|null} [parentDocumentId] Document parentDocumentId - * @property {google.protobuf.IStruct|null} [derivedStructData] Document derivedStructData - * @property {google.cloud.discoveryengine.v1alpha.Document.IAclInfo|null} [aclInfo] Document aclInfo - * @property {google.protobuf.ITimestamp|null} [indexTime] Document indexTime + * @interface IImportDocumentsMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] ImportDocumentsMetadata createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ImportDocumentsMetadata updateTime + * @property {number|Long|null} [successCount] ImportDocumentsMetadata successCount + * @property {number|Long|null} [failureCount] ImportDocumentsMetadata failureCount + * @property {number|Long|null} [totalCount] ImportDocumentsMetadata totalCount */ /** - * Constructs a new Document. + * Constructs a new ImportDocumentsMetadata. * @memberof google.cloud.discoveryengine.v1alpha - * @classdesc Represents a Document. - * @implements IDocument + * @classdesc Represents an ImportDocumentsMetadata. + * @implements IImportDocumentsMetadata * @constructor - * @param {google.cloud.discoveryengine.v1alpha.IDocument=} [properties] Properties to set + * @param {google.cloud.discoveryengine.v1alpha.IImportDocumentsMetadata=} [properties] Properties to set */ - function Document(properties) { + function ImportDocumentsMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -52638,215 +53322,131 @@ } /** - * Document structData. - * @member {google.protobuf.IStruct|null|undefined} structData - * @memberof google.cloud.discoveryengine.v1alpha.Document - * @instance - */ - Document.prototype.structData = null; - - /** - * Document jsonData. - * @member {string|null|undefined} jsonData - * @memberof google.cloud.discoveryengine.v1alpha.Document - * @instance - */ - Document.prototype.jsonData = null; - - /** - * Document name. - * @member {string} name - * @memberof google.cloud.discoveryengine.v1alpha.Document - * @instance - */ - Document.prototype.name = ""; - - /** - * Document id. - * @member {string} id - * @memberof google.cloud.discoveryengine.v1alpha.Document - * @instance - */ - Document.prototype.id = ""; - - /** - * Document schemaId. - * @member {string} schemaId - * @memberof google.cloud.discoveryengine.v1alpha.Document - * @instance - */ - Document.prototype.schemaId = ""; - - /** - * Document content. - * @member {google.cloud.discoveryengine.v1alpha.Document.IContent|null|undefined} content - * @memberof google.cloud.discoveryengine.v1alpha.Document - * @instance - */ - Document.prototype.content = null; - - /** - * Document parentDocumentId. - * @member {string} parentDocumentId - * @memberof google.cloud.discoveryengine.v1alpha.Document + * ImportDocumentsMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata * @instance */ - Document.prototype.parentDocumentId = ""; + ImportDocumentsMetadata.prototype.createTime = null; /** - * Document derivedStructData. - * @member {google.protobuf.IStruct|null|undefined} derivedStructData - * @memberof google.cloud.discoveryengine.v1alpha.Document + * ImportDocumentsMetadata updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata * @instance */ - Document.prototype.derivedStructData = null; + ImportDocumentsMetadata.prototype.updateTime = null; /** - * Document aclInfo. - * @member {google.cloud.discoveryengine.v1alpha.Document.IAclInfo|null|undefined} aclInfo - * @memberof google.cloud.discoveryengine.v1alpha.Document + * ImportDocumentsMetadata successCount. + * @member {number|Long} successCount + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata * @instance */ - Document.prototype.aclInfo = null; + ImportDocumentsMetadata.prototype.successCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Document indexTime. - * @member {google.protobuf.ITimestamp|null|undefined} indexTime - * @memberof google.cloud.discoveryengine.v1alpha.Document + * ImportDocumentsMetadata failureCount. + * @member {number|Long} failureCount + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata * @instance */ - Document.prototype.indexTime = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + ImportDocumentsMetadata.prototype.failureCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Document data. - * @member {"structData"|"jsonData"|undefined} data - * @memberof google.cloud.discoveryengine.v1alpha.Document + * ImportDocumentsMetadata totalCount. + * @member {number|Long} totalCount + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata * @instance */ - Object.defineProperty(Document.prototype, "data", { - get: $util.oneOfGetter($oneOfFields = ["structData", "jsonData"]), - set: $util.oneOfSetter($oneOfFields) - }); + ImportDocumentsMetadata.prototype.totalCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new Document instance using the specified properties. + * Creates a new ImportDocumentsMetadata instance using the specified properties. * @function create - * @memberof google.cloud.discoveryengine.v1alpha.Document + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata * @static - * @param {google.cloud.discoveryengine.v1alpha.IDocument=} [properties] Properties to set - * @returns {google.cloud.discoveryengine.v1alpha.Document} Document instance + * @param {google.cloud.discoveryengine.v1alpha.IImportDocumentsMetadata=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata} ImportDocumentsMetadata instance */ - Document.create = function create(properties) { - return new Document(properties); + ImportDocumentsMetadata.create = function create(properties) { + return new ImportDocumentsMetadata(properties); }; /** - * Encodes the specified Document message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.Document.verify|verify} messages. + * Encodes the specified ImportDocumentsMetadata message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.discoveryengine.v1alpha.Document + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata * @static - * @param {google.cloud.discoveryengine.v1alpha.IDocument} message Document message or plain object to encode + * @param {google.cloud.discoveryengine.v1alpha.IImportDocumentsMetadata} message ImportDocumentsMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Document.encode = function encode(message, writer) { + ImportDocumentsMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); - if (message.schemaId != null && Object.hasOwnProperty.call(message, "schemaId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.schemaId); - if (message.structData != null && Object.hasOwnProperty.call(message, "structData")) - $root.google.protobuf.Struct.encode(message.structData, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.jsonData != null && Object.hasOwnProperty.call(message, "jsonData")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.jsonData); - if (message.derivedStructData != null && Object.hasOwnProperty.call(message, "derivedStructData")) - $root.google.protobuf.Struct.encode(message.derivedStructData, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.parentDocumentId != null && Object.hasOwnProperty.call(message, "parentDocumentId")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.parentDocumentId); - if (message.content != null && Object.hasOwnProperty.call(message, "content")) - $root.google.cloud.discoveryengine.v1alpha.Document.Content.encode(message.content, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.aclInfo != null && Object.hasOwnProperty.call(message, "aclInfo")) - $root.google.cloud.discoveryengine.v1alpha.Document.AclInfo.encode(message.aclInfo, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.indexTime != null && Object.hasOwnProperty.call(message, "indexTime")) - $root.google.protobuf.Timestamp.encode(message.indexTime, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.successCount != null && Object.hasOwnProperty.call(message, "successCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.successCount); + if (message.failureCount != null && Object.hasOwnProperty.call(message, "failureCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.failureCount); + if (message.totalCount != null && Object.hasOwnProperty.call(message, "totalCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.totalCount); return writer; }; /** - * Encodes the specified Document message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.Document.verify|verify} messages. + * Encodes the specified ImportDocumentsMetadata message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.Document + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata * @static - * @param {google.cloud.discoveryengine.v1alpha.IDocument} message Document message or plain object to encode + * @param {google.cloud.discoveryengine.v1alpha.IImportDocumentsMetadata} message ImportDocumentsMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Document.encodeDelimited = function encodeDelimited(message, writer) { + ImportDocumentsMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Document message from the specified reader or buffer. + * Decodes an ImportDocumentsMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.discoveryengine.v1alpha.Document + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.discoveryengine.v1alpha.Document} Document + * @returns {google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata} ImportDocumentsMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Document.decode = function decode(reader, length) { + ImportDocumentsMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.Document(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 4: { - message.structData = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - case 5: { - message.jsonData = reader.string(); - break; - } case 1: { - message.name = reader.string(); + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } case 2: { - message.id = reader.string(); + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } case 3: { - message.schemaId = reader.string(); - break; - } - case 10: { - message.content = $root.google.cloud.discoveryengine.v1alpha.Document.Content.decode(reader, reader.uint32()); - break; - } - case 7: { - message.parentDocumentId = reader.string(); - break; - } - case 6: { - message.derivedStructData = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + message.successCount = reader.int64(); break; } - case 11: { - message.aclInfo = $root.google.cloud.discoveryengine.v1alpha.Document.AclInfo.decode(reader, reader.uint32()); + case 4: { + message.failureCount = reader.int64(); break; } - case 13: { - message.indexTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + case 5: { + message.totalCount = reader.int64(); break; } default: @@ -52858,437 +53458,3597 @@ }; /** - * Decodes a Document message from the specified reader or buffer, length delimited. + * Decodes an ImportDocumentsMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.Document + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.discoveryengine.v1alpha.Document} Document + * @returns {google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata} ImportDocumentsMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Document.decodeDelimited = function decodeDelimited(reader) { + ImportDocumentsMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Document message. + * Verifies an ImportDocumentsMetadata message. * @function verify - * @memberof google.cloud.discoveryengine.v1alpha.Document + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Document.verify = function verify(message) { + ImportDocumentsMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.structData != null && message.hasOwnProperty("structData")) { - properties.data = 1; - { - var error = $root.google.protobuf.Struct.verify(message.structData); - if (error) - return "structData." + error; - } - } - if (message.jsonData != null && message.hasOwnProperty("jsonData")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - if (!$util.isString(message.jsonData)) - return "jsonData: string expected"; - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.schemaId != null && message.hasOwnProperty("schemaId")) - if (!$util.isString(message.schemaId)) - return "schemaId: string expected"; - if (message.content != null && message.hasOwnProperty("content")) { - var error = $root.google.cloud.discoveryengine.v1alpha.Document.Content.verify(message.content); - if (error) - return "content." + error; - } - if (message.parentDocumentId != null && message.hasOwnProperty("parentDocumentId")) - if (!$util.isString(message.parentDocumentId)) - return "parentDocumentId: string expected"; - if (message.derivedStructData != null && message.hasOwnProperty("derivedStructData")) { - var error = $root.google.protobuf.Struct.verify(message.derivedStructData); - if (error) - return "derivedStructData." + error; - } - if (message.aclInfo != null && message.hasOwnProperty("aclInfo")) { - var error = $root.google.cloud.discoveryengine.v1alpha.Document.AclInfo.verify(message.aclInfo); + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); if (error) - return "aclInfo." + error; + return "createTime." + error; } - if (message.indexTime != null && message.hasOwnProperty("indexTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.indexTime); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); if (error) - return "indexTime." + error; + return "updateTime." + error; } + if (message.successCount != null && message.hasOwnProperty("successCount")) + if (!$util.isInteger(message.successCount) && !(message.successCount && $util.isInteger(message.successCount.low) && $util.isInteger(message.successCount.high))) + return "successCount: integer|Long expected"; + if (message.failureCount != null && message.hasOwnProperty("failureCount")) + if (!$util.isInteger(message.failureCount) && !(message.failureCount && $util.isInteger(message.failureCount.low) && $util.isInteger(message.failureCount.high))) + return "failureCount: integer|Long expected"; + if (message.totalCount != null && message.hasOwnProperty("totalCount")) + if (!$util.isInteger(message.totalCount) && !(message.totalCount && $util.isInteger(message.totalCount.low) && $util.isInteger(message.totalCount.high))) + return "totalCount: integer|Long expected"; return null; }; /** - * Creates a Document message from a plain object. Also converts values to their respective internal types. + * Creates an ImportDocumentsMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.discoveryengine.v1alpha.Document + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.discoveryengine.v1alpha.Document} Document + * @returns {google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata} ImportDocumentsMetadata */ - Document.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.discoveryengine.v1alpha.Document) + ImportDocumentsMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata) return object; - var message = new $root.google.cloud.discoveryengine.v1alpha.Document(); - if (object.structData != null) { - if (typeof object.structData !== "object") - throw TypeError(".google.cloud.discoveryengine.v1alpha.Document.structData: object expected"); - message.structData = $root.google.protobuf.Struct.fromObject(object.structData); - } - if (object.jsonData != null) - message.jsonData = String(object.jsonData); - if (object.name != null) - message.name = String(object.name); - if (object.id != null) - message.id = String(object.id); - if (object.schemaId != null) - message.schemaId = String(object.schemaId); - if (object.content != null) { - if (typeof object.content !== "object") - throw TypeError(".google.cloud.discoveryengine.v1alpha.Document.content: object expected"); - message.content = $root.google.cloud.discoveryengine.v1alpha.Document.Content.fromObject(object.content); - } - if (object.parentDocumentId != null) - message.parentDocumentId = String(object.parentDocumentId); - if (object.derivedStructData != null) { - if (typeof object.derivedStructData !== "object") - throw TypeError(".google.cloud.discoveryengine.v1alpha.Document.derivedStructData: object expected"); - message.derivedStructData = $root.google.protobuf.Struct.fromObject(object.derivedStructData); - } - if (object.aclInfo != null) { - if (typeof object.aclInfo !== "object") - throw TypeError(".google.cloud.discoveryengine.v1alpha.Document.aclInfo: object expected"); - message.aclInfo = $root.google.cloud.discoveryengine.v1alpha.Document.AclInfo.fromObject(object.aclInfo); + var message = new $root.google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); } - if (object.indexTime != null) { - if (typeof object.indexTime !== "object") - throw TypeError(".google.cloud.discoveryengine.v1alpha.Document.indexTime: object expected"); - message.indexTime = $root.google.protobuf.Timestamp.fromObject(object.indexTime); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); } + if (object.successCount != null) + if ($util.Long) + (message.successCount = $util.Long.fromValue(object.successCount)).unsigned = false; + else if (typeof object.successCount === "string") + message.successCount = parseInt(object.successCount, 10); + else if (typeof object.successCount === "number") + message.successCount = object.successCount; + else if (typeof object.successCount === "object") + message.successCount = new $util.LongBits(object.successCount.low >>> 0, object.successCount.high >>> 0).toNumber(); + if (object.failureCount != null) + if ($util.Long) + (message.failureCount = $util.Long.fromValue(object.failureCount)).unsigned = false; + else if (typeof object.failureCount === "string") + message.failureCount = parseInt(object.failureCount, 10); + else if (typeof object.failureCount === "number") + message.failureCount = object.failureCount; + else if (typeof object.failureCount === "object") + message.failureCount = new $util.LongBits(object.failureCount.low >>> 0, object.failureCount.high >>> 0).toNumber(); + if (object.totalCount != null) + if ($util.Long) + (message.totalCount = $util.Long.fromValue(object.totalCount)).unsigned = false; + else if (typeof object.totalCount === "string") + message.totalCount = parseInt(object.totalCount, 10); + else if (typeof object.totalCount === "number") + message.totalCount = object.totalCount; + else if (typeof object.totalCount === "object") + message.totalCount = new $util.LongBits(object.totalCount.low >>> 0, object.totalCount.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a Document message. Also converts values to other types if specified. + * Creates a plain object from an ImportDocumentsMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.discoveryengine.v1alpha.Document + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata * @static - * @param {google.cloud.discoveryengine.v1alpha.Document} message Document + * @param {google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata} message ImportDocumentsMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Document.toObject = function toObject(message, options) { + ImportDocumentsMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; - object.id = ""; - object.schemaId = ""; - object.derivedStructData = null; - object.parentDocumentId = ""; - object.content = null; - object.aclInfo = null; - object.indexTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.schemaId != null && message.hasOwnProperty("schemaId")) - object.schemaId = message.schemaId; - if (message.structData != null && message.hasOwnProperty("structData")) { - object.structData = $root.google.protobuf.Struct.toObject(message.structData, options); - if (options.oneofs) - object.data = "structData"; - } - if (message.jsonData != null && message.hasOwnProperty("jsonData")) { - object.jsonData = message.jsonData; - if (options.oneofs) - object.data = "jsonData"; + object.createTime = null; + object.updateTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.successCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.successCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.failureCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.failureCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalCount = options.longs === String ? "0" : 0; } - if (message.derivedStructData != null && message.hasOwnProperty("derivedStructData")) - object.derivedStructData = $root.google.protobuf.Struct.toObject(message.derivedStructData, options); - if (message.parentDocumentId != null && message.hasOwnProperty("parentDocumentId")) - object.parentDocumentId = message.parentDocumentId; - if (message.content != null && message.hasOwnProperty("content")) - object.content = $root.google.cloud.discoveryengine.v1alpha.Document.Content.toObject(message.content, options); - if (message.aclInfo != null && message.hasOwnProperty("aclInfo")) - object.aclInfo = $root.google.cloud.discoveryengine.v1alpha.Document.AclInfo.toObject(message.aclInfo, options); - if (message.indexTime != null && message.hasOwnProperty("indexTime")) - object.indexTime = $root.google.protobuf.Timestamp.toObject(message.indexTime, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.successCount != null && message.hasOwnProperty("successCount")) + if (typeof message.successCount === "number") + object.successCount = options.longs === String ? String(message.successCount) : message.successCount; + else + object.successCount = options.longs === String ? $util.Long.prototype.toString.call(message.successCount) : options.longs === Number ? new $util.LongBits(message.successCount.low >>> 0, message.successCount.high >>> 0).toNumber() : message.successCount; + if (message.failureCount != null && message.hasOwnProperty("failureCount")) + if (typeof message.failureCount === "number") + object.failureCount = options.longs === String ? String(message.failureCount) : message.failureCount; + else + object.failureCount = options.longs === String ? $util.Long.prototype.toString.call(message.failureCount) : options.longs === Number ? new $util.LongBits(message.failureCount.low >>> 0, message.failureCount.high >>> 0).toNumber() : message.failureCount; + if (message.totalCount != null && message.hasOwnProperty("totalCount")) + if (typeof message.totalCount === "number") + object.totalCount = options.longs === String ? String(message.totalCount) : message.totalCount; + else + object.totalCount = options.longs === String ? $util.Long.prototype.toString.call(message.totalCount) : options.longs === Number ? new $util.LongBits(message.totalCount.low >>> 0, message.totalCount.high >>> 0).toNumber() : message.totalCount; return object; }; /** - * Converts this Document to JSON. + * Converts this ImportDocumentsMetadata to JSON. * @function toJSON - * @memberof google.cloud.discoveryengine.v1alpha.Document + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata * @instance * @returns {Object.} JSON object */ - Document.prototype.toJSON = function toJSON() { + ImportDocumentsMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Document + * Gets the default type url for ImportDocumentsMetadata * @function getTypeUrl - * @memberof google.cloud.discoveryengine.v1alpha.Document + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Document.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ImportDocumentsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.Document"; + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata"; }; - Document.Content = (function() { + return ImportDocumentsMetadata; + })(); - /** - * Properties of a Content. - * @memberof google.cloud.discoveryengine.v1alpha.Document - * @interface IContent - * @property {Uint8Array|null} [rawBytes] Content rawBytes - * @property {string|null} [uri] Content uri - * @property {string|null} [mimeType] Content mimeType - */ + v1alpha.ImportDocumentsRequest = (function() { - /** - * Constructs a new Content. - * @memberof google.cloud.discoveryengine.v1alpha.Document - * @classdesc Represents a Content. - * @implements IContent - * @constructor - * @param {google.cloud.discoveryengine.v1alpha.Document.IContent=} [properties] Properties to set - */ - function Content(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of an ImportDocumentsRequest. + * @memberof google.cloud.discoveryengine.v1alpha + * @interface IImportDocumentsRequest + * @property {google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.IInlineSource|null} [inlineSource] ImportDocumentsRequest inlineSource + * @property {google.cloud.discoveryengine.v1alpha.IGcsSource|null} [gcsSource] ImportDocumentsRequest gcsSource + * @property {google.cloud.discoveryengine.v1alpha.IBigQuerySource|null} [bigquerySource] ImportDocumentsRequest bigquerySource + * @property {google.cloud.discoveryengine.v1alpha.IFhirStoreSource|null} [fhirStoreSource] ImportDocumentsRequest fhirStoreSource + * @property {google.cloud.discoveryengine.v1alpha.ISpannerSource|null} [spannerSource] ImportDocumentsRequest spannerSource + * @property {google.cloud.discoveryengine.v1alpha.ICloudSqlSource|null} [cloudSqlSource] ImportDocumentsRequest cloudSqlSource + * @property {google.cloud.discoveryengine.v1alpha.IFirestoreSource|null} [firestoreSource] ImportDocumentsRequest firestoreSource + * @property {google.cloud.discoveryengine.v1alpha.IBigtableSource|null} [bigtableSource] ImportDocumentsRequest bigtableSource + * @property {string|null} [parent] ImportDocumentsRequest parent + * @property {google.cloud.discoveryengine.v1alpha.IImportErrorConfig|null} [errorConfig] ImportDocumentsRequest errorConfig + * @property {google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode|null} [reconciliationMode] ImportDocumentsRequest reconciliationMode + * @property {google.protobuf.IFieldMask|null} [updateMask] ImportDocumentsRequest updateMask + * @property {boolean|null} [autoGenerateIds] ImportDocumentsRequest autoGenerateIds + * @property {string|null} [idField] ImportDocumentsRequest idField + */ - /** - * Content rawBytes. - * @member {Uint8Array|null|undefined} rawBytes - * @memberof google.cloud.discoveryengine.v1alpha.Document.Content - * @instance - */ - Content.prototype.rawBytes = null; + /** + * Constructs a new ImportDocumentsRequest. + * @memberof google.cloud.discoveryengine.v1alpha + * @classdesc Represents an ImportDocumentsRequest. + * @implements IImportDocumentsRequest + * @constructor + * @param {google.cloud.discoveryengine.v1alpha.IImportDocumentsRequest=} [properties] Properties to set + */ + function ImportDocumentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Content uri. - * @member {string|null|undefined} uri - * @memberof google.cloud.discoveryengine.v1alpha.Document.Content - * @instance - */ - Content.prototype.uri = null; + /** + * ImportDocumentsRequest inlineSource. + * @member {google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.IInlineSource|null|undefined} inlineSource + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * @instance + */ + ImportDocumentsRequest.prototype.inlineSource = null; - /** - * Content mimeType. - * @member {string} mimeType - * @memberof google.cloud.discoveryengine.v1alpha.Document.Content - * @instance - */ - Content.prototype.mimeType = ""; + /** + * ImportDocumentsRequest gcsSource. + * @member {google.cloud.discoveryengine.v1alpha.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * @instance + */ + ImportDocumentsRequest.prototype.gcsSource = null; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * ImportDocumentsRequest bigquerySource. + * @member {google.cloud.discoveryengine.v1alpha.IBigQuerySource|null|undefined} bigquerySource + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * @instance + */ + ImportDocumentsRequest.prototype.bigquerySource = null; - /** - * Content content. - * @member {"rawBytes"|"uri"|undefined} content - * @memberof google.cloud.discoveryengine.v1alpha.Document.Content - * @instance - */ - Object.defineProperty(Content.prototype, "content", { - get: $util.oneOfGetter($oneOfFields = ["rawBytes", "uri"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * ImportDocumentsRequest fhirStoreSource. + * @member {google.cloud.discoveryengine.v1alpha.IFhirStoreSource|null|undefined} fhirStoreSource + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * @instance + */ + ImportDocumentsRequest.prototype.fhirStoreSource = null; - /** - * Creates a new Content instance using the specified properties. - * @function create - * @memberof google.cloud.discoveryengine.v1alpha.Document.Content - * @static - * @param {google.cloud.discoveryengine.v1alpha.Document.IContent=} [properties] Properties to set - * @returns {google.cloud.discoveryengine.v1alpha.Document.Content} Content instance - */ - Content.create = function create(properties) { - return new Content(properties); - }; + /** + * ImportDocumentsRequest spannerSource. + * @member {google.cloud.discoveryengine.v1alpha.ISpannerSource|null|undefined} spannerSource + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * @instance + */ + ImportDocumentsRequest.prototype.spannerSource = null; - /** - * Encodes the specified Content message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.Document.Content.verify|verify} messages. - * @function encode - * @memberof google.cloud.discoveryengine.v1alpha.Document.Content - * @static - * @param {google.cloud.discoveryengine.v1alpha.Document.IContent} message Content message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Content.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.mimeType); - if (message.rawBytes != null && Object.hasOwnProperty.call(message, "rawBytes")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.rawBytes); - if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.uri); - return writer; - }; + /** + * ImportDocumentsRequest cloudSqlSource. + * @member {google.cloud.discoveryengine.v1alpha.ICloudSqlSource|null|undefined} cloudSqlSource + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * @instance + */ + ImportDocumentsRequest.prototype.cloudSqlSource = null; - /** - * Encodes the specified Content message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.Document.Content.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.Document.Content - * @static - * @param {google.cloud.discoveryengine.v1alpha.Document.IContent} message Content message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Content.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * ImportDocumentsRequest firestoreSource. + * @member {google.cloud.discoveryengine.v1alpha.IFirestoreSource|null|undefined} firestoreSource + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * @instance + */ + ImportDocumentsRequest.prototype.firestoreSource = null; - /** - * Decodes a Content message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.discoveryengine.v1alpha.Document.Content - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.discoveryengine.v1alpha.Document.Content} Content - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Content.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.Document.Content(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: { - message.rawBytes = reader.bytes(); - break; - } - case 3: { - message.uri = reader.string(); - break; - } - case 1: { - message.mimeType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * ImportDocumentsRequest bigtableSource. + * @member {google.cloud.discoveryengine.v1alpha.IBigtableSource|null|undefined} bigtableSource + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * @instance + */ + ImportDocumentsRequest.prototype.bigtableSource = null; - /** - * Decodes a Content message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.Document.Content - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.discoveryengine.v1alpha.Document.Content} Content - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Content.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * ImportDocumentsRequest parent. + * @member {string} parent + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * @instance + */ + ImportDocumentsRequest.prototype.parent = ""; - /** - * Verifies a Content message. - * @function verify - * @memberof google.cloud.discoveryengine.v1alpha.Document.Content - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Content.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.rawBytes != null && message.hasOwnProperty("rawBytes")) { - properties.content = 1; - if (!(message.rawBytes && typeof message.rawBytes.length === "number" || $util.isString(message.rawBytes))) - return "rawBytes: buffer expected"; - } - if (message.uri != null && message.hasOwnProperty("uri")) { - if (properties.content === 1) - return "content: multiple values"; - properties.content = 1; - if (!$util.isString(message.uri)) - return "uri: string expected"; - } - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - if (!$util.isString(message.mimeType)) - return "mimeType: string expected"; - return null; - }; + /** + * ImportDocumentsRequest errorConfig. + * @member {google.cloud.discoveryengine.v1alpha.IImportErrorConfig|null|undefined} errorConfig + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * @instance + */ + ImportDocumentsRequest.prototype.errorConfig = null; - /** - * Creates a Content message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.discoveryengine.v1alpha.Document.Content - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.discoveryengine.v1alpha.Document.Content} Content - */ - Content.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.discoveryengine.v1alpha.Document.Content) - return object; - var message = new $root.google.cloud.discoveryengine.v1alpha.Document.Content(); - if (object.rawBytes != null) - if (typeof object.rawBytes === "string") - $util.base64.decode(object.rawBytes, message.rawBytes = $util.newBuffer($util.base64.length(object.rawBytes)), 0); - else if (object.rawBytes.length >= 0) - message.rawBytes = object.rawBytes; - if (object.uri != null) - message.uri = String(object.uri); - if (object.mimeType != null) - message.mimeType = String(object.mimeType); - return message; - }; + /** + * ImportDocumentsRequest reconciliationMode. + * @member {google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode} reconciliationMode + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * @instance + */ + ImportDocumentsRequest.prototype.reconciliationMode = 0; - /** - * Creates a plain object from a Content message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.discoveryengine.v1alpha.Document.Content - * @static - * @param {google.cloud.discoveryengine.v1alpha.Document.Content} message Content - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + /** + * ImportDocumentsRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * @instance + */ + ImportDocumentsRequest.prototype.updateMask = null; + + /** + * ImportDocumentsRequest autoGenerateIds. + * @member {boolean} autoGenerateIds + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * @instance + */ + ImportDocumentsRequest.prototype.autoGenerateIds = false; + + /** + * ImportDocumentsRequest idField. + * @member {string} idField + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * @instance + */ + ImportDocumentsRequest.prototype.idField = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImportDocumentsRequest source. + * @member {"inlineSource"|"gcsSource"|"bigquerySource"|"fhirStoreSource"|"spannerSource"|"cloudSqlSource"|"firestoreSource"|"bigtableSource"|undefined} source + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * @instance + */ + Object.defineProperty(ImportDocumentsRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["inlineSource", "gcsSource", "bigquerySource", "fhirStoreSource", "spannerSource", "cloudSqlSource", "firestoreSource", "bigtableSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImportDocumentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * @static + * @param {google.cloud.discoveryengine.v1alpha.IImportDocumentsRequest=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest} ImportDocumentsRequest instance + */ + ImportDocumentsRequest.create = function create(properties) { + return new ImportDocumentsRequest(properties); + }; + + /** + * Encodes the specified ImportDocumentsRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * @static + * @param {google.cloud.discoveryengine.v1alpha.IImportDocumentsRequest} message ImportDocumentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportDocumentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.inlineSource != null && Object.hasOwnProperty.call(message, "inlineSource")) + $root.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource.encode(message.inlineSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + $root.google.cloud.discoveryengine.v1alpha.GcsSource.encode(message.gcsSource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.bigquerySource != null && Object.hasOwnProperty.call(message, "bigquerySource")) + $root.google.cloud.discoveryengine.v1alpha.BigQuerySource.encode(message.bigquerySource, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.errorConfig != null && Object.hasOwnProperty.call(message, "errorConfig")) + $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.encode(message.errorConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.reconciliationMode != null && Object.hasOwnProperty.call(message, "reconciliationMode")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.reconciliationMode); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.autoGenerateIds != null && Object.hasOwnProperty.call(message, "autoGenerateIds")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.autoGenerateIds); + if (message.idField != null && Object.hasOwnProperty.call(message, "idField")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.idField); + if (message.fhirStoreSource != null && Object.hasOwnProperty.call(message, "fhirStoreSource")) + $root.google.cloud.discoveryengine.v1alpha.FhirStoreSource.encode(message.fhirStoreSource, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.spannerSource != null && Object.hasOwnProperty.call(message, "spannerSource")) + $root.google.cloud.discoveryengine.v1alpha.SpannerSource.encode(message.spannerSource, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.cloudSqlSource != null && Object.hasOwnProperty.call(message, "cloudSqlSource")) + $root.google.cloud.discoveryengine.v1alpha.CloudSqlSource.encode(message.cloudSqlSource, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.firestoreSource != null && Object.hasOwnProperty.call(message, "firestoreSource")) + $root.google.cloud.discoveryengine.v1alpha.FirestoreSource.encode(message.firestoreSource, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.bigtableSource != null && Object.hasOwnProperty.call(message, "bigtableSource")) + $root.google.cloud.discoveryengine.v1alpha.BigtableSource.encode(message.bigtableSource, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportDocumentsRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * @static + * @param {google.cloud.discoveryengine.v1alpha.IImportDocumentsRequest} message ImportDocumentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportDocumentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportDocumentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest} ImportDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportDocumentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.inlineSource = $root.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource.decode(reader, reader.uint32()); + break; + } + case 3: { + message.gcsSource = $root.google.cloud.discoveryengine.v1alpha.GcsSource.decode(reader, reader.uint32()); + break; + } + case 4: { + message.bigquerySource = $root.google.cloud.discoveryengine.v1alpha.BigQuerySource.decode(reader, reader.uint32()); + break; + } + case 10: { + message.fhirStoreSource = $root.google.cloud.discoveryengine.v1alpha.FhirStoreSource.decode(reader, reader.uint32()); + break; + } + case 11: { + message.spannerSource = $root.google.cloud.discoveryengine.v1alpha.SpannerSource.decode(reader, reader.uint32()); + break; + } + case 12: { + message.cloudSqlSource = $root.google.cloud.discoveryengine.v1alpha.CloudSqlSource.decode(reader, reader.uint32()); + break; + } + case 13: { + message.firestoreSource = $root.google.cloud.discoveryengine.v1alpha.FirestoreSource.decode(reader, reader.uint32()); + break; + } + case 15: { + message.bigtableSource = $root.google.cloud.discoveryengine.v1alpha.BigtableSource.decode(reader, reader.uint32()); + break; + } + case 1: { + message.parent = reader.string(); + break; + } + case 5: { + message.errorConfig = $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.reconciliationMode = reader.int32(); + break; + } + case 7: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 8: { + message.autoGenerateIds = reader.bool(); + break; + } + case 9: { + message.idField = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportDocumentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest} ImportDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportDocumentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportDocumentsRequest message. + * @function verify + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportDocumentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.inlineSource != null && message.hasOwnProperty("inlineSource")) { + properties.source = 1; + { + var error = $root.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource.verify(message.inlineSource); + if (error) + return "inlineSource." + error; + } + } + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.discoveryengine.v1alpha.GcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + } + if (message.bigquerySource != null && message.hasOwnProperty("bigquerySource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.discoveryengine.v1alpha.BigQuerySource.verify(message.bigquerySource); + if (error) + return "bigquerySource." + error; + } + } + if (message.fhirStoreSource != null && message.hasOwnProperty("fhirStoreSource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.discoveryengine.v1alpha.FhirStoreSource.verify(message.fhirStoreSource); + if (error) + return "fhirStoreSource." + error; + } + } + if (message.spannerSource != null && message.hasOwnProperty("spannerSource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.discoveryengine.v1alpha.SpannerSource.verify(message.spannerSource); + if (error) + return "spannerSource." + error; + } + } + if (message.cloudSqlSource != null && message.hasOwnProperty("cloudSqlSource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.discoveryengine.v1alpha.CloudSqlSource.verify(message.cloudSqlSource); + if (error) + return "cloudSqlSource." + error; + } + } + if (message.firestoreSource != null && message.hasOwnProperty("firestoreSource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.discoveryengine.v1alpha.FirestoreSource.verify(message.firestoreSource); + if (error) + return "firestoreSource." + error; + } + } + if (message.bigtableSource != null && message.hasOwnProperty("bigtableSource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.discoveryengine.v1alpha.BigtableSource.verify(message.bigtableSource); + if (error) + return "bigtableSource." + error; + } + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.errorConfig != null && message.hasOwnProperty("errorConfig")) { + var error = $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.verify(message.errorConfig); + if (error) + return "errorConfig." + error; + } + if (message.reconciliationMode != null && message.hasOwnProperty("reconciliationMode")) + switch (message.reconciliationMode) { + default: + return "reconciliationMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.autoGenerateIds != null && message.hasOwnProperty("autoGenerateIds")) + if (typeof message.autoGenerateIds !== "boolean") + return "autoGenerateIds: boolean expected"; + if (message.idField != null && message.hasOwnProperty("idField")) + if (!$util.isString(message.idField)) + return "idField: string expected"; + return null; + }; + + /** + * Creates an ImportDocumentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest} ImportDocumentsRequest + */ + ImportDocumentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest) + return object; + var message = new $root.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest(); + if (object.inlineSource != null) { + if (typeof object.inlineSource !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.inlineSource: object expected"); + message.inlineSource = $root.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource.fromObject(object.inlineSource); + } + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.discoveryengine.v1alpha.GcsSource.fromObject(object.gcsSource); + } + if (object.bigquerySource != null) { + if (typeof object.bigquerySource !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.bigquerySource: object expected"); + message.bigquerySource = $root.google.cloud.discoveryengine.v1alpha.BigQuerySource.fromObject(object.bigquerySource); + } + if (object.fhirStoreSource != null) { + if (typeof object.fhirStoreSource !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.fhirStoreSource: object expected"); + message.fhirStoreSource = $root.google.cloud.discoveryengine.v1alpha.FhirStoreSource.fromObject(object.fhirStoreSource); + } + if (object.spannerSource != null) { + if (typeof object.spannerSource !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.spannerSource: object expected"); + message.spannerSource = $root.google.cloud.discoveryengine.v1alpha.SpannerSource.fromObject(object.spannerSource); + } + if (object.cloudSqlSource != null) { + if (typeof object.cloudSqlSource !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.cloudSqlSource: object expected"); + message.cloudSqlSource = $root.google.cloud.discoveryengine.v1alpha.CloudSqlSource.fromObject(object.cloudSqlSource); + } + if (object.firestoreSource != null) { + if (typeof object.firestoreSource !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.firestoreSource: object expected"); + message.firestoreSource = $root.google.cloud.discoveryengine.v1alpha.FirestoreSource.fromObject(object.firestoreSource); + } + if (object.bigtableSource != null) { + if (typeof object.bigtableSource !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.bigtableSource: object expected"); + message.bigtableSource = $root.google.cloud.discoveryengine.v1alpha.BigtableSource.fromObject(object.bigtableSource); + } + if (object.parent != null) + message.parent = String(object.parent); + if (object.errorConfig != null) { + if (typeof object.errorConfig !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.errorConfig: object expected"); + message.errorConfig = $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.fromObject(object.errorConfig); + } + switch (object.reconciliationMode) { + default: + if (typeof object.reconciliationMode === "number") { + message.reconciliationMode = object.reconciliationMode; + break; + } + break; + case "RECONCILIATION_MODE_UNSPECIFIED": + case 0: + message.reconciliationMode = 0; + break; + case "INCREMENTAL": + case 1: + message.reconciliationMode = 1; + break; + case "FULL": + case 2: + message.reconciliationMode = 2; + break; + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.autoGenerateIds != null) + message.autoGenerateIds = Boolean(object.autoGenerateIds); + if (object.idField != null) + message.idField = String(object.idField); + return message; + }; + + /** + * Creates a plain object from an ImportDocumentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * @static + * @param {google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest} message ImportDocumentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportDocumentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.errorConfig = null; + object.reconciliationMode = options.enums === String ? "RECONCILIATION_MODE_UNSPECIFIED" : 0; + object.updateMask = null; + object.autoGenerateIds = false; + object.idField = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.inlineSource != null && message.hasOwnProperty("inlineSource")) { + object.inlineSource = $root.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource.toObject(message.inlineSource, options); + if (options.oneofs) + object.source = "inlineSource"; + } + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.discoveryengine.v1alpha.GcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.source = "gcsSource"; + } + if (message.bigquerySource != null && message.hasOwnProperty("bigquerySource")) { + object.bigquerySource = $root.google.cloud.discoveryengine.v1alpha.BigQuerySource.toObject(message.bigquerySource, options); + if (options.oneofs) + object.source = "bigquerySource"; + } + if (message.errorConfig != null && message.hasOwnProperty("errorConfig")) + object.errorConfig = $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.toObject(message.errorConfig, options); + if (message.reconciliationMode != null && message.hasOwnProperty("reconciliationMode")) + object.reconciliationMode = options.enums === String ? $root.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode[message.reconciliationMode] === undefined ? message.reconciliationMode : $root.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode[message.reconciliationMode] : message.reconciliationMode; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.autoGenerateIds != null && message.hasOwnProperty("autoGenerateIds")) + object.autoGenerateIds = message.autoGenerateIds; + if (message.idField != null && message.hasOwnProperty("idField")) + object.idField = message.idField; + if (message.fhirStoreSource != null && message.hasOwnProperty("fhirStoreSource")) { + object.fhirStoreSource = $root.google.cloud.discoveryengine.v1alpha.FhirStoreSource.toObject(message.fhirStoreSource, options); + if (options.oneofs) + object.source = "fhirStoreSource"; + } + if (message.spannerSource != null && message.hasOwnProperty("spannerSource")) { + object.spannerSource = $root.google.cloud.discoveryengine.v1alpha.SpannerSource.toObject(message.spannerSource, options); + if (options.oneofs) + object.source = "spannerSource"; + } + if (message.cloudSqlSource != null && message.hasOwnProperty("cloudSqlSource")) { + object.cloudSqlSource = $root.google.cloud.discoveryengine.v1alpha.CloudSqlSource.toObject(message.cloudSqlSource, options); + if (options.oneofs) + object.source = "cloudSqlSource"; + } + if (message.firestoreSource != null && message.hasOwnProperty("firestoreSource")) { + object.firestoreSource = $root.google.cloud.discoveryengine.v1alpha.FirestoreSource.toObject(message.firestoreSource, options); + if (options.oneofs) + object.source = "firestoreSource"; + } + if (message.bigtableSource != null && message.hasOwnProperty("bigtableSource")) { + object.bigtableSource = $root.google.cloud.discoveryengine.v1alpha.BigtableSource.toObject(message.bigtableSource, options); + if (options.oneofs) + object.source = "bigtableSource"; + } + return object; + }; + + /** + * Converts this ImportDocumentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * @instance + * @returns {Object.} JSON object + */ + ImportDocumentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportDocumentsRequest + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportDocumentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest"; + }; + + ImportDocumentsRequest.InlineSource = (function() { + + /** + * Properties of an InlineSource. + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * @interface IInlineSource + * @property {Array.|null} [documents] InlineSource documents + */ + + /** + * Constructs a new InlineSource. + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest + * @classdesc Represents an InlineSource. + * @implements IInlineSource + * @constructor + * @param {google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.IInlineSource=} [properties] Properties to set + */ + function InlineSource(properties) { + this.documents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InlineSource documents. + * @member {Array.} documents + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + * @instance + */ + InlineSource.prototype.documents = $util.emptyArray; + + /** + * Creates a new InlineSource instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + * @static + * @param {google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.IInlineSource=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource} InlineSource instance + */ + InlineSource.create = function create(properties) { + return new InlineSource(properties); + }; + + /** + * Encodes the specified InlineSource message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + * @static + * @param {google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.IInlineSource} message InlineSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InlineSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documents != null && message.documents.length) + for (var i = 0; i < message.documents.length; ++i) + $root.google.cloud.discoveryengine.v1alpha.Document.encode(message.documents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InlineSource message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + * @static + * @param {google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.IInlineSource} message InlineSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InlineSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InlineSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource} InlineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InlineSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.documents && message.documents.length)) + message.documents = []; + message.documents.push($root.google.cloud.discoveryengine.v1alpha.Document.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InlineSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource} InlineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InlineSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InlineSource message. + * @function verify + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InlineSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documents != null && message.hasOwnProperty("documents")) { + if (!Array.isArray(message.documents)) + return "documents: array expected"; + for (var i = 0; i < message.documents.length; ++i) { + var error = $root.google.cloud.discoveryengine.v1alpha.Document.verify(message.documents[i]); + if (error) + return "documents." + error; + } + } + return null; + }; + + /** + * Creates an InlineSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource} InlineSource + */ + InlineSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource) + return object; + var message = new $root.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource(); + if (object.documents) { + if (!Array.isArray(object.documents)) + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource.documents: array expected"); + message.documents = []; + for (var i = 0; i < object.documents.length; ++i) { + if (typeof object.documents[i] !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource.documents: object expected"); + message.documents[i] = $root.google.cloud.discoveryengine.v1alpha.Document.fromObject(object.documents[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an InlineSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + * @static + * @param {google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource} message InlineSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InlineSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.documents = []; + if (message.documents && message.documents.length) { + object.documents = []; + for (var j = 0; j < message.documents.length; ++j) + object.documents[j] = $root.google.cloud.discoveryengine.v1alpha.Document.toObject(message.documents[j], options); + } + return object; + }; + + /** + * Converts this InlineSource to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + * @instance + * @returns {Object.} JSON object + */ + InlineSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InlineSource + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InlineSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.InlineSource"; + }; + + return InlineSource; + })(); + + /** + * ReconciliationMode enum. + * @name google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode + * @enum {number} + * @property {number} RECONCILIATION_MODE_UNSPECIFIED=0 RECONCILIATION_MODE_UNSPECIFIED value + * @property {number} INCREMENTAL=1 INCREMENTAL value + * @property {number} FULL=2 FULL value + */ + ImportDocumentsRequest.ReconciliationMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RECONCILIATION_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INCREMENTAL"] = 1; + values[valuesById[2] = "FULL"] = 2; + return values; + })(); + + return ImportDocumentsRequest; + })(); + + v1alpha.ImportDocumentsResponse = (function() { + + /** + * Properties of an ImportDocumentsResponse. + * @memberof google.cloud.discoveryengine.v1alpha + * @interface IImportDocumentsResponse + * @property {Array.|null} [errorSamples] ImportDocumentsResponse errorSamples + * @property {google.cloud.discoveryengine.v1alpha.IImportErrorConfig|null} [errorConfig] ImportDocumentsResponse errorConfig + */ + + /** + * Constructs a new ImportDocumentsResponse. + * @memberof google.cloud.discoveryengine.v1alpha + * @classdesc Represents an ImportDocumentsResponse. + * @implements IImportDocumentsResponse + * @constructor + * @param {google.cloud.discoveryengine.v1alpha.IImportDocumentsResponse=} [properties] Properties to set + */ + function ImportDocumentsResponse(properties) { + this.errorSamples = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportDocumentsResponse errorSamples. + * @member {Array.} errorSamples + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse + * @instance + */ + ImportDocumentsResponse.prototype.errorSamples = $util.emptyArray; + + /** + * ImportDocumentsResponse errorConfig. + * @member {google.cloud.discoveryengine.v1alpha.IImportErrorConfig|null|undefined} errorConfig + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse + * @instance + */ + ImportDocumentsResponse.prototype.errorConfig = null; + + /** + * Creates a new ImportDocumentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse + * @static + * @param {google.cloud.discoveryengine.v1alpha.IImportDocumentsResponse=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse} ImportDocumentsResponse instance + */ + ImportDocumentsResponse.create = function create(properties) { + return new ImportDocumentsResponse(properties); + }; + + /** + * Encodes the specified ImportDocumentsResponse message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse + * @static + * @param {google.cloud.discoveryengine.v1alpha.IImportDocumentsResponse} message ImportDocumentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportDocumentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.errorSamples != null && message.errorSamples.length) + for (var i = 0; i < message.errorSamples.length; ++i) + $root.google.rpc.Status.encode(message.errorSamples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.errorConfig != null && Object.hasOwnProperty.call(message, "errorConfig")) + $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.encode(message.errorConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportDocumentsResponse message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse + * @static + * @param {google.cloud.discoveryengine.v1alpha.IImportDocumentsResponse} message ImportDocumentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportDocumentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportDocumentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse} ImportDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportDocumentsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.errorSamples && message.errorSamples.length)) + message.errorSamples = []; + message.errorSamples.push($root.google.rpc.Status.decode(reader, reader.uint32())); + break; + } + case 2: { + message.errorConfig = $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportDocumentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse} ImportDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportDocumentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportDocumentsResponse message. + * @function verify + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportDocumentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.errorSamples != null && message.hasOwnProperty("errorSamples")) { + if (!Array.isArray(message.errorSamples)) + return "errorSamples: array expected"; + for (var i = 0; i < message.errorSamples.length; ++i) { + var error = $root.google.rpc.Status.verify(message.errorSamples[i]); + if (error) + return "errorSamples." + error; + } + } + if (message.errorConfig != null && message.hasOwnProperty("errorConfig")) { + var error = $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.verify(message.errorConfig); + if (error) + return "errorConfig." + error; + } + return null; + }; + + /** + * Creates an ImportDocumentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse} ImportDocumentsResponse + */ + ImportDocumentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse) + return object; + var message = new $root.google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse(); + if (object.errorSamples) { + if (!Array.isArray(object.errorSamples)) + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse.errorSamples: array expected"); + message.errorSamples = []; + for (var i = 0; i < object.errorSamples.length; ++i) { + if (typeof object.errorSamples[i] !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse.errorSamples: object expected"); + message.errorSamples[i] = $root.google.rpc.Status.fromObject(object.errorSamples[i]); + } + } + if (object.errorConfig != null) { + if (typeof object.errorConfig !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse.errorConfig: object expected"); + message.errorConfig = $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.fromObject(object.errorConfig); + } + return message; + }; + + /** + * Creates a plain object from an ImportDocumentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse + * @static + * @param {google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse} message ImportDocumentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportDocumentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.errorSamples = []; + if (options.defaults) + object.errorConfig = null; + if (message.errorSamples && message.errorSamples.length) { + object.errorSamples = []; + for (var j = 0; j < message.errorSamples.length; ++j) + object.errorSamples[j] = $root.google.rpc.Status.toObject(message.errorSamples[j], options); + } + if (message.errorConfig != null && message.hasOwnProperty("errorConfig")) + object.errorConfig = $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.toObject(message.errorConfig, options); + return object; + }; + + /** + * Converts this ImportDocumentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse + * @instance + * @returns {Object.} JSON object + */ + ImportDocumentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportDocumentsResponse + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportDocumentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.ImportDocumentsResponse"; + }; + + return ImportDocumentsResponse; + })(); + + v1alpha.ImportSuggestionDenyListEntriesRequest = (function() { + + /** + * Properties of an ImportSuggestionDenyListEntriesRequest. + * @memberof google.cloud.discoveryengine.v1alpha + * @interface IImportSuggestionDenyListEntriesRequest + * @property {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.IInlineSource|null} [inlineSource] ImportSuggestionDenyListEntriesRequest inlineSource + * @property {google.cloud.discoveryengine.v1alpha.IGcsSource|null} [gcsSource] ImportSuggestionDenyListEntriesRequest gcsSource + * @property {string|null} [parent] ImportSuggestionDenyListEntriesRequest parent + */ + + /** + * Constructs a new ImportSuggestionDenyListEntriesRequest. + * @memberof google.cloud.discoveryengine.v1alpha + * @classdesc Represents an ImportSuggestionDenyListEntriesRequest. + * @implements IImportSuggestionDenyListEntriesRequest + * @constructor + * @param {google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesRequest=} [properties] Properties to set + */ + function ImportSuggestionDenyListEntriesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportSuggestionDenyListEntriesRequest inlineSource. + * @member {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.IInlineSource|null|undefined} inlineSource + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest + * @instance + */ + ImportSuggestionDenyListEntriesRequest.prototype.inlineSource = null; + + /** + * ImportSuggestionDenyListEntriesRequest gcsSource. + * @member {google.cloud.discoveryengine.v1alpha.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest + * @instance + */ + ImportSuggestionDenyListEntriesRequest.prototype.gcsSource = null; + + /** + * ImportSuggestionDenyListEntriesRequest parent. + * @member {string} parent + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest + * @instance + */ + ImportSuggestionDenyListEntriesRequest.prototype.parent = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImportSuggestionDenyListEntriesRequest source. + * @member {"inlineSource"|"gcsSource"|undefined} source + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest + * @instance + */ + Object.defineProperty(ImportSuggestionDenyListEntriesRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["inlineSource", "gcsSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImportSuggestionDenyListEntriesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest + * @static + * @param {google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesRequest=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest} ImportSuggestionDenyListEntriesRequest instance + */ + ImportSuggestionDenyListEntriesRequest.create = function create(properties) { + return new ImportSuggestionDenyListEntriesRequest(properties); + }; + + /** + * Encodes the specified ImportSuggestionDenyListEntriesRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest + * @static + * @param {google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesRequest} message ImportSuggestionDenyListEntriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportSuggestionDenyListEntriesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.inlineSource != null && Object.hasOwnProperty.call(message, "inlineSource")) + $root.google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource.encode(message.inlineSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + $root.google.cloud.discoveryengine.v1alpha.GcsSource.encode(message.gcsSource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportSuggestionDenyListEntriesRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest + * @static + * @param {google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesRequest} message ImportSuggestionDenyListEntriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportSuggestionDenyListEntriesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportSuggestionDenyListEntriesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest} ImportSuggestionDenyListEntriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportSuggestionDenyListEntriesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.inlineSource = $root.google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource.decode(reader, reader.uint32()); + break; + } + case 3: { + message.gcsSource = $root.google.cloud.discoveryengine.v1alpha.GcsSource.decode(reader, reader.uint32()); + break; + } + case 1: { + message.parent = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportSuggestionDenyListEntriesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest} ImportSuggestionDenyListEntriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportSuggestionDenyListEntriesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportSuggestionDenyListEntriesRequest message. + * @function verify + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportSuggestionDenyListEntriesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.inlineSource != null && message.hasOwnProperty("inlineSource")) { + properties.source = 1; + { + var error = $root.google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource.verify(message.inlineSource); + if (error) + return "inlineSource." + error; + } + } + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.discoveryengine.v1alpha.GcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + return null; + }; + + /** + * Creates an ImportSuggestionDenyListEntriesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest} ImportSuggestionDenyListEntriesRequest + */ + ImportSuggestionDenyListEntriesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest) + return object; + var message = new $root.google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest(); + if (object.inlineSource != null) { + if (typeof object.inlineSource !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.inlineSource: object expected"); + message.inlineSource = $root.google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource.fromObject(object.inlineSource); + } + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.discoveryengine.v1alpha.GcsSource.fromObject(object.gcsSource); + } + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; + + /** + * Creates a plain object from an ImportSuggestionDenyListEntriesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest + * @static + * @param {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest} message ImportSuggestionDenyListEntriesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportSuggestionDenyListEntriesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.inlineSource != null && message.hasOwnProperty("inlineSource")) { + object.inlineSource = $root.google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource.toObject(message.inlineSource, options); + if (options.oneofs) + object.source = "inlineSource"; + } + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.discoveryengine.v1alpha.GcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.source = "gcsSource"; + } + return object; + }; + + /** + * Converts this ImportSuggestionDenyListEntriesRequest to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest + * @instance + * @returns {Object.} JSON object + */ + ImportSuggestionDenyListEntriesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportSuggestionDenyListEntriesRequest + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportSuggestionDenyListEntriesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest"; + }; + + ImportSuggestionDenyListEntriesRequest.InlineSource = (function() { + + /** + * Properties of an InlineSource. + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest + * @interface IInlineSource + * @property {Array.|null} [entries] InlineSource entries + */ + + /** + * Constructs a new InlineSource. + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest + * @classdesc Represents an InlineSource. + * @implements IInlineSource + * @constructor + * @param {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.IInlineSource=} [properties] Properties to set + */ + function InlineSource(properties) { + this.entries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InlineSource entries. + * @member {Array.} entries + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource + * @instance + */ + InlineSource.prototype.entries = $util.emptyArray; + + /** + * Creates a new InlineSource instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource + * @static + * @param {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.IInlineSource=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource} InlineSource instance + */ + InlineSource.create = function create(properties) { + return new InlineSource(properties); + }; + + /** + * Encodes the specified InlineSource message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource + * @static + * @param {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.IInlineSource} message InlineSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InlineSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entries != null && message.entries.length) + for (var i = 0; i < message.entries.length; ++i) + $root.google.cloud.discoveryengine.v1alpha.SuggestionDenyListEntry.encode(message.entries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InlineSource message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource + * @static + * @param {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.IInlineSource} message InlineSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InlineSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InlineSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource} InlineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InlineSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.entries && message.entries.length)) + message.entries = []; + message.entries.push($root.google.cloud.discoveryengine.v1alpha.SuggestionDenyListEntry.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InlineSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource} InlineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InlineSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InlineSource message. + * @function verify + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InlineSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entries != null && message.hasOwnProperty("entries")) { + if (!Array.isArray(message.entries)) + return "entries: array expected"; + for (var i = 0; i < message.entries.length; ++i) { + var error = $root.google.cloud.discoveryengine.v1alpha.SuggestionDenyListEntry.verify(message.entries[i]); + if (error) + return "entries." + error; + } + } + return null; + }; + + /** + * Creates an InlineSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource} InlineSource + */ + InlineSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource) + return object; + var message = new $root.google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource(); + if (object.entries) { + if (!Array.isArray(object.entries)) + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource.entries: array expected"); + message.entries = []; + for (var i = 0; i < object.entries.length; ++i) { + if (typeof object.entries[i] !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource.entries: object expected"); + message.entries[i] = $root.google.cloud.discoveryengine.v1alpha.SuggestionDenyListEntry.fromObject(object.entries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an InlineSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource + * @static + * @param {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource} message InlineSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InlineSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entries = []; + if (message.entries && message.entries.length) { + object.entries = []; + for (var j = 0; j < message.entries.length; ++j) + object.entries[j] = $root.google.cloud.discoveryengine.v1alpha.SuggestionDenyListEntry.toObject(message.entries[j], options); + } + return object; + }; + + /** + * Converts this InlineSource to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource + * @instance + * @returns {Object.} JSON object + */ + InlineSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InlineSource + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InlineSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesRequest.InlineSource"; + }; + + return InlineSource; + })(); + + return ImportSuggestionDenyListEntriesRequest; + })(); + + v1alpha.ImportSuggestionDenyListEntriesResponse = (function() { + + /** + * Properties of an ImportSuggestionDenyListEntriesResponse. + * @memberof google.cloud.discoveryengine.v1alpha + * @interface IImportSuggestionDenyListEntriesResponse + * @property {Array.|null} [errorSamples] ImportSuggestionDenyListEntriesResponse errorSamples + * @property {number|Long|null} [importedEntriesCount] ImportSuggestionDenyListEntriesResponse importedEntriesCount + * @property {number|Long|null} [failedEntriesCount] ImportSuggestionDenyListEntriesResponse failedEntriesCount + */ + + /** + * Constructs a new ImportSuggestionDenyListEntriesResponse. + * @memberof google.cloud.discoveryengine.v1alpha + * @classdesc Represents an ImportSuggestionDenyListEntriesResponse. + * @implements IImportSuggestionDenyListEntriesResponse + * @constructor + * @param {google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesResponse=} [properties] Properties to set + */ + function ImportSuggestionDenyListEntriesResponse(properties) { + this.errorSamples = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportSuggestionDenyListEntriesResponse errorSamples. + * @member {Array.} errorSamples + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse + * @instance + */ + ImportSuggestionDenyListEntriesResponse.prototype.errorSamples = $util.emptyArray; + + /** + * ImportSuggestionDenyListEntriesResponse importedEntriesCount. + * @member {number|Long} importedEntriesCount + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse + * @instance + */ + ImportSuggestionDenyListEntriesResponse.prototype.importedEntriesCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ImportSuggestionDenyListEntriesResponse failedEntriesCount. + * @member {number|Long} failedEntriesCount + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse + * @instance + */ + ImportSuggestionDenyListEntriesResponse.prototype.failedEntriesCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ImportSuggestionDenyListEntriesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse + * @static + * @param {google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesResponse=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse} ImportSuggestionDenyListEntriesResponse instance + */ + ImportSuggestionDenyListEntriesResponse.create = function create(properties) { + return new ImportSuggestionDenyListEntriesResponse(properties); + }; + + /** + * Encodes the specified ImportSuggestionDenyListEntriesResponse message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse + * @static + * @param {google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesResponse} message ImportSuggestionDenyListEntriesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportSuggestionDenyListEntriesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.errorSamples != null && message.errorSamples.length) + for (var i = 0; i < message.errorSamples.length; ++i) + $root.google.rpc.Status.encode(message.errorSamples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.importedEntriesCount != null && Object.hasOwnProperty.call(message, "importedEntriesCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.importedEntriesCount); + if (message.failedEntriesCount != null && Object.hasOwnProperty.call(message, "failedEntriesCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.failedEntriesCount); + return writer; + }; + + /** + * Encodes the specified ImportSuggestionDenyListEntriesResponse message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse + * @static + * @param {google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesResponse} message ImportSuggestionDenyListEntriesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportSuggestionDenyListEntriesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportSuggestionDenyListEntriesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse} ImportSuggestionDenyListEntriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportSuggestionDenyListEntriesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.errorSamples && message.errorSamples.length)) + message.errorSamples = []; + message.errorSamples.push($root.google.rpc.Status.decode(reader, reader.uint32())); + break; + } + case 2: { + message.importedEntriesCount = reader.int64(); + break; + } + case 3: { + message.failedEntriesCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportSuggestionDenyListEntriesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse} ImportSuggestionDenyListEntriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportSuggestionDenyListEntriesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportSuggestionDenyListEntriesResponse message. + * @function verify + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportSuggestionDenyListEntriesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.errorSamples != null && message.hasOwnProperty("errorSamples")) { + if (!Array.isArray(message.errorSamples)) + return "errorSamples: array expected"; + for (var i = 0; i < message.errorSamples.length; ++i) { + var error = $root.google.rpc.Status.verify(message.errorSamples[i]); + if (error) + return "errorSamples." + error; + } + } + if (message.importedEntriesCount != null && message.hasOwnProperty("importedEntriesCount")) + if (!$util.isInteger(message.importedEntriesCount) && !(message.importedEntriesCount && $util.isInteger(message.importedEntriesCount.low) && $util.isInteger(message.importedEntriesCount.high))) + return "importedEntriesCount: integer|Long expected"; + if (message.failedEntriesCount != null && message.hasOwnProperty("failedEntriesCount")) + if (!$util.isInteger(message.failedEntriesCount) && !(message.failedEntriesCount && $util.isInteger(message.failedEntriesCount.low) && $util.isInteger(message.failedEntriesCount.high))) + return "failedEntriesCount: integer|Long expected"; + return null; + }; + + /** + * Creates an ImportSuggestionDenyListEntriesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse} ImportSuggestionDenyListEntriesResponse + */ + ImportSuggestionDenyListEntriesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse) + return object; + var message = new $root.google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse(); + if (object.errorSamples) { + if (!Array.isArray(object.errorSamples)) + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse.errorSamples: array expected"); + message.errorSamples = []; + for (var i = 0; i < object.errorSamples.length; ++i) { + if (typeof object.errorSamples[i] !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse.errorSamples: object expected"); + message.errorSamples[i] = $root.google.rpc.Status.fromObject(object.errorSamples[i]); + } + } + if (object.importedEntriesCount != null) + if ($util.Long) + (message.importedEntriesCount = $util.Long.fromValue(object.importedEntriesCount)).unsigned = false; + else if (typeof object.importedEntriesCount === "string") + message.importedEntriesCount = parseInt(object.importedEntriesCount, 10); + else if (typeof object.importedEntriesCount === "number") + message.importedEntriesCount = object.importedEntriesCount; + else if (typeof object.importedEntriesCount === "object") + message.importedEntriesCount = new $util.LongBits(object.importedEntriesCount.low >>> 0, object.importedEntriesCount.high >>> 0).toNumber(); + if (object.failedEntriesCount != null) + if ($util.Long) + (message.failedEntriesCount = $util.Long.fromValue(object.failedEntriesCount)).unsigned = false; + else if (typeof object.failedEntriesCount === "string") + message.failedEntriesCount = parseInt(object.failedEntriesCount, 10); + else if (typeof object.failedEntriesCount === "number") + message.failedEntriesCount = object.failedEntriesCount; + else if (typeof object.failedEntriesCount === "object") + message.failedEntriesCount = new $util.LongBits(object.failedEntriesCount.low >>> 0, object.failedEntriesCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an ImportSuggestionDenyListEntriesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse + * @static + * @param {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse} message ImportSuggestionDenyListEntriesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportSuggestionDenyListEntriesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.errorSamples = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.importedEntriesCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.importedEntriesCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.failedEntriesCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.failedEntriesCount = options.longs === String ? "0" : 0; + } + if (message.errorSamples && message.errorSamples.length) { + object.errorSamples = []; + for (var j = 0; j < message.errorSamples.length; ++j) + object.errorSamples[j] = $root.google.rpc.Status.toObject(message.errorSamples[j], options); + } + if (message.importedEntriesCount != null && message.hasOwnProperty("importedEntriesCount")) + if (typeof message.importedEntriesCount === "number") + object.importedEntriesCount = options.longs === String ? String(message.importedEntriesCount) : message.importedEntriesCount; + else + object.importedEntriesCount = options.longs === String ? $util.Long.prototype.toString.call(message.importedEntriesCount) : options.longs === Number ? new $util.LongBits(message.importedEntriesCount.low >>> 0, message.importedEntriesCount.high >>> 0).toNumber() : message.importedEntriesCount; + if (message.failedEntriesCount != null && message.hasOwnProperty("failedEntriesCount")) + if (typeof message.failedEntriesCount === "number") + object.failedEntriesCount = options.longs === String ? String(message.failedEntriesCount) : message.failedEntriesCount; + else + object.failedEntriesCount = options.longs === String ? $util.Long.prototype.toString.call(message.failedEntriesCount) : options.longs === Number ? new $util.LongBits(message.failedEntriesCount.low >>> 0, message.failedEntriesCount.high >>> 0).toNumber() : message.failedEntriesCount; + return object; + }; + + /** + * Converts this ImportSuggestionDenyListEntriesResponse to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse + * @instance + * @returns {Object.} JSON object + */ + ImportSuggestionDenyListEntriesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportSuggestionDenyListEntriesResponse + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportSuggestionDenyListEntriesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesResponse"; + }; + + return ImportSuggestionDenyListEntriesResponse; + })(); + + v1alpha.ImportSuggestionDenyListEntriesMetadata = (function() { + + /** + * Properties of an ImportSuggestionDenyListEntriesMetadata. + * @memberof google.cloud.discoveryengine.v1alpha + * @interface IImportSuggestionDenyListEntriesMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] ImportSuggestionDenyListEntriesMetadata createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ImportSuggestionDenyListEntriesMetadata updateTime + */ + + /** + * Constructs a new ImportSuggestionDenyListEntriesMetadata. + * @memberof google.cloud.discoveryengine.v1alpha + * @classdesc Represents an ImportSuggestionDenyListEntriesMetadata. + * @implements IImportSuggestionDenyListEntriesMetadata + * @constructor + * @param {google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesMetadata=} [properties] Properties to set + */ + function ImportSuggestionDenyListEntriesMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportSuggestionDenyListEntriesMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata + * @instance + */ + ImportSuggestionDenyListEntriesMetadata.prototype.createTime = null; + + /** + * ImportSuggestionDenyListEntriesMetadata updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata + * @instance + */ + ImportSuggestionDenyListEntriesMetadata.prototype.updateTime = null; + + /** + * Creates a new ImportSuggestionDenyListEntriesMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata + * @static + * @param {google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesMetadata=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata} ImportSuggestionDenyListEntriesMetadata instance + */ + ImportSuggestionDenyListEntriesMetadata.create = function create(properties) { + return new ImportSuggestionDenyListEntriesMetadata(properties); + }; + + /** + * Encodes the specified ImportSuggestionDenyListEntriesMetadata message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata + * @static + * @param {google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesMetadata} message ImportSuggestionDenyListEntriesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportSuggestionDenyListEntriesMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportSuggestionDenyListEntriesMetadata message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata + * @static + * @param {google.cloud.discoveryengine.v1alpha.IImportSuggestionDenyListEntriesMetadata} message ImportSuggestionDenyListEntriesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportSuggestionDenyListEntriesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportSuggestionDenyListEntriesMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata} ImportSuggestionDenyListEntriesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportSuggestionDenyListEntriesMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportSuggestionDenyListEntriesMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata} ImportSuggestionDenyListEntriesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportSuggestionDenyListEntriesMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportSuggestionDenyListEntriesMetadata message. + * @function verify + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportSuggestionDenyListEntriesMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates an ImportSuggestionDenyListEntriesMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata} ImportSuggestionDenyListEntriesMetadata + */ + ImportSuggestionDenyListEntriesMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata) + return object; + var message = new $root.google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from an ImportSuggestionDenyListEntriesMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata + * @static + * @param {google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata} message ImportSuggestionDenyListEntriesMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportSuggestionDenyListEntriesMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.updateTime = null; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this ImportSuggestionDenyListEntriesMetadata to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata + * @instance + * @returns {Object.} JSON object + */ + ImportSuggestionDenyListEntriesMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportSuggestionDenyListEntriesMetadata + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportSuggestionDenyListEntriesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.ImportSuggestionDenyListEntriesMetadata"; + }; + + return ImportSuggestionDenyListEntriesMetadata; + })(); + + v1alpha.ImportCompletionSuggestionsResponse = (function() { + + /** + * Properties of an ImportCompletionSuggestionsResponse. + * @memberof google.cloud.discoveryengine.v1alpha + * @interface IImportCompletionSuggestionsResponse + * @property {Array.|null} [errorSamples] ImportCompletionSuggestionsResponse errorSamples + * @property {number|Long|null} [successCount] ImportCompletionSuggestionsResponse successCount + * @property {number|Long|null} [failureCount] ImportCompletionSuggestionsResponse failureCount + */ + + /** + * Constructs a new ImportCompletionSuggestionsResponse. + * @memberof google.cloud.discoveryengine.v1alpha + * @classdesc Represents an ImportCompletionSuggestionsResponse. + * @implements IImportCompletionSuggestionsResponse + * @constructor + * @param {google.cloud.discoveryengine.v1alpha.IImportCompletionSuggestionsResponse=} [properties] Properties to set + */ + function ImportCompletionSuggestionsResponse(properties) { + this.errorSamples = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportCompletionSuggestionsResponse errorSamples. + * @member {Array.} errorSamples + * @memberof google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsResponse + * @instance + */ + ImportCompletionSuggestionsResponse.prototype.errorSamples = $util.emptyArray; + + /** + * ImportCompletionSuggestionsResponse successCount. + * @member {number|Long} successCount + * @memberof google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsResponse + * @instance + */ + ImportCompletionSuggestionsResponse.prototype.successCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ImportCompletionSuggestionsResponse failureCount. + * @member {number|Long} failureCount + * @memberof google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsResponse + * @instance + */ + ImportCompletionSuggestionsResponse.prototype.failureCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ImportCompletionSuggestionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsResponse + * @static + * @param {google.cloud.discoveryengine.v1alpha.IImportCompletionSuggestionsResponse=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsResponse} ImportCompletionSuggestionsResponse instance + */ + ImportCompletionSuggestionsResponse.create = function create(properties) { + return new ImportCompletionSuggestionsResponse(properties); + }; + + /** + * Encodes the specified ImportCompletionSuggestionsResponse message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsResponse + * @static + * @param {google.cloud.discoveryengine.v1alpha.IImportCompletionSuggestionsResponse} message ImportCompletionSuggestionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportCompletionSuggestionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.errorSamples != null && message.errorSamples.length) + for (var i = 0; i < message.errorSamples.length; ++i) + $root.google.rpc.Status.encode(message.errorSamples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.successCount != null && Object.hasOwnProperty.call(message, "successCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.successCount); + if (message.failureCount != null && Object.hasOwnProperty.call(message, "failureCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.failureCount); + return writer; + }; + + /** + * Encodes the specified ImportCompletionSuggestionsResponse message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsResponse + * @static + * @param {google.cloud.discoveryengine.v1alpha.IImportCompletionSuggestionsResponse} message ImportCompletionSuggestionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportCompletionSuggestionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportCompletionSuggestionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsResponse} ImportCompletionSuggestionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportCompletionSuggestionsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.errorSamples && message.errorSamples.length)) + message.errorSamples = []; + message.errorSamples.push($root.google.rpc.Status.decode(reader, reader.uint32())); + break; + } + case 2: { + message.successCount = reader.int64(); + break; + } + case 3: { + message.failureCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportCompletionSuggestionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsResponse} ImportCompletionSuggestionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportCompletionSuggestionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportCompletionSuggestionsResponse message. + * @function verify + * @memberof google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportCompletionSuggestionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.errorSamples != null && message.hasOwnProperty("errorSamples")) { + if (!Array.isArray(message.errorSamples)) + return "errorSamples: array expected"; + for (var i = 0; i < message.errorSamples.length; ++i) { + var error = $root.google.rpc.Status.verify(message.errorSamples[i]); + if (error) + return "errorSamples." + error; + } + } + if (message.successCount != null && message.hasOwnProperty("successCount")) + if (!$util.isInteger(message.successCount) && !(message.successCount && $util.isInteger(message.successCount.low) && $util.isInteger(message.successCount.high))) + return "successCount: integer|Long expected"; + if (message.failureCount != null && message.hasOwnProperty("failureCount")) + if (!$util.isInteger(message.failureCount) && !(message.failureCount && $util.isInteger(message.failureCount.low) && $util.isInteger(message.failureCount.high))) + return "failureCount: integer|Long expected"; + return null; + }; + + /** + * Creates an ImportCompletionSuggestionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsResponse} ImportCompletionSuggestionsResponse + */ + ImportCompletionSuggestionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsResponse) + return object; + var message = new $root.google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsResponse(); + if (object.errorSamples) { + if (!Array.isArray(object.errorSamples)) + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsResponse.errorSamples: array expected"); + message.errorSamples = []; + for (var i = 0; i < object.errorSamples.length; ++i) { + if (typeof object.errorSamples[i] !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsResponse.errorSamples: object expected"); + message.errorSamples[i] = $root.google.rpc.Status.fromObject(object.errorSamples[i]); + } + } + if (object.successCount != null) + if ($util.Long) + (message.successCount = $util.Long.fromValue(object.successCount)).unsigned = false; + else if (typeof object.successCount === "string") + message.successCount = parseInt(object.successCount, 10); + else if (typeof object.successCount === "number") + message.successCount = object.successCount; + else if (typeof object.successCount === "object") + message.successCount = new $util.LongBits(object.successCount.low >>> 0, object.successCount.high >>> 0).toNumber(); + if (object.failureCount != null) + if ($util.Long) + (message.failureCount = $util.Long.fromValue(object.failureCount)).unsigned = false; + else if (typeof object.failureCount === "string") + message.failureCount = parseInt(object.failureCount, 10); + else if (typeof object.failureCount === "number") + message.failureCount = object.failureCount; + else if (typeof object.failureCount === "object") + message.failureCount = new $util.LongBits(object.failureCount.low >>> 0, object.failureCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an ImportCompletionSuggestionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsResponse + * @static + * @param {google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsResponse} message ImportCompletionSuggestionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportCompletionSuggestionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.errorSamples = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.successCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.successCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.failureCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.failureCount = options.longs === String ? "0" : 0; + } + if (message.errorSamples && message.errorSamples.length) { + object.errorSamples = []; + for (var j = 0; j < message.errorSamples.length; ++j) + object.errorSamples[j] = $root.google.rpc.Status.toObject(message.errorSamples[j], options); + } + if (message.successCount != null && message.hasOwnProperty("successCount")) + if (typeof message.successCount === "number") + object.successCount = options.longs === String ? String(message.successCount) : message.successCount; + else + object.successCount = options.longs === String ? $util.Long.prototype.toString.call(message.successCount) : options.longs === Number ? new $util.LongBits(message.successCount.low >>> 0, message.successCount.high >>> 0).toNumber() : message.successCount; + if (message.failureCount != null && message.hasOwnProperty("failureCount")) + if (typeof message.failureCount === "number") + object.failureCount = options.longs === String ? String(message.failureCount) : message.failureCount; + else + object.failureCount = options.longs === String ? $util.Long.prototype.toString.call(message.failureCount) : options.longs === Number ? new $util.LongBits(message.failureCount.low >>> 0, message.failureCount.high >>> 0).toNumber() : message.failureCount; + return object; + }; + + /** + * Converts this ImportCompletionSuggestionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsResponse + * @instance + * @returns {Object.} JSON object + */ + ImportCompletionSuggestionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportCompletionSuggestionsResponse + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportCompletionSuggestionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsResponse"; + }; + + return ImportCompletionSuggestionsResponse; + })(); + + v1alpha.ImportCompletionSuggestionsMetadata = (function() { + + /** + * Properties of an ImportCompletionSuggestionsMetadata. + * @memberof google.cloud.discoveryengine.v1alpha + * @interface IImportCompletionSuggestionsMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] ImportCompletionSuggestionsMetadata createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ImportCompletionSuggestionsMetadata updateTime + */ + + /** + * Constructs a new ImportCompletionSuggestionsMetadata. + * @memberof google.cloud.discoveryengine.v1alpha + * @classdesc Represents an ImportCompletionSuggestionsMetadata. + * @implements IImportCompletionSuggestionsMetadata + * @constructor + * @param {google.cloud.discoveryengine.v1alpha.IImportCompletionSuggestionsMetadata=} [properties] Properties to set + */ + function ImportCompletionSuggestionsMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportCompletionSuggestionsMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsMetadata + * @instance + */ + ImportCompletionSuggestionsMetadata.prototype.createTime = null; + + /** + * ImportCompletionSuggestionsMetadata updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsMetadata + * @instance + */ + ImportCompletionSuggestionsMetadata.prototype.updateTime = null; + + /** + * Creates a new ImportCompletionSuggestionsMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsMetadata + * @static + * @param {google.cloud.discoveryengine.v1alpha.IImportCompletionSuggestionsMetadata=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsMetadata} ImportCompletionSuggestionsMetadata instance + */ + ImportCompletionSuggestionsMetadata.create = function create(properties) { + return new ImportCompletionSuggestionsMetadata(properties); + }; + + /** + * Encodes the specified ImportCompletionSuggestionsMetadata message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsMetadata + * @static + * @param {google.cloud.discoveryengine.v1alpha.IImportCompletionSuggestionsMetadata} message ImportCompletionSuggestionsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportCompletionSuggestionsMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportCompletionSuggestionsMetadata message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsMetadata + * @static + * @param {google.cloud.discoveryengine.v1alpha.IImportCompletionSuggestionsMetadata} message ImportCompletionSuggestionsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportCompletionSuggestionsMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportCompletionSuggestionsMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsMetadata} ImportCompletionSuggestionsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportCompletionSuggestionsMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportCompletionSuggestionsMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsMetadata} ImportCompletionSuggestionsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportCompletionSuggestionsMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportCompletionSuggestionsMetadata message. + * @function verify + * @memberof google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportCompletionSuggestionsMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates an ImportCompletionSuggestionsMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsMetadata} ImportCompletionSuggestionsMetadata + */ + ImportCompletionSuggestionsMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsMetadata) + return object; + var message = new $root.google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsMetadata.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from an ImportCompletionSuggestionsMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsMetadata + * @static + * @param {google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsMetadata} message ImportCompletionSuggestionsMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportCompletionSuggestionsMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.updateTime = null; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this ImportCompletionSuggestionsMetadata to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsMetadata + * @instance + * @returns {Object.} JSON object + */ + ImportCompletionSuggestionsMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportCompletionSuggestionsMetadata + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportCompletionSuggestionsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.ImportCompletionSuggestionsMetadata"; + }; + + return ImportCompletionSuggestionsMetadata; + })(); + + v1alpha.Document = (function() { + + /** + * Properties of a Document. + * @memberof google.cloud.discoveryengine.v1alpha + * @interface IDocument + * @property {google.protobuf.IStruct|null} [structData] Document structData + * @property {string|null} [jsonData] Document jsonData + * @property {string|null} [name] Document name + * @property {string|null} [id] Document id + * @property {string|null} [schemaId] Document schemaId + * @property {google.cloud.discoveryengine.v1alpha.Document.IContent|null} [content] Document content + * @property {string|null} [parentDocumentId] Document parentDocumentId + * @property {google.protobuf.IStruct|null} [derivedStructData] Document derivedStructData + * @property {google.cloud.discoveryengine.v1alpha.Document.IAclInfo|null} [aclInfo] Document aclInfo + * @property {google.protobuf.ITimestamp|null} [indexTime] Document indexTime + */ + + /** + * Constructs a new Document. + * @memberof google.cloud.discoveryengine.v1alpha + * @classdesc Represents a Document. + * @implements IDocument + * @constructor + * @param {google.cloud.discoveryengine.v1alpha.IDocument=} [properties] Properties to set + */ + function Document(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Document structData. + * @member {google.protobuf.IStruct|null|undefined} structData + * @memberof google.cloud.discoveryengine.v1alpha.Document + * @instance + */ + Document.prototype.structData = null; + + /** + * Document jsonData. + * @member {string|null|undefined} jsonData + * @memberof google.cloud.discoveryengine.v1alpha.Document + * @instance + */ + Document.prototype.jsonData = null; + + /** + * Document name. + * @member {string} name + * @memberof google.cloud.discoveryengine.v1alpha.Document + * @instance + */ + Document.prototype.name = ""; + + /** + * Document id. + * @member {string} id + * @memberof google.cloud.discoveryengine.v1alpha.Document + * @instance + */ + Document.prototype.id = ""; + + /** + * Document schemaId. + * @member {string} schemaId + * @memberof google.cloud.discoveryengine.v1alpha.Document + * @instance + */ + Document.prototype.schemaId = ""; + + /** + * Document content. + * @member {google.cloud.discoveryengine.v1alpha.Document.IContent|null|undefined} content + * @memberof google.cloud.discoveryengine.v1alpha.Document + * @instance + */ + Document.prototype.content = null; + + /** + * Document parentDocumentId. + * @member {string} parentDocumentId + * @memberof google.cloud.discoveryengine.v1alpha.Document + * @instance + */ + Document.prototype.parentDocumentId = ""; + + /** + * Document derivedStructData. + * @member {google.protobuf.IStruct|null|undefined} derivedStructData + * @memberof google.cloud.discoveryengine.v1alpha.Document + * @instance + */ + Document.prototype.derivedStructData = null; + + /** + * Document aclInfo. + * @member {google.cloud.discoveryengine.v1alpha.Document.IAclInfo|null|undefined} aclInfo + * @memberof google.cloud.discoveryengine.v1alpha.Document + * @instance + */ + Document.prototype.aclInfo = null; + + /** + * Document indexTime. + * @member {google.protobuf.ITimestamp|null|undefined} indexTime + * @memberof google.cloud.discoveryengine.v1alpha.Document + * @instance + */ + Document.prototype.indexTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Document data. + * @member {"structData"|"jsonData"|undefined} data + * @memberof google.cloud.discoveryengine.v1alpha.Document + * @instance + */ + Object.defineProperty(Document.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["structData", "jsonData"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Document instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1alpha.Document + * @static + * @param {google.cloud.discoveryengine.v1alpha.IDocument=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.Document} Document instance + */ + Document.create = function create(properties) { + return new Document(properties); + }; + + /** + * Encodes the specified Document message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.Document.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1alpha.Document + * @static + * @param {google.cloud.discoveryengine.v1alpha.IDocument} message Document message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Document.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + if (message.schemaId != null && Object.hasOwnProperty.call(message, "schemaId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.schemaId); + if (message.structData != null && Object.hasOwnProperty.call(message, "structData")) + $root.google.protobuf.Struct.encode(message.structData, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.jsonData != null && Object.hasOwnProperty.call(message, "jsonData")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.jsonData); + if (message.derivedStructData != null && Object.hasOwnProperty.call(message, "derivedStructData")) + $root.google.protobuf.Struct.encode(message.derivedStructData, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.parentDocumentId != null && Object.hasOwnProperty.call(message, "parentDocumentId")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.parentDocumentId); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + $root.google.cloud.discoveryengine.v1alpha.Document.Content.encode(message.content, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.aclInfo != null && Object.hasOwnProperty.call(message, "aclInfo")) + $root.google.cloud.discoveryengine.v1alpha.Document.AclInfo.encode(message.aclInfo, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.indexTime != null && Object.hasOwnProperty.call(message, "indexTime")) + $root.google.protobuf.Timestamp.encode(message.indexTime, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Document message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.Document.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.Document + * @static + * @param {google.cloud.discoveryengine.v1alpha.IDocument} message Document message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Document.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Document message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1alpha.Document + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1alpha.Document} Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Document.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.Document(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.structData = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 5: { + message.jsonData = reader.string(); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.id = reader.string(); + break; + } + case 3: { + message.schemaId = reader.string(); + break; + } + case 10: { + message.content = $root.google.cloud.discoveryengine.v1alpha.Document.Content.decode(reader, reader.uint32()); + break; + } + case 7: { + message.parentDocumentId = reader.string(); + break; + } + case 6: { + message.derivedStructData = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 11: { + message.aclInfo = $root.google.cloud.discoveryengine.v1alpha.Document.AclInfo.decode(reader, reader.uint32()); + break; + } + case 13: { + message.indexTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Document message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.Document + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1alpha.Document} Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Document.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Document message. + * @function verify + * @memberof google.cloud.discoveryengine.v1alpha.Document + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Document.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.structData != null && message.hasOwnProperty("structData")) { + properties.data = 1; + { + var error = $root.google.protobuf.Struct.verify(message.structData); + if (error) + return "structData." + error; + } + } + if (message.jsonData != null && message.hasOwnProperty("jsonData")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + if (!$util.isString(message.jsonData)) + return "jsonData: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.schemaId != null && message.hasOwnProperty("schemaId")) + if (!$util.isString(message.schemaId)) + return "schemaId: string expected"; + if (message.content != null && message.hasOwnProperty("content")) { + var error = $root.google.cloud.discoveryengine.v1alpha.Document.Content.verify(message.content); + if (error) + return "content." + error; + } + if (message.parentDocumentId != null && message.hasOwnProperty("parentDocumentId")) + if (!$util.isString(message.parentDocumentId)) + return "parentDocumentId: string expected"; + if (message.derivedStructData != null && message.hasOwnProperty("derivedStructData")) { + var error = $root.google.protobuf.Struct.verify(message.derivedStructData); + if (error) + return "derivedStructData." + error; + } + if (message.aclInfo != null && message.hasOwnProperty("aclInfo")) { + var error = $root.google.cloud.discoveryengine.v1alpha.Document.AclInfo.verify(message.aclInfo); + if (error) + return "aclInfo." + error; + } + if (message.indexTime != null && message.hasOwnProperty("indexTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.indexTime); + if (error) + return "indexTime." + error; + } + return null; + }; + + /** + * Creates a Document message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1alpha.Document + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1alpha.Document} Document + */ + Document.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.Document) + return object; + var message = new $root.google.cloud.discoveryengine.v1alpha.Document(); + if (object.structData != null) { + if (typeof object.structData !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.Document.structData: object expected"); + message.structData = $root.google.protobuf.Struct.fromObject(object.structData); + } + if (object.jsonData != null) + message.jsonData = String(object.jsonData); + if (object.name != null) + message.name = String(object.name); + if (object.id != null) + message.id = String(object.id); + if (object.schemaId != null) + message.schemaId = String(object.schemaId); + if (object.content != null) { + if (typeof object.content !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.Document.content: object expected"); + message.content = $root.google.cloud.discoveryengine.v1alpha.Document.Content.fromObject(object.content); + } + if (object.parentDocumentId != null) + message.parentDocumentId = String(object.parentDocumentId); + if (object.derivedStructData != null) { + if (typeof object.derivedStructData !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.Document.derivedStructData: object expected"); + message.derivedStructData = $root.google.protobuf.Struct.fromObject(object.derivedStructData); + } + if (object.aclInfo != null) { + if (typeof object.aclInfo !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.Document.aclInfo: object expected"); + message.aclInfo = $root.google.cloud.discoveryengine.v1alpha.Document.AclInfo.fromObject(object.aclInfo); + } + if (object.indexTime != null) { + if (typeof object.indexTime !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.Document.indexTime: object expected"); + message.indexTime = $root.google.protobuf.Timestamp.fromObject(object.indexTime); + } + return message; + }; + + /** + * Creates a plain object from a Document message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1alpha.Document + * @static + * @param {google.cloud.discoveryengine.v1alpha.Document} message Document + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Document.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.id = ""; + object.schemaId = ""; + object.derivedStructData = null; + object.parentDocumentId = ""; + object.content = null; + object.aclInfo = null; + object.indexTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.schemaId != null && message.hasOwnProperty("schemaId")) + object.schemaId = message.schemaId; + if (message.structData != null && message.hasOwnProperty("structData")) { + object.structData = $root.google.protobuf.Struct.toObject(message.structData, options); + if (options.oneofs) + object.data = "structData"; + } + if (message.jsonData != null && message.hasOwnProperty("jsonData")) { + object.jsonData = message.jsonData; + if (options.oneofs) + object.data = "jsonData"; + } + if (message.derivedStructData != null && message.hasOwnProperty("derivedStructData")) + object.derivedStructData = $root.google.protobuf.Struct.toObject(message.derivedStructData, options); + if (message.parentDocumentId != null && message.hasOwnProperty("parentDocumentId")) + object.parentDocumentId = message.parentDocumentId; + if (message.content != null && message.hasOwnProperty("content")) + object.content = $root.google.cloud.discoveryengine.v1alpha.Document.Content.toObject(message.content, options); + if (message.aclInfo != null && message.hasOwnProperty("aclInfo")) + object.aclInfo = $root.google.cloud.discoveryengine.v1alpha.Document.AclInfo.toObject(message.aclInfo, options); + if (message.indexTime != null && message.hasOwnProperty("indexTime")) + object.indexTime = $root.google.protobuf.Timestamp.toObject(message.indexTime, options); + return object; + }; + + /** + * Converts this Document to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1alpha.Document + * @instance + * @returns {Object.} JSON object + */ + Document.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Document + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1alpha.Document + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Document.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.Document"; + }; + + Document.Content = (function() { + + /** + * Properties of a Content. + * @memberof google.cloud.discoveryengine.v1alpha.Document + * @interface IContent + * @property {Uint8Array|null} [rawBytes] Content rawBytes + * @property {string|null} [uri] Content uri + * @property {string|null} [mimeType] Content mimeType + */ + + /** + * Constructs a new Content. + * @memberof google.cloud.discoveryengine.v1alpha.Document + * @classdesc Represents a Content. + * @implements IContent + * @constructor + * @param {google.cloud.discoveryengine.v1alpha.Document.IContent=} [properties] Properties to set + */ + function Content(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Content rawBytes. + * @member {Uint8Array|null|undefined} rawBytes + * @memberof google.cloud.discoveryengine.v1alpha.Document.Content + * @instance + */ + Content.prototype.rawBytes = null; + + /** + * Content uri. + * @member {string|null|undefined} uri + * @memberof google.cloud.discoveryengine.v1alpha.Document.Content + * @instance + */ + Content.prototype.uri = null; + + /** + * Content mimeType. + * @member {string} mimeType + * @memberof google.cloud.discoveryengine.v1alpha.Document.Content + * @instance + */ + Content.prototype.mimeType = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Content content. + * @member {"rawBytes"|"uri"|undefined} content + * @memberof google.cloud.discoveryengine.v1alpha.Document.Content + * @instance + */ + Object.defineProperty(Content.prototype, "content", { + get: $util.oneOfGetter($oneOfFields = ["rawBytes", "uri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Content instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1alpha.Document.Content + * @static + * @param {google.cloud.discoveryengine.v1alpha.Document.IContent=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.Document.Content} Content instance + */ + Content.create = function create(properties) { + return new Content(properties); + }; + + /** + * Encodes the specified Content message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.Document.Content.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1alpha.Document.Content + * @static + * @param {google.cloud.discoveryengine.v1alpha.Document.IContent} message Content message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Content.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mimeType); + if (message.rawBytes != null && Object.hasOwnProperty.call(message, "rawBytes")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.rawBytes); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uri); + return writer; + }; + + /** + * Encodes the specified Content message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.Document.Content.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.Document.Content + * @static + * @param {google.cloud.discoveryengine.v1alpha.Document.IContent} message Content message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Content.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Content message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1alpha.Document.Content + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1alpha.Document.Content} Content + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Content.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.Document.Content(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.rawBytes = reader.bytes(); + break; + } + case 3: { + message.uri = reader.string(); + break; + } + case 1: { + message.mimeType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Content message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.Document.Content + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1alpha.Document.Content} Content + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Content.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Content message. + * @function verify + * @memberof google.cloud.discoveryengine.v1alpha.Document.Content + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Content.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.rawBytes != null && message.hasOwnProperty("rawBytes")) { + properties.content = 1; + if (!(message.rawBytes && typeof message.rawBytes.length === "number" || $util.isString(message.rawBytes))) + return "rawBytes: buffer expected"; + } + if (message.uri != null && message.hasOwnProperty("uri")) { + if (properties.content === 1) + return "content: multiple values"; + properties.content = 1; + if (!$util.isString(message.uri)) + return "uri: string expected"; + } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + return null; + }; + + /** + * Creates a Content message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1alpha.Document.Content + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1alpha.Document.Content} Content + */ + Content.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.Document.Content) + return object; + var message = new $root.google.cloud.discoveryengine.v1alpha.Document.Content(); + if (object.rawBytes != null) + if (typeof object.rawBytes === "string") + $util.base64.decode(object.rawBytes, message.rawBytes = $util.newBuffer($util.base64.length(object.rawBytes)), 0); + else if (object.rawBytes.length >= 0) + message.rawBytes = object.rawBytes; + if (object.uri != null) + message.uri = String(object.uri); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + return message; + }; + + /** + * Creates a plain object from a Content message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1alpha.Document.Content + * @static + * @param {google.cloud.discoveryengine.v1alpha.Document.Content} message Content + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ Content.toObject = function toObject(message, options) { if (!options) @@ -53791,6 +57551,251 @@ return Document; })(); + v1alpha.ProcessedDocument = (function() { + + /** + * Properties of a ProcessedDocument. + * @memberof google.cloud.discoveryengine.v1alpha + * @interface IProcessedDocument + * @property {string|null} [jsonData] ProcessedDocument jsonData + * @property {string|null} [document] ProcessedDocument document + */ + + /** + * Constructs a new ProcessedDocument. + * @memberof google.cloud.discoveryengine.v1alpha + * @classdesc Represents a ProcessedDocument. + * @implements IProcessedDocument + * @constructor + * @param {google.cloud.discoveryengine.v1alpha.IProcessedDocument=} [properties] Properties to set + */ + function ProcessedDocument(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProcessedDocument jsonData. + * @member {string|null|undefined} jsonData + * @memberof google.cloud.discoveryengine.v1alpha.ProcessedDocument + * @instance + */ + ProcessedDocument.prototype.jsonData = null; + + /** + * ProcessedDocument document. + * @member {string} document + * @memberof google.cloud.discoveryengine.v1alpha.ProcessedDocument + * @instance + */ + ProcessedDocument.prototype.document = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ProcessedDocument processedDataFormat. + * @member {"jsonData"|undefined} processedDataFormat + * @memberof google.cloud.discoveryengine.v1alpha.ProcessedDocument + * @instance + */ + Object.defineProperty(ProcessedDocument.prototype, "processedDataFormat", { + get: $util.oneOfGetter($oneOfFields = ["jsonData"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ProcessedDocument instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1alpha.ProcessedDocument + * @static + * @param {google.cloud.discoveryengine.v1alpha.IProcessedDocument=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.ProcessedDocument} ProcessedDocument instance + */ + ProcessedDocument.create = function create(properties) { + return new ProcessedDocument(properties); + }; + + /** + * Encodes the specified ProcessedDocument message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ProcessedDocument.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1alpha.ProcessedDocument + * @static + * @param {google.cloud.discoveryengine.v1alpha.IProcessedDocument} message ProcessedDocument message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessedDocument.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.document); + if (message.jsonData != null && Object.hasOwnProperty.call(message, "jsonData")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.jsonData); + return writer; + }; + + /** + * Encodes the specified ProcessedDocument message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ProcessedDocument.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.ProcessedDocument + * @static + * @param {google.cloud.discoveryengine.v1alpha.IProcessedDocument} message ProcessedDocument message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessedDocument.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProcessedDocument message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1alpha.ProcessedDocument + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1alpha.ProcessedDocument} ProcessedDocument + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessedDocument.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.ProcessedDocument(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.jsonData = reader.string(); + break; + } + case 1: { + message.document = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProcessedDocument message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.ProcessedDocument + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1alpha.ProcessedDocument} ProcessedDocument + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessedDocument.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProcessedDocument message. + * @function verify + * @memberof google.cloud.discoveryengine.v1alpha.ProcessedDocument + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProcessedDocument.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.jsonData != null && message.hasOwnProperty("jsonData")) { + properties.processedDataFormat = 1; + if (!$util.isString(message.jsonData)) + return "jsonData: string expected"; + } + if (message.document != null && message.hasOwnProperty("document")) + if (!$util.isString(message.document)) + return "document: string expected"; + return null; + }; + + /** + * Creates a ProcessedDocument message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1alpha.ProcessedDocument + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1alpha.ProcessedDocument} ProcessedDocument + */ + ProcessedDocument.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.ProcessedDocument) + return object; + var message = new $root.google.cloud.discoveryengine.v1alpha.ProcessedDocument(); + if (object.jsonData != null) + message.jsonData = String(object.jsonData); + if (object.document != null) + message.document = String(object.document); + return message; + }; + + /** + * Creates a plain object from a ProcessedDocument message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1alpha.ProcessedDocument + * @static + * @param {google.cloud.discoveryengine.v1alpha.ProcessedDocument} message ProcessedDocument + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProcessedDocument.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.document = ""; + if (message.document != null && message.hasOwnProperty("document")) + object.document = message.document; + if (message.jsonData != null && message.hasOwnProperty("jsonData")) { + object.jsonData = message.jsonData; + if (options.oneofs) + object.processedDataFormat = "jsonData"; + } + return object; + }; + + /** + * Converts this ProcessedDocument to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1alpha.ProcessedDocument + * @instance + * @returns {Object.} JSON object + */ + ProcessedDocument.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProcessedDocument + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1alpha.ProcessedDocument + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProcessedDocument.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.ProcessedDocument"; + }; + + return ProcessedDocument; + })(); + v1alpha.UserEvent = (function() { /** @@ -63250,6 +67255,7 @@ * @interface IConditionBoostSpec * @property {string|null} [condition] ConditionBoostSpec condition * @property {number|null} [boost] ConditionBoostSpec boost + * @property {google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.IBoostControlSpec|null} [boostControlSpec] ConditionBoostSpec boostControlSpec */ /** @@ -63283,6 +67289,14 @@ */ ConditionBoostSpec.prototype.boost = 0; + /** + * ConditionBoostSpec boostControlSpec. + * @member {google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.IBoostControlSpec|null|undefined} boostControlSpec + * @memberof google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec + * @instance + */ + ConditionBoostSpec.prototype.boostControlSpec = null; + /** * Creates a new ConditionBoostSpec instance using the specified properties. * @function create @@ -63311,6 +67325,8 @@ 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.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.encode(message.boostControlSpec, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -63353,6 +67369,10 @@ message.boost = reader.float(); break; } + case 3: { + message.boostControlSpec = $root.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -63394,6 +67414,11 @@ 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.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify(message.boostControlSpec); + if (error) + return "boostControlSpec." + error; + } return null; }; @@ -63413,6 +67438,11 @@ 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.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.boostControlSpec: object expected"); + message.boostControlSpec = $root.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.fromObject(object.boostControlSpec); + } return message; }; @@ -63432,11 +67462,14 @@ 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.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.toObject(message.boostControlSpec, options); return object; }; @@ -63466,6 +67499,601 @@ return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec"; }; + ConditionBoostSpec.BoostControlSpec = (function() { + + /** + * Properties of a BoostControlSpec. + * @memberof google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec + * @interface IBoostControlSpec + * @property {string|null} [fieldName] BoostControlSpec fieldName + * @property {google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType|null} [attributeType] BoostControlSpec attributeType + * @property {google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType|null} [interpolationType] BoostControlSpec interpolationType + * @property {Array.|null} [controlPoints] BoostControlSpec controlPoints + */ + + /** + * Constructs a new BoostControlSpec. + * @memberof google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec + * @classdesc Represents a BoostControlSpec. + * @implements IBoostControlSpec + * @constructor + * @param {google.cloud.discoveryengine.v1alpha.SearchRequest.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.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @instance + */ + BoostControlSpec.prototype.fieldName = ""; + + /** + * BoostControlSpec attributeType. + * @member {google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType} attributeType + * @memberof google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @instance + */ + BoostControlSpec.prototype.attributeType = 0; + + /** + * BoostControlSpec interpolationType. + * @member {google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType} interpolationType + * @memberof google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @instance + */ + BoostControlSpec.prototype.interpolationType = 0; + + /** + * BoostControlSpec controlPoints. + * @member {Array.} controlPoints + * @memberof google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @instance + */ + BoostControlSpec.prototype.controlPoints = $util.emptyArray; + + /** + * Creates a new BoostControlSpec instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.IBoostControlSpec=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.SearchRequest.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.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {google.cloud.discoveryengine.v1alpha.SearchRequest.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.discoveryengine.v1alpha.SearchRequest.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.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {google.cloud.discoveryengine.v1alpha.SearchRequest.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.discoveryengine.v1alpha.SearchRequest.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.discoveryengine.v1alpha.SearchRequest.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.discoveryengine.v1alpha.SearchRequest.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.discoveryengine.v1alpha.SearchRequest.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.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1alpha.SearchRequest.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.discoveryengine.v1alpha.SearchRequest.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.discoveryengine.v1alpha.SearchRequest.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.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec} BoostControlSpec + */ + BoostControlSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec) + return object; + var message = new $root.google.cloud.discoveryengine.v1alpha.SearchRequest.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.discoveryengine.v1alpha.SearchRequest.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.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.controlPoints: object expected"); + message.controlPoints[i] = $root.google.cloud.discoveryengine.v1alpha.SearchRequest.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.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @static + * @param {google.cloud.discoveryengine.v1alpha.SearchRequest.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.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType[message.attributeType] === undefined ? message.attributeType : $root.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType[message.attributeType] : message.attributeType; + if (message.interpolationType != null && message.hasOwnProperty("interpolationType")) + object.interpolationType = options.enums === String ? $root.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType[message.interpolationType] === undefined ? message.interpolationType : $root.google.cloud.discoveryengine.v1alpha.SearchRequest.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.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.toObject(message.controlPoints[j], options); + } + return object; + }; + + /** + * Converts this BoostControlSpec to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1alpha.SearchRequest.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.discoveryengine.v1alpha.SearchRequest.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.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec"; + }; + + BoostControlSpec.ControlPoint = (function() { + + /** + * Properties of a ControlPoint. + * @memberof google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @interface IControlPoint + * @property {string|null} [attributeValue] ControlPoint attributeValue + * @property {number|null} [boostAmount] ControlPoint boostAmount + */ + + /** + * Constructs a new ControlPoint. + * @memberof google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec + * @classdesc Represents a ControlPoint. + * @implements IControlPoint + * @constructor + * @param {google.cloud.discoveryengine.v1alpha.SearchRequest.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]]; + } + + /** + * ControlPoint attributeValue. + * @member {string} attributeValue + * @memberof google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @instance + */ + ControlPoint.prototype.attributeValue = ""; + + /** + * ControlPoint boostAmount. + * @member {number} boostAmount + * @memberof google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @instance + */ + ControlPoint.prototype.boostAmount = 0; + + /** + * Creates a new ControlPoint instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.IControlPoint=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.SearchRequest.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.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {google.cloud.discoveryengine.v1alpha.SearchRequest.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(); + if (message.attributeValue != null && Object.hasOwnProperty.call(message, "attributeValue")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.attributeValue); + if (message.boostAmount != null && Object.hasOwnProperty.call(message, "boostAmount")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.boostAmount); + return writer; + }; + + /** + * Encodes the specified ControlPoint message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {google.cloud.discoveryengine.v1alpha.SearchRequest.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.discoveryengine.v1alpha.SearchRequest.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.discoveryengine.v1alpha.SearchRequest.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.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.attributeValue = reader.string(); + break; + } + case 2: { + message.boostAmount = reader.float(); + break; + } + 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.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1alpha.SearchRequest.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.discoveryengine.v1alpha.SearchRequest.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"; + if (message.attributeValue != null && message.hasOwnProperty("attributeValue")) + if (!$util.isString(message.attributeValue)) + return "attributeValue: string expected"; + if (message.boostAmount != null && message.hasOwnProperty("boostAmount")) + if (typeof message.boostAmount !== "number") + return "boostAmount: number expected"; + return null; + }; + + /** + * Creates a ControlPoint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} ControlPoint + */ + ControlPoint.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint) + return object; + var message = new $root.google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint(); + if (object.attributeValue != null) + message.attributeValue = String(object.attributeValue); + if (object.boostAmount != null) + message.boostAmount = Number(object.boostAmount); + return message; + }; + + /** + * Creates a plain object from a ControlPoint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint + * @static + * @param {google.cloud.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint} message ControlPoint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ControlPoint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.attributeValue = ""; + object.boostAmount = 0; + } + if (message.attributeValue != null && message.hasOwnProperty("attributeValue")) + object.attributeValue = message.attributeValue; + if (message.boostAmount != null && message.hasOwnProperty("boostAmount")) + object.boostAmount = options.json && !isFinite(message.boostAmount) ? String(message.boostAmount) : message.boostAmount; + return object; + }; + + /** + * Converts this ControlPoint to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1alpha.SearchRequest.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.discoveryengine.v1alpha.SearchRequest.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.discoveryengine.v1alpha.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint"; + }; + + return ControlPoint; + })(); + + /** + * AttributeType enum. + * @name google.cloud.discoveryengine.v1alpha.SearchRequest.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.discoveryengine.v1alpha.SearchRequest.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; + })(); + + return BoostControlSpec; + })(); + return ConditionBoostSpec; })(); @@ -63992,6 +68620,7 @@ * @property {google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ISummarySpec|null} [summarySpec] ContentSearchSpec summarySpec * @property {google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.IExtractiveContentSpec|null} [extractiveContentSpec] ContentSearchSpec extractiveContentSpec * @property {google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SearchResultMode|null} [searchResultMode] ContentSearchSpec searchResultMode + * @property {google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.IChunkSpec|null} [chunkSpec] ContentSearchSpec chunkSpec */ /** @@ -64041,6 +68670,14 @@ */ ContentSearchSpec.prototype.searchResultMode = 0; + /** + * ContentSearchSpec chunkSpec. + * @member {google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.IChunkSpec|null|undefined} chunkSpec + * @memberof google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + * @instance + */ + ContentSearchSpec.prototype.chunkSpec = null; + /** * Creates a new ContentSearchSpec instance using the specified properties. * @function create @@ -64073,6 +68710,8 @@ $root.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ExtractiveContentSpec.encode(message.extractiveContentSpec, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.searchResultMode != null && Object.hasOwnProperty.call(message, "searchResultMode")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.searchResultMode); + if (message.chunkSpec != null && Object.hasOwnProperty.call(message, "chunkSpec")) + $root.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ChunkSpec.encode(message.chunkSpec, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -64123,6 +68762,10 @@ message.searchResultMode = reader.int32(); break; } + case 5: { + message.chunkSpec = $root.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ChunkSpec.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -64182,6 +68825,11 @@ case 2: break; } + if (message.chunkSpec != null && message.hasOwnProperty("chunkSpec")) { + var error = $root.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ChunkSpec.verify(message.chunkSpec); + if (error) + return "chunkSpec." + error; + } return null; }; @@ -64232,6 +68880,11 @@ message.searchResultMode = 2; break; } + if (object.chunkSpec != null) { + if (typeof object.chunkSpec !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.chunkSpec: object expected"); + message.chunkSpec = $root.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ChunkSpec.fromObject(object.chunkSpec); + } return message; }; @@ -64253,6 +68906,7 @@ object.summarySpec = null; object.extractiveContentSpec = null; object.searchResultMode = options.enums === String ? "SEARCH_RESULT_MODE_UNSPECIFIED" : 0; + object.chunkSpec = null; } if (message.snippetSpec != null && message.hasOwnProperty("snippetSpec")) object.snippetSpec = $root.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SnippetSpec.toObject(message.snippetSpec, options); @@ -64262,6 +68916,8 @@ object.extractiveContentSpec = $root.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ExtractiveContentSpec.toObject(message.extractiveContentSpec, options); if (message.searchResultMode != null && message.hasOwnProperty("searchResultMode")) object.searchResultMode = options.enums === String ? $root.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SearchResultMode[message.searchResultMode] === undefined ? message.searchResultMode : $root.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SearchResultMode[message.searchResultMode] : message.searchResultMode; + if (message.chunkSpec != null && message.hasOwnProperty("chunkSpec")) + object.chunkSpec = $root.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ChunkSpec.toObject(message.chunkSpec, options); return object; }; @@ -64554,6 +69210,7 @@ * @property {google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec.IModelPromptSpec|null} [modelPromptSpec] SummarySpec modelPromptSpec * @property {string|null} [languageCode] SummarySpec languageCode * @property {google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec.IModelSpec|null} [modelSpec] SummarySpec modelSpec + * @property {boolean|null} [useSemanticChunks] SummarySpec useSemanticChunks */ /** @@ -64627,6 +69284,14 @@ */ SummarySpec.prototype.modelSpec = null; + /** + * SummarySpec useSemanticChunks. + * @member {boolean} useSemanticChunks + * @memberof google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec + * @instance + */ + SummarySpec.prototype.useSemanticChunks = false; + /** * Creates a new SummarySpec instance using the specified properties. * @function create @@ -64665,6 +69330,8 @@ writer.uint32(/* id 6, wireType 2 =*/50).string(message.languageCode); if (message.modelSpec != null && Object.hasOwnProperty.call(message, "modelSpec")) $root.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec.ModelSpec.encode(message.modelSpec, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.useSemanticChunks != null && Object.hasOwnProperty.call(message, "useSemanticChunks")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.useSemanticChunks); return writer; }; @@ -64727,6 +69394,10 @@ message.modelSpec = $root.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec.ModelSpec.decode(reader, reader.uint32()); break; } + case 8: { + message.useSemanticChunks = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -64787,6 +69458,9 @@ if (error) return "modelSpec." + error; } + if (message.useSemanticChunks != null && message.hasOwnProperty("useSemanticChunks")) + if (typeof message.useSemanticChunks !== "boolean") + return "useSemanticChunks: boolean expected"; return null; }; @@ -64822,6 +69496,8 @@ throw TypeError(".google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec.modelSpec: object expected"); message.modelSpec = $root.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec.ModelSpec.fromObject(object.modelSpec); } + if (object.useSemanticChunks != null) + message.useSemanticChunks = Boolean(object.useSemanticChunks); return message; }; @@ -64846,6 +69522,7 @@ object.modelPromptSpec = null; object.languageCode = ""; object.modelSpec = null; + object.useSemanticChunks = false; } if (message.summaryResultCount != null && message.hasOwnProperty("summaryResultCount")) object.summaryResultCount = message.summaryResultCount; @@ -64861,6 +69538,8 @@ object.languageCode = message.languageCode; if (message.modelSpec != null && message.hasOwnProperty("modelSpec")) object.modelSpec = $root.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec.ModelSpec.toObject(message.modelSpec, options); + if (message.useSemanticChunks != null && message.hasOwnProperty("useSemanticChunks")) + object.useSemanticChunks = message.useSemanticChunks; return object; }; @@ -65595,6 +70274,233 @@ return ExtractiveContentSpec; })(); + ContentSearchSpec.ChunkSpec = (function() { + + /** + * Properties of a ChunkSpec. + * @memberof google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + * @interface IChunkSpec + * @property {number|null} [numPreviousChunks] ChunkSpec numPreviousChunks + * @property {number|null} [numNextChunks] ChunkSpec numNextChunks + */ + + /** + * Constructs a new ChunkSpec. + * @memberof google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec + * @classdesc Represents a ChunkSpec. + * @implements IChunkSpec + * @constructor + * @param {google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.IChunkSpec=} [properties] Properties to set + */ + function ChunkSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChunkSpec numPreviousChunks. + * @member {number} numPreviousChunks + * @memberof google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ChunkSpec + * @instance + */ + ChunkSpec.prototype.numPreviousChunks = 0; + + /** + * ChunkSpec numNextChunks. + * @member {number} numNextChunks + * @memberof google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ChunkSpec + * @instance + */ + ChunkSpec.prototype.numNextChunks = 0; + + /** + * Creates a new ChunkSpec instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ChunkSpec + * @static + * @param {google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.IChunkSpec=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ChunkSpec} ChunkSpec instance + */ + ChunkSpec.create = function create(properties) { + return new ChunkSpec(properties); + }; + + /** + * Encodes the specified ChunkSpec message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ChunkSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ChunkSpec + * @static + * @param {google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.IChunkSpec} message ChunkSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChunkSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.numPreviousChunks != null && Object.hasOwnProperty.call(message, "numPreviousChunks")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.numPreviousChunks); + if (message.numNextChunks != null && Object.hasOwnProperty.call(message, "numNextChunks")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.numNextChunks); + return writer; + }; + + /** + * Encodes the specified ChunkSpec message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ChunkSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ChunkSpec + * @static + * @param {google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.IChunkSpec} message ChunkSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChunkSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChunkSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ChunkSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ChunkSpec} ChunkSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChunkSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ChunkSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.numPreviousChunks = reader.int32(); + break; + } + case 2: { + message.numNextChunks = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChunkSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ChunkSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ChunkSpec} ChunkSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChunkSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChunkSpec message. + * @function verify + * @memberof google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ChunkSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChunkSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.numPreviousChunks != null && message.hasOwnProperty("numPreviousChunks")) + if (!$util.isInteger(message.numPreviousChunks)) + return "numPreviousChunks: integer expected"; + if (message.numNextChunks != null && message.hasOwnProperty("numNextChunks")) + if (!$util.isInteger(message.numNextChunks)) + return "numNextChunks: integer expected"; + return null; + }; + + /** + * Creates a ChunkSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ChunkSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ChunkSpec} ChunkSpec + */ + ChunkSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ChunkSpec) + return object; + var message = new $root.google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ChunkSpec(); + if (object.numPreviousChunks != null) + message.numPreviousChunks = object.numPreviousChunks | 0; + if (object.numNextChunks != null) + message.numNextChunks = object.numNextChunks | 0; + return message; + }; + + /** + * Creates a plain object from a ChunkSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ChunkSpec + * @static + * @param {google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ChunkSpec} message ChunkSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChunkSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.numPreviousChunks = 0; + object.numNextChunks = 0; + } + if (message.numPreviousChunks != null && message.hasOwnProperty("numPreviousChunks")) + object.numPreviousChunks = message.numPreviousChunks; + if (message.numNextChunks != null && message.hasOwnProperty("numNextChunks")) + object.numNextChunks = message.numNextChunks; + return object; + }; + + /** + * Converts this ChunkSpec to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ChunkSpec + * @instance + * @returns {Object.} JSON object + */ + ChunkSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChunkSpec + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ChunkSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChunkSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.ChunkSpec"; + }; + + return ChunkSpec; + })(); + /** * SearchResultMode enum. * @name google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SearchResultMode @@ -69386,6 +74292,7 @@ * @property {string|null} [title] Reference title * @property {string|null} [document] Reference document * @property {string|null} [uri] Reference uri + * @property {Array.|null} [chunkContents] Reference chunkContents */ /** @@ -69397,6 +74304,7 @@ * @param {google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.IReference=} [properties] Properties to set */ function Reference(properties) { + this.chunkContents = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -69427,6 +74335,14 @@ */ Reference.prototype.uri = ""; + /** + * Reference chunkContents. + * @member {Array.} chunkContents + * @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference + * @instance + */ + Reference.prototype.chunkContents = $util.emptyArray; + /** * Creates a new Reference instance using the specified properties. * @function create @@ -69457,6 +74373,9 @@ writer.uint32(/* id 2, wireType 2 =*/18).string(message.document); if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.uri); + if (message.chunkContents != null && message.chunkContents.length) + for (var i = 0; i < message.chunkContents.length; ++i) + $root.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.ChunkContent.encode(message.chunkContents[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -69503,6 +74422,12 @@ message.uri = reader.string(); break; } + case 4: { + if (!(message.chunkContents && message.chunkContents.length)) + message.chunkContents = []; + message.chunkContents.push($root.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.ChunkContent.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -69547,6 +74472,15 @@ if (message.uri != null && message.hasOwnProperty("uri")) if (!$util.isString(message.uri)) return "uri: string expected"; + if (message.chunkContents != null && message.hasOwnProperty("chunkContents")) { + if (!Array.isArray(message.chunkContents)) + return "chunkContents: array expected"; + for (var i = 0; i < message.chunkContents.length; ++i) { + var error = $root.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.ChunkContent.verify(message.chunkContents[i]); + if (error) + return "chunkContents." + error; + } + } return null; }; @@ -69568,6 +74502,16 @@ message.document = String(object.document); if (object.uri != null) message.uri = String(object.uri); + if (object.chunkContents) { + if (!Array.isArray(object.chunkContents)) + throw TypeError(".google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.chunkContents: array expected"); + message.chunkContents = []; + for (var i = 0; i < object.chunkContents.length; ++i) { + if (typeof object.chunkContents[i] !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.chunkContents: object expected"); + message.chunkContents[i] = $root.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.ChunkContent.fromObject(object.chunkContents[i]); + } + } return message; }; @@ -69584,6 +74528,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.chunkContents = []; if (options.defaults) { object.title = ""; object.document = ""; @@ -69595,6 +74541,11 @@ object.document = message.document; if (message.uri != null && message.hasOwnProperty("uri")) object.uri = message.uri; + if (message.chunkContents && message.chunkContents.length) { + object.chunkContents = []; + for (var j = 0; j < message.chunkContents.length; ++j) + object.chunkContents[j] = $root.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.ChunkContent.toObject(message.chunkContents[j], options); + } return object; }; @@ -69624,6 +74575,233 @@ return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference"; }; + Reference.ChunkContent = (function() { + + /** + * Properties of a ChunkContent. + * @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference + * @interface IChunkContent + * @property {string|null} [content] ChunkContent content + * @property {string|null} [pageIdentifier] ChunkContent pageIdentifier + */ + + /** + * Constructs a new ChunkContent. + * @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference + * @classdesc Represents a ChunkContent. + * @implements IChunkContent + * @constructor + * @param {google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.IChunkContent=} [properties] Properties to set + */ + function ChunkContent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChunkContent content. + * @member {string} content + * @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.ChunkContent + * @instance + */ + ChunkContent.prototype.content = ""; + + /** + * ChunkContent pageIdentifier. + * @member {string} pageIdentifier + * @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.ChunkContent + * @instance + */ + ChunkContent.prototype.pageIdentifier = ""; + + /** + * Creates a new ChunkContent instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.ChunkContent + * @static + * @param {google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.IChunkContent=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.ChunkContent} ChunkContent instance + */ + ChunkContent.create = function create(properties) { + return new ChunkContent(properties); + }; + + /** + * Encodes the specified ChunkContent message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.ChunkContent.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.ChunkContent + * @static + * @param {google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.IChunkContent} message ChunkContent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChunkContent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); + if (message.pageIdentifier != null && Object.hasOwnProperty.call(message, "pageIdentifier")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageIdentifier); + return writer; + }; + + /** + * Encodes the specified ChunkContent message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.ChunkContent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.ChunkContent + * @static + * @param {google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.IChunkContent} message ChunkContent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChunkContent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChunkContent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.ChunkContent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.ChunkContent} ChunkContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChunkContent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.ChunkContent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.content = reader.string(); + break; + } + case 2: { + message.pageIdentifier = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChunkContent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.ChunkContent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.ChunkContent} ChunkContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChunkContent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChunkContent message. + * @function verify + * @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.ChunkContent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChunkContent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + if (message.pageIdentifier != null && message.hasOwnProperty("pageIdentifier")) + if (!$util.isString(message.pageIdentifier)) + return "pageIdentifier: string expected"; + return null; + }; + + /** + * Creates a ChunkContent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.ChunkContent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.ChunkContent} ChunkContent + */ + ChunkContent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.ChunkContent) + return object; + var message = new $root.google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.ChunkContent(); + if (object.content != null) + message.content = String(object.content); + if (object.pageIdentifier != null) + message.pageIdentifier = String(object.pageIdentifier); + return message; + }; + + /** + * Creates a plain object from a ChunkContent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.ChunkContent + * @static + * @param {google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.ChunkContent} message ChunkContent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChunkContent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.content = ""; + object.pageIdentifier = ""; + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + if (message.pageIdentifier != null && message.hasOwnProperty("pageIdentifier")) + object.pageIdentifier = message.pageIdentifier; + return object; + }; + + /** + * Converts this ChunkContent to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.ChunkContent + * @instance + * @returns {Object.} JSON object + */ + ChunkContent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChunkContent + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.ChunkContent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChunkContent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.SearchResponse.Summary.Reference.ChunkContent"; + }; + + return ChunkContent; + })(); + return Reference; })(); @@ -73124,6 +78302,7 @@ case 0: case 1: case 2: + case 7: break; } if (message.solutionTypes != null && message.hasOwnProperty("solutionTypes")) { @@ -73137,6 +78316,7 @@ case 1: case 2: case 3: + case 4: break; } } @@ -73214,6 +78394,10 @@ case 2: message.industryVertical = 2; break; + case "HEALTHCARE_FHIR": + case 7: + message.industryVertical = 7; + break; } if (object.solutionTypes) { if (!Array.isArray(object.solutionTypes)) @@ -73242,6 +78426,10 @@ case 3: message.solutionTypes[i] = 3; break; + case "SOLUTION_TYPE_GENERATIVE_CHAT": + case 4: + message.solutionTypes[i] = 4; + break; } } if (object.defaultSchemaId != null) @@ -78980,6 +84168,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.discoveryengine.v1alpha.DocumentService|getProcessedDocument}. + * @memberof google.cloud.discoveryengine.v1alpha.DocumentService + * @typedef GetProcessedDocumentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.discoveryengine.v1alpha.ProcessedDocument} [response] ProcessedDocument + */ + + /** + * Calls GetProcessedDocument. + * @function getProcessedDocument + * @memberof google.cloud.discoveryengine.v1alpha.DocumentService + * @instance + * @param {google.cloud.discoveryengine.v1alpha.IGetProcessedDocumentRequest} request GetProcessedDocumentRequest message or plain object + * @param {google.cloud.discoveryengine.v1alpha.DocumentService.GetProcessedDocumentCallback} callback Node-style callback called with the error, if any, and ProcessedDocument + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentService.prototype.getProcessedDocument = function getProcessedDocument(request, callback) { + return this.rpcCall(getProcessedDocument, $root.google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest, $root.google.cloud.discoveryengine.v1alpha.ProcessedDocument, request, callback); + }, "name", { value: "GetProcessedDocument" }); + + /** + * Calls GetProcessedDocument. + * @function getProcessedDocument + * @memberof google.cloud.discoveryengine.v1alpha.DocumentService + * @instance + * @param {google.cloud.discoveryengine.v1alpha.IGetProcessedDocumentRequest} request GetProcessedDocumentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return DocumentService; })(); @@ -80402,6 +85623,329 @@ return DeleteDocumentRequest; })(); + v1alpha.GetProcessedDocumentRequest = (function() { + + /** + * Properties of a GetProcessedDocumentRequest. + * @memberof google.cloud.discoveryengine.v1alpha + * @interface IGetProcessedDocumentRequest + * @property {string|null} [name] GetProcessedDocumentRequest name + * @property {google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest.ProcessedDocumentType|null} [processedDocumentType] GetProcessedDocumentRequest processedDocumentType + * @property {google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest.ProcessedDocumentFormat|null} [processedDocumentFormat] GetProcessedDocumentRequest processedDocumentFormat + */ + + /** + * Constructs a new GetProcessedDocumentRequest. + * @memberof google.cloud.discoveryengine.v1alpha + * @classdesc Represents a GetProcessedDocumentRequest. + * @implements IGetProcessedDocumentRequest + * @constructor + * @param {google.cloud.discoveryengine.v1alpha.IGetProcessedDocumentRequest=} [properties] Properties to set + */ + function GetProcessedDocumentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetProcessedDocumentRequest name. + * @member {string} name + * @memberof google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest + * @instance + */ + GetProcessedDocumentRequest.prototype.name = ""; + + /** + * GetProcessedDocumentRequest processedDocumentType. + * @member {google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest.ProcessedDocumentType} processedDocumentType + * @memberof google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest + * @instance + */ + GetProcessedDocumentRequest.prototype.processedDocumentType = 0; + + /** + * GetProcessedDocumentRequest processedDocumentFormat. + * @member {google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest.ProcessedDocumentFormat} processedDocumentFormat + * @memberof google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest + * @instance + */ + GetProcessedDocumentRequest.prototype.processedDocumentFormat = 0; + + /** + * Creates a new GetProcessedDocumentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest + * @static + * @param {google.cloud.discoveryengine.v1alpha.IGetProcessedDocumentRequest=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest} GetProcessedDocumentRequest instance + */ + GetProcessedDocumentRequest.create = function create(properties) { + return new GetProcessedDocumentRequest(properties); + }; + + /** + * Encodes the specified GetProcessedDocumentRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest + * @static + * @param {google.cloud.discoveryengine.v1alpha.IGetProcessedDocumentRequest} message GetProcessedDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProcessedDocumentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.processedDocumentType != null && Object.hasOwnProperty.call(message, "processedDocumentType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.processedDocumentType); + if (message.processedDocumentFormat != null && Object.hasOwnProperty.call(message, "processedDocumentFormat")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.processedDocumentFormat); + return writer; + }; + + /** + * Encodes the specified GetProcessedDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest + * @static + * @param {google.cloud.discoveryengine.v1alpha.IGetProcessedDocumentRequest} message GetProcessedDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProcessedDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProcessedDocumentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest} GetProcessedDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProcessedDocumentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.processedDocumentType = reader.int32(); + break; + } + case 3: { + message.processedDocumentFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetProcessedDocumentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest} GetProcessedDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProcessedDocumentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProcessedDocumentRequest message. + * @function verify + * @memberof google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProcessedDocumentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.processedDocumentType != null && message.hasOwnProperty("processedDocumentType")) + switch (message.processedDocumentType) { + default: + return "processedDocumentType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.processedDocumentFormat != null && message.hasOwnProperty("processedDocumentFormat")) + switch (message.processedDocumentFormat) { + default: + return "processedDocumentFormat: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a GetProcessedDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest} GetProcessedDocumentRequest + */ + GetProcessedDocumentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest) + return object; + var message = new $root.google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.processedDocumentType) { + default: + if (typeof object.processedDocumentType === "number") { + message.processedDocumentType = object.processedDocumentType; + break; + } + break; + case "PROCESSED_DOCUMENT_TYPE_UNSPECIFIED": + case 0: + message.processedDocumentType = 0; + break; + case "PARSED_DOCUMENT": + case 1: + message.processedDocumentType = 1; + break; + case "CHUNKED_DOCUMENT": + case 2: + message.processedDocumentType = 2; + break; + } + switch (object.processedDocumentFormat) { + default: + if (typeof object.processedDocumentFormat === "number") { + message.processedDocumentFormat = object.processedDocumentFormat; + break; + } + break; + case "PROCESSED_DOCUMENT_FORMAT_UNSPECIFIED": + case 0: + message.processedDocumentFormat = 0; + break; + case "JSON": + case 1: + message.processedDocumentFormat = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetProcessedDocumentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest + * @static + * @param {google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest} message GetProcessedDocumentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProcessedDocumentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.processedDocumentType = options.enums === String ? "PROCESSED_DOCUMENT_TYPE_UNSPECIFIED" : 0; + object.processedDocumentFormat = options.enums === String ? "PROCESSED_DOCUMENT_FORMAT_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.processedDocumentType != null && message.hasOwnProperty("processedDocumentType")) + object.processedDocumentType = options.enums === String ? $root.google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest.ProcessedDocumentType[message.processedDocumentType] === undefined ? message.processedDocumentType : $root.google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest.ProcessedDocumentType[message.processedDocumentType] : message.processedDocumentType; + if (message.processedDocumentFormat != null && message.hasOwnProperty("processedDocumentFormat")) + object.processedDocumentFormat = options.enums === String ? $root.google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest.ProcessedDocumentFormat[message.processedDocumentFormat] === undefined ? message.processedDocumentFormat : $root.google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest.ProcessedDocumentFormat[message.processedDocumentFormat] : message.processedDocumentFormat; + return object; + }; + + /** + * Converts this GetProcessedDocumentRequest to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest + * @instance + * @returns {Object.} JSON object + */ + GetProcessedDocumentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetProcessedDocumentRequest + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetProcessedDocumentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest"; + }; + + /** + * ProcessedDocumentType enum. + * @name google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest.ProcessedDocumentType + * @enum {number} + * @property {number} PROCESSED_DOCUMENT_TYPE_UNSPECIFIED=0 PROCESSED_DOCUMENT_TYPE_UNSPECIFIED value + * @property {number} PARSED_DOCUMENT=1 PARSED_DOCUMENT value + * @property {number} CHUNKED_DOCUMENT=2 CHUNKED_DOCUMENT value + */ + GetProcessedDocumentRequest.ProcessedDocumentType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PROCESSED_DOCUMENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PARSED_DOCUMENT"] = 1; + values[valuesById[2] = "CHUNKED_DOCUMENT"] = 2; + return values; + })(); + + /** + * ProcessedDocumentFormat enum. + * @name google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest.ProcessedDocumentFormat + * @enum {number} + * @property {number} PROCESSED_DOCUMENT_FORMAT_UNSPECIFIED=0 PROCESSED_DOCUMENT_FORMAT_UNSPECIFIED value + * @property {number} JSON=1 JSON value + */ + GetProcessedDocumentRequest.ProcessedDocumentFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PROCESSED_DOCUMENT_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "JSON"] = 1; + return values; + })(); + + return GetProcessedDocumentRequest; + })(); + v1alpha.Engine = (function() { /** @@ -80845,6 +86389,7 @@ case 1: case 2: case 3: + case 4: break; } if (message.industryVertical != null && message.hasOwnProperty("industryVertical")) @@ -80854,6 +86399,7 @@ case 0: case 1: case 2: + case 7: break; } if (message.commonConfig != null && message.hasOwnProperty("commonConfig")) { @@ -80950,6 +86496,10 @@ case 3: message.solutionType = 3; break; + case "SOLUTION_TYPE_GENERATIVE_CHAT": + case 4: + message.solutionType = 4; + break; } switch (object.industryVertical) { default: @@ -80970,6 +86520,10 @@ case 2: message.industryVertical = 2; break; + case "HEALTHCARE_FHIR": + case 7: + message.industryVertical = 7; + break; } if (object.commonConfig != null) { if (typeof object.commonConfig !== "object") @@ -85799,70 +91353,476 @@ * @memberof google.cloud.discoveryengine.v1alpha.ResumeEngineRequest * @instance */ - ResumeEngineRequest.prototype.name = ""; + ResumeEngineRequest.prototype.name = ""; + + /** + * Creates a new ResumeEngineRequest instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1alpha.ResumeEngineRequest + * @static + * @param {google.cloud.discoveryengine.v1alpha.IResumeEngineRequest=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.ResumeEngineRequest} ResumeEngineRequest instance + */ + ResumeEngineRequest.create = function create(properties) { + return new ResumeEngineRequest(properties); + }; + + /** + * Encodes the specified ResumeEngineRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ResumeEngineRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1alpha.ResumeEngineRequest + * @static + * @param {google.cloud.discoveryengine.v1alpha.IResumeEngineRequest} message ResumeEngineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResumeEngineRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified ResumeEngineRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ResumeEngineRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.ResumeEngineRequest + * @static + * @param {google.cloud.discoveryengine.v1alpha.IResumeEngineRequest} message ResumeEngineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResumeEngineRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResumeEngineRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1alpha.ResumeEngineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1alpha.ResumeEngineRequest} ResumeEngineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResumeEngineRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.ResumeEngineRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResumeEngineRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.ResumeEngineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1alpha.ResumeEngineRequest} ResumeEngineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResumeEngineRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResumeEngineRequest message. + * @function verify + * @memberof google.cloud.discoveryengine.v1alpha.ResumeEngineRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResumeEngineRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a ResumeEngineRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1alpha.ResumeEngineRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1alpha.ResumeEngineRequest} ResumeEngineRequest + */ + ResumeEngineRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.ResumeEngineRequest) + return object; + var message = new $root.google.cloud.discoveryengine.v1alpha.ResumeEngineRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a ResumeEngineRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1alpha.ResumeEngineRequest + * @static + * @param {google.cloud.discoveryengine.v1alpha.ResumeEngineRequest} message ResumeEngineRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResumeEngineRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ResumeEngineRequest to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1alpha.ResumeEngineRequest + * @instance + * @returns {Object.} JSON object + */ + ResumeEngineRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResumeEngineRequest + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1alpha.ResumeEngineRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResumeEngineRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.ResumeEngineRequest"; + }; + + return ResumeEngineRequest; + })(); + + v1alpha.TuneEngineRequest = (function() { + + /** + * Properties of a TuneEngineRequest. + * @memberof google.cloud.discoveryengine.v1alpha + * @interface ITuneEngineRequest + * @property {string|null} [name] TuneEngineRequest name + */ + + /** + * Constructs a new TuneEngineRequest. + * @memberof google.cloud.discoveryengine.v1alpha + * @classdesc Represents a TuneEngineRequest. + * @implements ITuneEngineRequest + * @constructor + * @param {google.cloud.discoveryengine.v1alpha.ITuneEngineRequest=} [properties] Properties to set + */ + function TuneEngineRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TuneEngineRequest name. + * @member {string} name + * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineRequest + * @instance + */ + TuneEngineRequest.prototype.name = ""; + + /** + * Creates a new TuneEngineRequest instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineRequest + * @static + * @param {google.cloud.discoveryengine.v1alpha.ITuneEngineRequest=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.TuneEngineRequest} TuneEngineRequest instance + */ + TuneEngineRequest.create = function create(properties) { + return new TuneEngineRequest(properties); + }; + + /** + * Encodes the specified TuneEngineRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.TuneEngineRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineRequest + * @static + * @param {google.cloud.discoveryengine.v1alpha.ITuneEngineRequest} message TuneEngineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TuneEngineRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified TuneEngineRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.TuneEngineRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineRequest + * @static + * @param {google.cloud.discoveryengine.v1alpha.ITuneEngineRequest} message TuneEngineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TuneEngineRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TuneEngineRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1alpha.TuneEngineRequest} TuneEngineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TuneEngineRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.TuneEngineRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TuneEngineRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1alpha.TuneEngineRequest} TuneEngineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TuneEngineRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TuneEngineRequest message. + * @function verify + * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TuneEngineRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a TuneEngineRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1alpha.TuneEngineRequest} TuneEngineRequest + */ + TuneEngineRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.TuneEngineRequest) + return object; + var message = new $root.google.cloud.discoveryengine.v1alpha.TuneEngineRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a TuneEngineRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineRequest + * @static + * @param {google.cloud.discoveryengine.v1alpha.TuneEngineRequest} message TuneEngineRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TuneEngineRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this TuneEngineRequest to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineRequest + * @instance + * @returns {Object.} JSON object + */ + TuneEngineRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TuneEngineRequest + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TuneEngineRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.TuneEngineRequest"; + }; + + return TuneEngineRequest; + })(); + + v1alpha.TuneEngineMetadata = (function() { + + /** + * Properties of a TuneEngineMetadata. + * @memberof google.cloud.discoveryengine.v1alpha + * @interface ITuneEngineMetadata + * @property {string|null} [engine] TuneEngineMetadata engine + */ + + /** + * Constructs a new TuneEngineMetadata. + * @memberof google.cloud.discoveryengine.v1alpha + * @classdesc Represents a TuneEngineMetadata. + * @implements ITuneEngineMetadata + * @constructor + * @param {google.cloud.discoveryengine.v1alpha.ITuneEngineMetadata=} [properties] Properties to set + */ + function TuneEngineMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TuneEngineMetadata engine. + * @member {string} engine + * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineMetadata + * @instance + */ + TuneEngineMetadata.prototype.engine = ""; /** - * Creates a new ResumeEngineRequest instance using the specified properties. + * Creates a new TuneEngineMetadata instance using the specified properties. * @function create - * @memberof google.cloud.discoveryengine.v1alpha.ResumeEngineRequest + * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineMetadata * @static - * @param {google.cloud.discoveryengine.v1alpha.IResumeEngineRequest=} [properties] Properties to set - * @returns {google.cloud.discoveryengine.v1alpha.ResumeEngineRequest} ResumeEngineRequest instance + * @param {google.cloud.discoveryengine.v1alpha.ITuneEngineMetadata=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.TuneEngineMetadata} TuneEngineMetadata instance */ - ResumeEngineRequest.create = function create(properties) { - return new ResumeEngineRequest(properties); + TuneEngineMetadata.create = function create(properties) { + return new TuneEngineMetadata(properties); }; /** - * Encodes the specified ResumeEngineRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ResumeEngineRequest.verify|verify} messages. + * Encodes the specified TuneEngineMetadata message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.TuneEngineMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.discoveryengine.v1alpha.ResumeEngineRequest + * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineMetadata * @static - * @param {google.cloud.discoveryengine.v1alpha.IResumeEngineRequest} message ResumeEngineRequest message or plain object to encode + * @param {google.cloud.discoveryengine.v1alpha.ITuneEngineMetadata} message TuneEngineMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResumeEngineRequest.encode = function encode(message, writer) { + TuneEngineMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.engine != null && Object.hasOwnProperty.call(message, "engine")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.engine); return writer; }; /** - * Encodes the specified ResumeEngineRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.ResumeEngineRequest.verify|verify} messages. + * Encodes the specified TuneEngineMetadata message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.TuneEngineMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.ResumeEngineRequest + * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineMetadata * @static - * @param {google.cloud.discoveryengine.v1alpha.IResumeEngineRequest} message ResumeEngineRequest message or plain object to encode + * @param {google.cloud.discoveryengine.v1alpha.ITuneEngineMetadata} message TuneEngineMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResumeEngineRequest.encodeDelimited = function encodeDelimited(message, writer) { + TuneEngineMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResumeEngineRequest message from the specified reader or buffer. + * Decodes a TuneEngineMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.discoveryengine.v1alpha.ResumeEngineRequest + * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.discoveryengine.v1alpha.ResumeEngineRequest} ResumeEngineRequest + * @returns {google.cloud.discoveryengine.v1alpha.TuneEngineMetadata} TuneEngineMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResumeEngineRequest.decode = function decode(reader, length) { + TuneEngineMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.ResumeEngineRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.TuneEngineMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.engine = reader.string(); break; } default: @@ -85874,122 +91834,121 @@ }; /** - * Decodes a ResumeEngineRequest message from the specified reader or buffer, length delimited. + * Decodes a TuneEngineMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.ResumeEngineRequest + * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.discoveryengine.v1alpha.ResumeEngineRequest} ResumeEngineRequest + * @returns {google.cloud.discoveryengine.v1alpha.TuneEngineMetadata} TuneEngineMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResumeEngineRequest.decodeDelimited = function decodeDelimited(reader) { + TuneEngineMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResumeEngineRequest message. + * Verifies a TuneEngineMetadata message. * @function verify - * @memberof google.cloud.discoveryengine.v1alpha.ResumeEngineRequest + * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ResumeEngineRequest.verify = function verify(message) { + TuneEngineMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (message.engine != null && message.hasOwnProperty("engine")) + if (!$util.isString(message.engine)) + return "engine: string expected"; return null; }; /** - * Creates a ResumeEngineRequest message from a plain object. Also converts values to their respective internal types. + * Creates a TuneEngineMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.discoveryengine.v1alpha.ResumeEngineRequest + * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.discoveryengine.v1alpha.ResumeEngineRequest} ResumeEngineRequest + * @returns {google.cloud.discoveryengine.v1alpha.TuneEngineMetadata} TuneEngineMetadata */ - ResumeEngineRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.discoveryengine.v1alpha.ResumeEngineRequest) + TuneEngineMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.TuneEngineMetadata) return object; - var message = new $root.google.cloud.discoveryengine.v1alpha.ResumeEngineRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.discoveryengine.v1alpha.TuneEngineMetadata(); + if (object.engine != null) + message.engine = String(object.engine); return message; }; /** - * Creates a plain object from a ResumeEngineRequest message. Also converts values to other types if specified. + * Creates a plain object from a TuneEngineMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.discoveryengine.v1alpha.ResumeEngineRequest + * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineMetadata * @static - * @param {google.cloud.discoveryengine.v1alpha.ResumeEngineRequest} message ResumeEngineRequest + * @param {google.cloud.discoveryengine.v1alpha.TuneEngineMetadata} message TuneEngineMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResumeEngineRequest.toObject = function toObject(message, options) { + TuneEngineMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + object.engine = ""; + if (message.engine != null && message.hasOwnProperty("engine")) + object.engine = message.engine; return object; }; /** - * Converts this ResumeEngineRequest to JSON. + * Converts this TuneEngineMetadata to JSON. * @function toJSON - * @memberof google.cloud.discoveryengine.v1alpha.ResumeEngineRequest + * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineMetadata * @instance * @returns {Object.} JSON object */ - ResumeEngineRequest.prototype.toJSON = function toJSON() { + TuneEngineMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ResumeEngineRequest + * Gets the default type url for TuneEngineMetadata * @function getTypeUrl - * @memberof google.cloud.discoveryengine.v1alpha.ResumeEngineRequest + * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ResumeEngineRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + TuneEngineMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.ResumeEngineRequest"; + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.TuneEngineMetadata"; }; - return ResumeEngineRequest; + return TuneEngineMetadata; })(); - v1alpha.TuneEngineRequest = (function() { + v1alpha.TuneEngineResponse = (function() { /** - * Properties of a TuneEngineRequest. + * Properties of a TuneEngineResponse. * @memberof google.cloud.discoveryengine.v1alpha - * @interface ITuneEngineRequest - * @property {string|null} [name] TuneEngineRequest name + * @interface ITuneEngineResponse */ /** - * Constructs a new TuneEngineRequest. + * Constructs a new TuneEngineResponse. * @memberof google.cloud.discoveryengine.v1alpha - * @classdesc Represents a TuneEngineRequest. - * @implements ITuneEngineRequest + * @classdesc Represents a TuneEngineResponse. + * @implements ITuneEngineResponse * @constructor - * @param {google.cloud.discoveryengine.v1alpha.ITuneEngineRequest=} [properties] Properties to set + * @param {google.cloud.discoveryengine.v1alpha.ITuneEngineResponse=} [properties] Properties to set */ - function TuneEngineRequest(properties) { + function TuneEngineResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -85997,77 +91956,63 @@ } /** - * TuneEngineRequest name. - * @member {string} name - * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineRequest - * @instance - */ - TuneEngineRequest.prototype.name = ""; - - /** - * Creates a new TuneEngineRequest instance using the specified properties. + * Creates a new TuneEngineResponse instance using the specified properties. * @function create - * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineRequest + * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineResponse * @static - * @param {google.cloud.discoveryengine.v1alpha.ITuneEngineRequest=} [properties] Properties to set - * @returns {google.cloud.discoveryengine.v1alpha.TuneEngineRequest} TuneEngineRequest instance + * @param {google.cloud.discoveryengine.v1alpha.ITuneEngineResponse=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.TuneEngineResponse} TuneEngineResponse instance */ - TuneEngineRequest.create = function create(properties) { - return new TuneEngineRequest(properties); + TuneEngineResponse.create = function create(properties) { + return new TuneEngineResponse(properties); }; /** - * Encodes the specified TuneEngineRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.TuneEngineRequest.verify|verify} messages. + * Encodes the specified TuneEngineResponse message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.TuneEngineResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineRequest + * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineResponse * @static - * @param {google.cloud.discoveryengine.v1alpha.ITuneEngineRequest} message TuneEngineRequest message or plain object to encode + * @param {google.cloud.discoveryengine.v1alpha.ITuneEngineResponse} message TuneEngineResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TuneEngineRequest.encode = function encode(message, writer) { + TuneEngineResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified TuneEngineRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.TuneEngineRequest.verify|verify} messages. + * Encodes the specified TuneEngineResponse message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.TuneEngineResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineRequest + * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineResponse * @static - * @param {google.cloud.discoveryengine.v1alpha.ITuneEngineRequest} message TuneEngineRequest message or plain object to encode + * @param {google.cloud.discoveryengine.v1alpha.ITuneEngineResponse} message TuneEngineResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TuneEngineRequest.encodeDelimited = function encodeDelimited(message, writer) { + TuneEngineResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TuneEngineRequest message from the specified reader or buffer. + * Decodes a TuneEngineResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineRequest + * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.discoveryengine.v1alpha.TuneEngineRequest} TuneEngineRequest + * @returns {google.cloud.discoveryengine.v1alpha.TuneEngineResponse} TuneEngineResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TuneEngineRequest.decode = function decode(reader, length) { + TuneEngineResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.TuneEngineRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.TuneEngineResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } default: reader.skipType(tag & 7); break; @@ -86077,122 +92022,179 @@ }; /** - * Decodes a TuneEngineRequest message from the specified reader or buffer, length delimited. + * Decodes a TuneEngineResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineRequest + * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.discoveryengine.v1alpha.TuneEngineRequest} TuneEngineRequest + * @returns {google.cloud.discoveryengine.v1alpha.TuneEngineResponse} TuneEngineResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TuneEngineRequest.decodeDelimited = function decodeDelimited(reader) { + TuneEngineResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TuneEngineRequest message. + * Verifies a TuneEngineResponse message. * @function verify - * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineRequest + * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TuneEngineRequest.verify = function verify(message) { + TuneEngineResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; return null; }; /** - * Creates a TuneEngineRequest message from a plain object. Also converts values to their respective internal types. + * Creates a TuneEngineResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineRequest + * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.discoveryengine.v1alpha.TuneEngineRequest} TuneEngineRequest + * @returns {google.cloud.discoveryengine.v1alpha.TuneEngineResponse} TuneEngineResponse */ - TuneEngineRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.discoveryengine.v1alpha.TuneEngineRequest) + TuneEngineResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.TuneEngineResponse) return object; - var message = new $root.google.cloud.discoveryengine.v1alpha.TuneEngineRequest(); - if (object.name != null) - message.name = String(object.name); - return message; + return new $root.google.cloud.discoveryengine.v1alpha.TuneEngineResponse(); }; /** - * Creates a plain object from a TuneEngineRequest message. Also converts values to other types if specified. + * Creates a plain object from a TuneEngineResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineRequest + * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineResponse * @static - * @param {google.cloud.discoveryengine.v1alpha.TuneEngineRequest} message TuneEngineRequest + * @param {google.cloud.discoveryengine.v1alpha.TuneEngineResponse} message TuneEngineResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TuneEngineRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; + TuneEngineResponse.toObject = function toObject() { + return {}; }; /** - * Converts this TuneEngineRequest to JSON. + * Converts this TuneEngineResponse to JSON. * @function toJSON - * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineRequest + * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineResponse * @instance * @returns {Object.} JSON object */ - TuneEngineRequest.prototype.toJSON = function toJSON() { + TuneEngineResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for TuneEngineRequest + * Gets the default type url for TuneEngineResponse * @function getTypeUrl - * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineRequest + * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - TuneEngineRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + TuneEngineResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.TuneEngineRequest"; + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.TuneEngineResponse"; }; - return TuneEngineRequest; + return TuneEngineResponse; })(); - v1alpha.TuneEngineMetadata = (function() { + v1alpha.EstimateBillingService = (function() { /** - * Properties of a TuneEngineMetadata. + * Constructs a new EstimateBillingService service. * @memberof google.cloud.discoveryengine.v1alpha - * @interface ITuneEngineMetadata - * @property {string|null} [engine] TuneEngineMetadata engine + * @classdesc Represents an EstimateBillingService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited */ + function EstimateBillingService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (EstimateBillingService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = EstimateBillingService; /** - * Constructs a new TuneEngineMetadata. + * Creates new EstimateBillingService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.discoveryengine.v1alpha.EstimateBillingService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {EstimateBillingService} RPC service. Useful where requests and/or responses are streamed. + */ + EstimateBillingService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.discoveryengine.v1alpha.EstimateBillingService|estimateDataSize}. + * @memberof google.cloud.discoveryengine.v1alpha.EstimateBillingService + * @typedef EstimateDataSizeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls EstimateDataSize. + * @function estimateDataSize + * @memberof google.cloud.discoveryengine.v1alpha.EstimateBillingService + * @instance + * @param {google.cloud.discoveryengine.v1alpha.IEstimateDataSizeRequest} request EstimateDataSizeRequest message or plain object + * @param {google.cloud.discoveryengine.v1alpha.EstimateBillingService.EstimateDataSizeCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EstimateBillingService.prototype.estimateDataSize = function estimateDataSize(request, callback) { + return this.rpcCall(estimateDataSize, $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "EstimateDataSize" }); + + /** + * Calls EstimateDataSize. + * @function estimateDataSize + * @memberof google.cloud.discoveryengine.v1alpha.EstimateBillingService + * @instance + * @param {google.cloud.discoveryengine.v1alpha.IEstimateDataSizeRequest} request EstimateDataSizeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return EstimateBillingService; + })(); + + v1alpha.EstimateDataSizeRequest = (function() { + + /** + * Properties of an EstimateDataSizeRequest. * @memberof google.cloud.discoveryengine.v1alpha - * @classdesc Represents a TuneEngineMetadata. - * @implements ITuneEngineMetadata + * @interface IEstimateDataSizeRequest + * @property {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.IWebsiteDataSource|null} [websiteDataSource] EstimateDataSizeRequest websiteDataSource + * @property {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.IFileDataSource|null} [fileDataSource] EstimateDataSizeRequest fileDataSource + * @property {string|null} [location] EstimateDataSizeRequest location + */ + + /** + * Constructs a new EstimateDataSizeRequest. + * @memberof google.cloud.discoveryengine.v1alpha + * @classdesc Represents an EstimateDataSizeRequest. + * @implements IEstimateDataSizeRequest * @constructor - * @param {google.cloud.discoveryengine.v1alpha.ITuneEngineMetadata=} [properties] Properties to set + * @param {google.cloud.discoveryengine.v1alpha.IEstimateDataSizeRequest=} [properties] Properties to set */ - function TuneEngineMetadata(properties) { + function EstimateDataSizeRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -86200,75 +92202,117 @@ } /** - * TuneEngineMetadata engine. - * @member {string} engine - * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineMetadata + * EstimateDataSizeRequest websiteDataSource. + * @member {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.IWebsiteDataSource|null|undefined} websiteDataSource + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest * @instance */ - TuneEngineMetadata.prototype.engine = ""; + EstimateDataSizeRequest.prototype.websiteDataSource = null; /** - * Creates a new TuneEngineMetadata instance using the specified properties. + * EstimateDataSizeRequest fileDataSource. + * @member {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.IFileDataSource|null|undefined} fileDataSource + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest + * @instance + */ + EstimateDataSizeRequest.prototype.fileDataSource = null; + + /** + * EstimateDataSizeRequest location. + * @member {string} location + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest + * @instance + */ + EstimateDataSizeRequest.prototype.location = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * EstimateDataSizeRequest dataSource. + * @member {"websiteDataSource"|"fileDataSource"|undefined} dataSource + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest + * @instance + */ + Object.defineProperty(EstimateDataSizeRequest.prototype, "dataSource", { + get: $util.oneOfGetter($oneOfFields = ["websiteDataSource", "fileDataSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new EstimateDataSizeRequest instance using the specified properties. * @function create - * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineMetadata + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest * @static - * @param {google.cloud.discoveryengine.v1alpha.ITuneEngineMetadata=} [properties] Properties to set - * @returns {google.cloud.discoveryengine.v1alpha.TuneEngineMetadata} TuneEngineMetadata instance + * @param {google.cloud.discoveryengine.v1alpha.IEstimateDataSizeRequest=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest} EstimateDataSizeRequest instance */ - TuneEngineMetadata.create = function create(properties) { - return new TuneEngineMetadata(properties); + EstimateDataSizeRequest.create = function create(properties) { + return new EstimateDataSizeRequest(properties); }; /** - * Encodes the specified TuneEngineMetadata message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.TuneEngineMetadata.verify|verify} messages. + * Encodes the specified EstimateDataSizeRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineMetadata + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest * @static - * @param {google.cloud.discoveryengine.v1alpha.ITuneEngineMetadata} message TuneEngineMetadata message or plain object to encode + * @param {google.cloud.discoveryengine.v1alpha.IEstimateDataSizeRequest} message EstimateDataSizeRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TuneEngineMetadata.encode = function encode(message, writer) { + EstimateDataSizeRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.engine != null && Object.hasOwnProperty.call(message, "engine")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.engine); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); + if (message.websiteDataSource != null && Object.hasOwnProperty.call(message, "websiteDataSource")) + $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.encode(message.websiteDataSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.fileDataSource != null && Object.hasOwnProperty.call(message, "fileDataSource")) + $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource.encode(message.fileDataSource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified TuneEngineMetadata message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.TuneEngineMetadata.verify|verify} messages. + * Encodes the specified EstimateDataSizeRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineMetadata + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest * @static - * @param {google.cloud.discoveryengine.v1alpha.ITuneEngineMetadata} message TuneEngineMetadata message or plain object to encode + * @param {google.cloud.discoveryengine.v1alpha.IEstimateDataSizeRequest} message EstimateDataSizeRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TuneEngineMetadata.encodeDelimited = function encodeDelimited(message, writer) { + EstimateDataSizeRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TuneEngineMetadata message from the specified reader or buffer. + * Decodes an EstimateDataSizeRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineMetadata + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.discoveryengine.v1alpha.TuneEngineMetadata} TuneEngineMetadata + * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest} EstimateDataSizeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TuneEngineMetadata.decode = function decode(reader, length) { + EstimateDataSizeRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.TuneEngineMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 2: { + message.websiteDataSource = $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.decode(reader, reader.uint32()); + break; + } + case 3: { + message.fileDataSource = $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource.decode(reader, reader.uint32()); + break; + } case 1: { - message.engine = reader.string(); + message.location = reader.string(); break; } default: @@ -86280,367 +92324,898 @@ }; /** - * Decodes a TuneEngineMetadata message from the specified reader or buffer, length delimited. + * Decodes an EstimateDataSizeRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineMetadata + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.discoveryengine.v1alpha.TuneEngineMetadata} TuneEngineMetadata + * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest} EstimateDataSizeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TuneEngineMetadata.decodeDelimited = function decodeDelimited(reader) { + EstimateDataSizeRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TuneEngineMetadata message. + * Verifies an EstimateDataSizeRequest message. * @function verify - * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineMetadata + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TuneEngineMetadata.verify = function verify(message) { + EstimateDataSizeRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.engine != null && message.hasOwnProperty("engine")) - if (!$util.isString(message.engine)) - return "engine: string expected"; + var properties = {}; + if (message.websiteDataSource != null && message.hasOwnProperty("websiteDataSource")) { + properties.dataSource = 1; + { + var error = $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.verify(message.websiteDataSource); + if (error) + return "websiteDataSource." + error; + } + } + if (message.fileDataSource != null && message.hasOwnProperty("fileDataSource")) { + if (properties.dataSource === 1) + return "dataSource: multiple values"; + properties.dataSource = 1; + { + var error = $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource.verify(message.fileDataSource); + if (error) + return "fileDataSource." + error; + } + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; return null; }; /** - * Creates a TuneEngineMetadata message from a plain object. Also converts values to their respective internal types. + * Creates an EstimateDataSizeRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineMetadata + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.discoveryengine.v1alpha.TuneEngineMetadata} TuneEngineMetadata + * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest} EstimateDataSizeRequest */ - TuneEngineMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.discoveryengine.v1alpha.TuneEngineMetadata) + EstimateDataSizeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest) return object; - var message = new $root.google.cloud.discoveryengine.v1alpha.TuneEngineMetadata(); - if (object.engine != null) - message.engine = String(object.engine); + var message = new $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest(); + if (object.websiteDataSource != null) { + if (typeof object.websiteDataSource !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.websiteDataSource: object expected"); + message.websiteDataSource = $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.fromObject(object.websiteDataSource); + } + if (object.fileDataSource != null) { + if (typeof object.fileDataSource !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.fileDataSource: object expected"); + message.fileDataSource = $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource.fromObject(object.fileDataSource); + } + if (object.location != null) + message.location = String(object.location); return message; }; /** - * Creates a plain object from a TuneEngineMetadata message. Also converts values to other types if specified. + * Creates a plain object from an EstimateDataSizeRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineMetadata + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest * @static - * @param {google.cloud.discoveryengine.v1alpha.TuneEngineMetadata} message TuneEngineMetadata + * @param {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest} message EstimateDataSizeRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TuneEngineMetadata.toObject = function toObject(message, options) { + EstimateDataSizeRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - object.engine = ""; - if (message.engine != null && message.hasOwnProperty("engine")) - object.engine = message.engine; + object.location = ""; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.websiteDataSource != null && message.hasOwnProperty("websiteDataSource")) { + object.websiteDataSource = $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.toObject(message.websiteDataSource, options); + if (options.oneofs) + object.dataSource = "websiteDataSource"; + } + if (message.fileDataSource != null && message.hasOwnProperty("fileDataSource")) { + object.fileDataSource = $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource.toObject(message.fileDataSource, options); + if (options.oneofs) + object.dataSource = "fileDataSource"; + } return object; }; /** - * Converts this TuneEngineMetadata to JSON. + * Converts this EstimateDataSizeRequest to JSON. * @function toJSON - * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineMetadata + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest * @instance * @returns {Object.} JSON object */ - TuneEngineMetadata.prototype.toJSON = function toJSON() { + EstimateDataSizeRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for TuneEngineMetadata + * Gets the default type url for EstimateDataSizeRequest * @function getTypeUrl - * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineMetadata + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - TuneEngineMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + EstimateDataSizeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.TuneEngineMetadata"; + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest"; }; - return TuneEngineMetadata; - })(); + EstimateDataSizeRequest.WebsiteDataSource = (function() { - v1alpha.TuneEngineResponse = (function() { + /** + * Properties of a WebsiteDataSource. + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest + * @interface IWebsiteDataSource + * @property {Array.|null} [estimatorUriPatterns] WebsiteDataSource estimatorUriPatterns + */ - /** - * Properties of a TuneEngineResponse. - * @memberof google.cloud.discoveryengine.v1alpha - * @interface ITuneEngineResponse - */ + /** + * Constructs a new WebsiteDataSource. + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest + * @classdesc Represents a WebsiteDataSource. + * @implements IWebsiteDataSource + * @constructor + * @param {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.IWebsiteDataSource=} [properties] Properties to set + */ + function WebsiteDataSource(properties) { + this.estimatorUriPatterns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new TuneEngineResponse. - * @memberof google.cloud.discoveryengine.v1alpha - * @classdesc Represents a TuneEngineResponse. - * @implements ITuneEngineResponse - * @constructor - * @param {google.cloud.discoveryengine.v1alpha.ITuneEngineResponse=} [properties] Properties to set - */ - function TuneEngineResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * WebsiteDataSource estimatorUriPatterns. + * @member {Array.} estimatorUriPatterns + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource + * @instance + */ + WebsiteDataSource.prototype.estimatorUriPatterns = $util.emptyArray; - /** - * Creates a new TuneEngineResponse instance using the specified properties. - * @function create - * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineResponse - * @static - * @param {google.cloud.discoveryengine.v1alpha.ITuneEngineResponse=} [properties] Properties to set - * @returns {google.cloud.discoveryengine.v1alpha.TuneEngineResponse} TuneEngineResponse instance - */ - TuneEngineResponse.create = function create(properties) { - return new TuneEngineResponse(properties); - }; + /** + * Creates a new WebsiteDataSource instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource + * @static + * @param {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.IWebsiteDataSource=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource} WebsiteDataSource instance + */ + WebsiteDataSource.create = function create(properties) { + return new WebsiteDataSource(properties); + }; + + /** + * Encodes the specified WebsiteDataSource message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource + * @static + * @param {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.IWebsiteDataSource} message WebsiteDataSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebsiteDataSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.estimatorUriPatterns != null && message.estimatorUriPatterns.length) + for (var i = 0; i < message.estimatorUriPatterns.length; ++i) + $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern.encode(message.estimatorUriPatterns[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WebsiteDataSource message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource + * @static + * @param {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.IWebsiteDataSource} message WebsiteDataSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebsiteDataSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebsiteDataSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource} WebsiteDataSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebsiteDataSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.estimatorUriPatterns && message.estimatorUriPatterns.length)) + message.estimatorUriPatterns = []; + message.estimatorUriPatterns.push($root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebsiteDataSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource} WebsiteDataSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebsiteDataSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebsiteDataSource message. + * @function verify + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebsiteDataSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.estimatorUriPatterns != null && message.hasOwnProperty("estimatorUriPatterns")) { + if (!Array.isArray(message.estimatorUriPatterns)) + return "estimatorUriPatterns: array expected"; + for (var i = 0; i < message.estimatorUriPatterns.length; ++i) { + var error = $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern.verify(message.estimatorUriPatterns[i]); + if (error) + return "estimatorUriPatterns." + error; + } + } + return null; + }; + + /** + * Creates a WebsiteDataSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource} WebsiteDataSource + */ + WebsiteDataSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource) + return object; + var message = new $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource(); + if (object.estimatorUriPatterns) { + if (!Array.isArray(object.estimatorUriPatterns)) + throw TypeError(".google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.estimatorUriPatterns: array expected"); + message.estimatorUriPatterns = []; + for (var i = 0; i < object.estimatorUriPatterns.length; ++i) { + if (typeof object.estimatorUriPatterns[i] !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.estimatorUriPatterns: object expected"); + message.estimatorUriPatterns[i] = $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern.fromObject(object.estimatorUriPatterns[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a WebsiteDataSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource + * @static + * @param {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource} message WebsiteDataSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebsiteDataSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.estimatorUriPatterns = []; + if (message.estimatorUriPatterns && message.estimatorUriPatterns.length) { + object.estimatorUriPatterns = []; + for (var j = 0; j < message.estimatorUriPatterns.length; ++j) + object.estimatorUriPatterns[j] = $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern.toObject(message.estimatorUriPatterns[j], options); + } + return object; + }; + + /** + * Converts this WebsiteDataSource to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource + * @instance + * @returns {Object.} JSON object + */ + WebsiteDataSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WebsiteDataSource + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WebsiteDataSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource"; + }; + + WebsiteDataSource.EstimatorUriPattern = (function() { + + /** + * Properties of an EstimatorUriPattern. + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource + * @interface IEstimatorUriPattern + * @property {string|null} [providedUriPattern] EstimatorUriPattern providedUriPattern + * @property {boolean|null} [exactMatch] EstimatorUriPattern exactMatch + * @property {boolean|null} [exclusive] EstimatorUriPattern exclusive + */ + + /** + * Constructs a new EstimatorUriPattern. + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource + * @classdesc Represents an EstimatorUriPattern. + * @implements IEstimatorUriPattern + * @constructor + * @param {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.IEstimatorUriPattern=} [properties] Properties to set + */ + function EstimatorUriPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EstimatorUriPattern providedUriPattern. + * @member {string} providedUriPattern + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern + * @instance + */ + EstimatorUriPattern.prototype.providedUriPattern = ""; + + /** + * EstimatorUriPattern exactMatch. + * @member {boolean} exactMatch + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern + * @instance + */ + EstimatorUriPattern.prototype.exactMatch = false; + + /** + * EstimatorUriPattern exclusive. + * @member {boolean} exclusive + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern + * @instance + */ + EstimatorUriPattern.prototype.exclusive = false; + + /** + * Creates a new EstimatorUriPattern instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern + * @static + * @param {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.IEstimatorUriPattern=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern} EstimatorUriPattern instance + */ + EstimatorUriPattern.create = function create(properties) { + return new EstimatorUriPattern(properties); + }; + + /** + * Encodes the specified EstimatorUriPattern message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern + * @static + * @param {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.IEstimatorUriPattern} message EstimatorUriPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EstimatorUriPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.providedUriPattern != null && Object.hasOwnProperty.call(message, "providedUriPattern")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.providedUriPattern); + if (message.exactMatch != null && Object.hasOwnProperty.call(message, "exactMatch")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.exactMatch); + if (message.exclusive != null && Object.hasOwnProperty.call(message, "exclusive")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.exclusive); + return writer; + }; + + /** + * Encodes the specified EstimatorUriPattern message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern + * @static + * @param {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.IEstimatorUriPattern} message EstimatorUriPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EstimatorUriPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EstimatorUriPattern message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern} EstimatorUriPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EstimatorUriPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.providedUriPattern = reader.string(); + break; + } + case 2: { + message.exactMatch = reader.bool(); + break; + } + case 3: { + message.exclusive = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EstimatorUriPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern} EstimatorUriPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EstimatorUriPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EstimatorUriPattern message. + * @function verify + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EstimatorUriPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.providedUriPattern != null && message.hasOwnProperty("providedUriPattern")) + if (!$util.isString(message.providedUriPattern)) + return "providedUriPattern: string expected"; + if (message.exactMatch != null && message.hasOwnProperty("exactMatch")) + if (typeof message.exactMatch !== "boolean") + return "exactMatch: boolean expected"; + if (message.exclusive != null && message.hasOwnProperty("exclusive")) + if (typeof message.exclusive !== "boolean") + return "exclusive: boolean expected"; + return null; + }; + + /** + * Creates an EstimatorUriPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern} EstimatorUriPattern + */ + EstimatorUriPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern) + return object; + var message = new $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern(); + if (object.providedUriPattern != null) + message.providedUriPattern = String(object.providedUriPattern); + if (object.exactMatch != null) + message.exactMatch = Boolean(object.exactMatch); + if (object.exclusive != null) + message.exclusive = Boolean(object.exclusive); + return message; + }; + + /** + * Creates a plain object from an EstimatorUriPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern + * @static + * @param {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern} message EstimatorUriPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EstimatorUriPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.providedUriPattern = ""; + object.exactMatch = false; + object.exclusive = false; + } + if (message.providedUriPattern != null && message.hasOwnProperty("providedUriPattern")) + object.providedUriPattern = message.providedUriPattern; + if (message.exactMatch != null && message.hasOwnProperty("exactMatch")) + object.exactMatch = message.exactMatch; + if (message.exclusive != null && message.hasOwnProperty("exclusive")) + object.exclusive = message.exclusive; + return object; + }; + + /** + * Converts this EstimatorUriPattern to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern + * @instance + * @returns {Object.} JSON object + */ + EstimatorUriPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EstimatorUriPattern + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EstimatorUriPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern"; + }; - /** - * Encodes the specified TuneEngineResponse message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.TuneEngineResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineResponse - * @static - * @param {google.cloud.discoveryengine.v1alpha.ITuneEngineResponse} message TuneEngineResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TuneEngineResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; + return EstimatorUriPattern; + })(); - /** - * Encodes the specified TuneEngineResponse message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.TuneEngineResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineResponse - * @static - * @param {google.cloud.discoveryengine.v1alpha.ITuneEngineResponse} message TuneEngineResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TuneEngineResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return WebsiteDataSource; + })(); - /** - * Decodes a TuneEngineResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.discoveryengine.v1alpha.TuneEngineResponse} TuneEngineResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TuneEngineResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.TuneEngineResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } + EstimateDataSizeRequest.FileDataSource = (function() { + + /** + * Properties of a FileDataSource. + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest + * @interface IFileDataSource + * @property {google.cloud.discoveryengine.v1alpha.IGcsSource|null} [gcsSource] FileDataSource gcsSource + * @property {google.cloud.discoveryengine.v1alpha.IBigQuerySource|null} [bigquerySource] FileDataSource bigquerySource + */ + + /** + * Constructs a new FileDataSource. + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest + * @classdesc Represents a FileDataSource. + * @implements IFileDataSource + * @constructor + * @param {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.IFileDataSource=} [properties] Properties to set + */ + function FileDataSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - return message; - }; - /** - * Decodes a TuneEngineResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.discoveryengine.v1alpha.TuneEngineResponse} TuneEngineResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TuneEngineResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * FileDataSource gcsSource. + * @member {google.cloud.discoveryengine.v1alpha.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource + * @instance + */ + FileDataSource.prototype.gcsSource = null; - /** - * Verifies a TuneEngineResponse message. - * @function verify - * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TuneEngineResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; + /** + * FileDataSource bigquerySource. + * @member {google.cloud.discoveryengine.v1alpha.IBigQuerySource|null|undefined} bigquerySource + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource + * @instance + */ + FileDataSource.prototype.bigquerySource = null; - /** - * Creates a TuneEngineResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.discoveryengine.v1alpha.TuneEngineResponse} TuneEngineResponse - */ - TuneEngineResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.discoveryengine.v1alpha.TuneEngineResponse) - return object; - return new $root.google.cloud.discoveryengine.v1alpha.TuneEngineResponse(); - }; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Creates a plain object from a TuneEngineResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineResponse - * @static - * @param {google.cloud.discoveryengine.v1alpha.TuneEngineResponse} message TuneEngineResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TuneEngineResponse.toObject = function toObject() { - return {}; - }; + /** + * FileDataSource source. + * @member {"gcsSource"|"bigquerySource"|undefined} source + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource + * @instance + */ + Object.defineProperty(FileDataSource.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["gcsSource", "bigquerySource"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Converts this TuneEngineResponse to JSON. - * @function toJSON - * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineResponse - * @instance - * @returns {Object.} JSON object - */ - TuneEngineResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a new FileDataSource instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource + * @static + * @param {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.IFileDataSource=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource} FileDataSource instance + */ + FileDataSource.create = function create(properties) { + return new FileDataSource(properties); + }; - /** - * Gets the default type url for TuneEngineResponse - * @function getTypeUrl - * @memberof google.cloud.discoveryengine.v1alpha.TuneEngineResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TuneEngineResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.TuneEngineResponse"; - }; + /** + * Encodes the specified FileDataSource message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource + * @static + * @param {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.IFileDataSource} message FileDataSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDataSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + $root.google.cloud.discoveryengine.v1alpha.GcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.bigquerySource != null && Object.hasOwnProperty.call(message, "bigquerySource")) + $root.google.cloud.discoveryengine.v1alpha.BigQuerySource.encode(message.bigquerySource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; - return TuneEngineResponse; - })(); + /** + * Encodes the specified FileDataSource message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource + * @static + * @param {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.IFileDataSource} message FileDataSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDataSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - v1alpha.EstimateBillingService = (function() { + /** + * Decodes a FileDataSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource} FileDataSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDataSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsSource = $root.google.cloud.discoveryengine.v1alpha.GcsSource.decode(reader, reader.uint32()); + break; + } + case 2: { + message.bigquerySource = $root.google.cloud.discoveryengine.v1alpha.BigQuerySource.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Constructs a new EstimateBillingService service. - * @memberof google.cloud.discoveryengine.v1alpha - * @classdesc Represents an EstimateBillingService - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function EstimateBillingService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } + /** + * Decodes a FileDataSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource} FileDataSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDataSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - (EstimateBillingService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = EstimateBillingService; + /** + * Verifies a FileDataSource message. + * @function verify + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDataSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + properties.source = 1; + { + var error = $root.google.cloud.discoveryengine.v1alpha.GcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + } + if (message.bigquerySource != null && message.hasOwnProperty("bigquerySource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.discoveryengine.v1alpha.BigQuerySource.verify(message.bigquerySource); + if (error) + return "bigquerySource." + error; + } + } + return null; + }; - /** - * Creates new EstimateBillingService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.discoveryengine.v1alpha.EstimateBillingService - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {EstimateBillingService} RPC service. Useful where requests and/or responses are streamed. - */ - EstimateBillingService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; + /** + * Creates a FileDataSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource} FileDataSource + */ + FileDataSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource) + return object; + var message = new $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource(); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.discoveryengine.v1alpha.GcsSource.fromObject(object.gcsSource); + } + if (object.bigquerySource != null) { + if (typeof object.bigquerySource !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource.bigquerySource: object expected"); + message.bigquerySource = $root.google.cloud.discoveryengine.v1alpha.BigQuerySource.fromObject(object.bigquerySource); + } + return message; + }; - /** - * Callback as used by {@link google.cloud.discoveryengine.v1alpha.EstimateBillingService|estimateDataSize}. - * @memberof google.cloud.discoveryengine.v1alpha.EstimateBillingService - * @typedef EstimateDataSizeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ + /** + * Creates a plain object from a FileDataSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource + * @static + * @param {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource} message FileDataSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDataSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.discoveryengine.v1alpha.GcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.source = "gcsSource"; + } + if (message.bigquerySource != null && message.hasOwnProperty("bigquerySource")) { + object.bigquerySource = $root.google.cloud.discoveryengine.v1alpha.BigQuerySource.toObject(message.bigquerySource, options); + if (options.oneofs) + object.source = "bigquerySource"; + } + return object; + }; - /** - * Calls EstimateDataSize. - * @function estimateDataSize - * @memberof google.cloud.discoveryengine.v1alpha.EstimateBillingService - * @instance - * @param {google.cloud.discoveryengine.v1alpha.IEstimateDataSizeRequest} request EstimateDataSizeRequest message or plain object - * @param {google.cloud.discoveryengine.v1alpha.EstimateBillingService.EstimateDataSizeCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(EstimateBillingService.prototype.estimateDataSize = function estimateDataSize(request, callback) { - return this.rpcCall(estimateDataSize, $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "EstimateDataSize" }); + /** + * Converts this FileDataSource to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource + * @instance + * @returns {Object.} JSON object + */ + FileDataSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Calls EstimateDataSize. - * @function estimateDataSize - * @memberof google.cloud.discoveryengine.v1alpha.EstimateBillingService - * @instance - * @param {google.cloud.discoveryengine.v1alpha.IEstimateDataSizeRequest} request EstimateDataSizeRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Gets the default type url for FileDataSource + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDataSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource"; + }; - return EstimateBillingService; + return FileDataSource; + })(); + + return EstimateDataSizeRequest; })(); - v1alpha.EstimateDataSizeRequest = (function() { + v1alpha.EstimateDataSizeResponse = (function() { /** - * Properties of an EstimateDataSizeRequest. + * Properties of an EstimateDataSizeResponse. * @memberof google.cloud.discoveryengine.v1alpha - * @interface IEstimateDataSizeRequest - * @property {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.IWebsiteDataSource|null} [websiteDataSource] EstimateDataSizeRequest websiteDataSource - * @property {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.IFileDataSource|null} [fileDataSource] EstimateDataSizeRequest fileDataSource - * @property {string|null} [location] EstimateDataSizeRequest location + * @interface IEstimateDataSizeResponse + * @property {number|Long|null} [dataSizeBytes] EstimateDataSizeResponse dataSizeBytes + * @property {number|Long|null} [documentCount] EstimateDataSizeResponse documentCount */ /** - * Constructs a new EstimateDataSizeRequest. + * Constructs a new EstimateDataSizeResponse. * @memberof google.cloud.discoveryengine.v1alpha - * @classdesc Represents an EstimateDataSizeRequest. - * @implements IEstimateDataSizeRequest + * @classdesc Represents an EstimateDataSizeResponse. + * @implements IEstimateDataSizeResponse * @constructor - * @param {google.cloud.discoveryengine.v1alpha.IEstimateDataSizeRequest=} [properties] Properties to set + * @param {google.cloud.discoveryengine.v1alpha.IEstimateDataSizeResponse=} [properties] Properties to set */ - function EstimateDataSizeRequest(properties) { + function EstimateDataSizeResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -86648,117 +93223,89 @@ } /** - * EstimateDataSizeRequest websiteDataSource. - * @member {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.IWebsiteDataSource|null|undefined} websiteDataSource - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest - * @instance - */ - EstimateDataSizeRequest.prototype.websiteDataSource = null; - - /** - * EstimateDataSizeRequest fileDataSource. - * @member {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.IFileDataSource|null|undefined} fileDataSource - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest - * @instance - */ - EstimateDataSizeRequest.prototype.fileDataSource = null; - - /** - * EstimateDataSizeRequest location. - * @member {string} location - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest + * EstimateDataSizeResponse dataSizeBytes. + * @member {number|Long} dataSizeBytes + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse * @instance */ - EstimateDataSizeRequest.prototype.location = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + EstimateDataSizeResponse.prototype.dataSizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * EstimateDataSizeRequest dataSource. - * @member {"websiteDataSource"|"fileDataSource"|undefined} dataSource - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest + * EstimateDataSizeResponse documentCount. + * @member {number|Long} documentCount + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse * @instance */ - Object.defineProperty(EstimateDataSizeRequest.prototype, "dataSource", { - get: $util.oneOfGetter($oneOfFields = ["websiteDataSource", "fileDataSource"]), - set: $util.oneOfSetter($oneOfFields) - }); + EstimateDataSizeResponse.prototype.documentCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new EstimateDataSizeRequest instance using the specified properties. + * Creates a new EstimateDataSizeResponse instance using the specified properties. * @function create - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse * @static - * @param {google.cloud.discoveryengine.v1alpha.IEstimateDataSizeRequest=} [properties] Properties to set - * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest} EstimateDataSizeRequest instance + * @param {google.cloud.discoveryengine.v1alpha.IEstimateDataSizeResponse=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse} EstimateDataSizeResponse instance */ - EstimateDataSizeRequest.create = function create(properties) { - return new EstimateDataSizeRequest(properties); + EstimateDataSizeResponse.create = function create(properties) { + return new EstimateDataSizeResponse(properties); }; /** - * Encodes the specified EstimateDataSizeRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.verify|verify} messages. + * Encodes the specified EstimateDataSizeResponse message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse * @static - * @param {google.cloud.discoveryengine.v1alpha.IEstimateDataSizeRequest} message EstimateDataSizeRequest message or plain object to encode + * @param {google.cloud.discoveryengine.v1alpha.IEstimateDataSizeResponse} message EstimateDataSizeResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EstimateDataSizeRequest.encode = function encode(message, writer) { + EstimateDataSizeResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); - if (message.websiteDataSource != null && Object.hasOwnProperty.call(message, "websiteDataSource")) - $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.encode(message.websiteDataSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.fileDataSource != null && Object.hasOwnProperty.call(message, "fileDataSource")) - $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource.encode(message.fileDataSource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.dataSizeBytes != null && Object.hasOwnProperty.call(message, "dataSizeBytes")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.dataSizeBytes); + if (message.documentCount != null && Object.hasOwnProperty.call(message, "documentCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.documentCount); return writer; }; /** - * Encodes the specified EstimateDataSizeRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.verify|verify} messages. + * Encodes the specified EstimateDataSizeResponse message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse * @static - * @param {google.cloud.discoveryengine.v1alpha.IEstimateDataSizeRequest} message EstimateDataSizeRequest message or plain object to encode + * @param {google.cloud.discoveryengine.v1alpha.IEstimateDataSizeResponse} message EstimateDataSizeResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EstimateDataSizeRequest.encodeDelimited = function encodeDelimited(message, writer) { + EstimateDataSizeResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EstimateDataSizeRequest message from the specified reader or buffer. + * Decodes an EstimateDataSizeResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest} EstimateDataSizeRequest + * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse} EstimateDataSizeResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EstimateDataSizeRequest.decode = function decode(reader, length) { + EstimateDataSizeResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: { - message.websiteDataSource = $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.decode(reader, reader.uint32()); - break; - } - case 3: { - message.fileDataSource = $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource.decode(reader, reader.uint32()); + case 1: { + message.dataSizeBytes = reader.int64(); break; } - case 1: { - message.location = reader.string(); + case 2: { + message.documentCount = reader.int64(); break; } default: @@ -86770,898 +93317,714 @@ }; /** - * Decodes an EstimateDataSizeRequest message from the specified reader or buffer, length delimited. + * Decodes an EstimateDataSizeResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest} EstimateDataSizeRequest + * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse} EstimateDataSizeResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EstimateDataSizeRequest.decodeDelimited = function decodeDelimited(reader) { + EstimateDataSizeResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EstimateDataSizeRequest message. + * Verifies an EstimateDataSizeResponse message. * @function verify - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - EstimateDataSizeRequest.verify = function verify(message) { + EstimateDataSizeResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.websiteDataSource != null && message.hasOwnProperty("websiteDataSource")) { - properties.dataSource = 1; - { - var error = $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.verify(message.websiteDataSource); - if (error) - return "websiteDataSource." + error; - } - } - if (message.fileDataSource != null && message.hasOwnProperty("fileDataSource")) { - if (properties.dataSource === 1) - return "dataSource: multiple values"; - properties.dataSource = 1; - { - var error = $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource.verify(message.fileDataSource); - if (error) - return "fileDataSource." + error; - } - } - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; + if (message.dataSizeBytes != null && message.hasOwnProperty("dataSizeBytes")) + if (!$util.isInteger(message.dataSizeBytes) && !(message.dataSizeBytes && $util.isInteger(message.dataSizeBytes.low) && $util.isInteger(message.dataSizeBytes.high))) + return "dataSizeBytes: integer|Long expected"; + if (message.documentCount != null && message.hasOwnProperty("documentCount")) + if (!$util.isInteger(message.documentCount) && !(message.documentCount && $util.isInteger(message.documentCount.low) && $util.isInteger(message.documentCount.high))) + return "documentCount: integer|Long expected"; return null; }; /** - * Creates an EstimateDataSizeRequest message from a plain object. Also converts values to their respective internal types. + * Creates an EstimateDataSizeResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest} EstimateDataSizeRequest + * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse} EstimateDataSizeResponse */ - EstimateDataSizeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest) + EstimateDataSizeResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse) return object; - var message = new $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest(); - if (object.websiteDataSource != null) { - if (typeof object.websiteDataSource !== "object") - throw TypeError(".google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.websiteDataSource: object expected"); - message.websiteDataSource = $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.fromObject(object.websiteDataSource); - } - if (object.fileDataSource != null) { - if (typeof object.fileDataSource !== "object") - throw TypeError(".google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.fileDataSource: object expected"); - message.fileDataSource = $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource.fromObject(object.fileDataSource); - } - if (object.location != null) - message.location = String(object.location); + var message = new $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse(); + if (object.dataSizeBytes != null) + if ($util.Long) + (message.dataSizeBytes = $util.Long.fromValue(object.dataSizeBytes)).unsigned = false; + else if (typeof object.dataSizeBytes === "string") + message.dataSizeBytes = parseInt(object.dataSizeBytes, 10); + else if (typeof object.dataSizeBytes === "number") + message.dataSizeBytes = object.dataSizeBytes; + else if (typeof object.dataSizeBytes === "object") + message.dataSizeBytes = new $util.LongBits(object.dataSizeBytes.low >>> 0, object.dataSizeBytes.high >>> 0).toNumber(); + if (object.documentCount != null) + if ($util.Long) + (message.documentCount = $util.Long.fromValue(object.documentCount)).unsigned = false; + else if (typeof object.documentCount === "string") + message.documentCount = parseInt(object.documentCount, 10); + else if (typeof object.documentCount === "number") + message.documentCount = object.documentCount; + else if (typeof object.documentCount === "object") + message.documentCount = new $util.LongBits(object.documentCount.low >>> 0, object.documentCount.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from an EstimateDataSizeRequest message. Also converts values to other types if specified. + * Creates a plain object from an EstimateDataSizeResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse * @static - * @param {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest} message EstimateDataSizeRequest + * @param {google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse} message EstimateDataSizeResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EstimateDataSizeRequest.toObject = function toObject(message, options) { + EstimateDataSizeResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.location = ""; - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - if (message.websiteDataSource != null && message.hasOwnProperty("websiteDataSource")) { - object.websiteDataSource = $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.toObject(message.websiteDataSource, options); - if (options.oneofs) - object.dataSource = "websiteDataSource"; - } - if (message.fileDataSource != null && message.hasOwnProperty("fileDataSource")) { - object.fileDataSource = $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource.toObject(message.fileDataSource, options); - if (options.oneofs) - object.dataSource = "fileDataSource"; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.dataSizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.dataSizeBytes = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.documentCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.documentCount = options.longs === String ? "0" : 0; } + if (message.dataSizeBytes != null && message.hasOwnProperty("dataSizeBytes")) + if (typeof message.dataSizeBytes === "number") + object.dataSizeBytes = options.longs === String ? String(message.dataSizeBytes) : message.dataSizeBytes; + else + object.dataSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.dataSizeBytes) : options.longs === Number ? new $util.LongBits(message.dataSizeBytes.low >>> 0, message.dataSizeBytes.high >>> 0).toNumber() : message.dataSizeBytes; + if (message.documentCount != null && message.hasOwnProperty("documentCount")) + if (typeof message.documentCount === "number") + object.documentCount = options.longs === String ? String(message.documentCount) : message.documentCount; + else + object.documentCount = options.longs === String ? $util.Long.prototype.toString.call(message.documentCount) : options.longs === Number ? new $util.LongBits(message.documentCount.low >>> 0, message.documentCount.high >>> 0).toNumber() : message.documentCount; return object; }; /** - * Converts this EstimateDataSizeRequest to JSON. + * Converts this EstimateDataSizeResponse to JSON. * @function toJSON - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse * @instance * @returns {Object.} JSON object */ - EstimateDataSizeRequest.prototype.toJSON = function toJSON() { + EstimateDataSizeResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EstimateDataSizeRequest + * Gets the default type url for EstimateDataSizeResponse * @function getTypeUrl - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EstimateDataSizeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + EstimateDataSizeResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest"; + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse"; }; - EstimateDataSizeRequest.WebsiteDataSource = (function() { - - /** - * Properties of a WebsiteDataSource. - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest - * @interface IWebsiteDataSource - * @property {Array.|null} [estimatorUriPatterns] WebsiteDataSource estimatorUriPatterns - */ - - /** - * Constructs a new WebsiteDataSource. - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest - * @classdesc Represents a WebsiteDataSource. - * @implements IWebsiteDataSource - * @constructor - * @param {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.IWebsiteDataSource=} [properties] Properties to set - */ - function WebsiteDataSource(properties) { - this.estimatorUriPatterns = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WebsiteDataSource estimatorUriPatterns. - * @member {Array.} estimatorUriPatterns - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource - * @instance - */ - WebsiteDataSource.prototype.estimatorUriPatterns = $util.emptyArray; - - /** - * Creates a new WebsiteDataSource instance using the specified properties. - * @function create - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource - * @static - * @param {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.IWebsiteDataSource=} [properties] Properties to set - * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource} WebsiteDataSource instance - */ - WebsiteDataSource.create = function create(properties) { - return new WebsiteDataSource(properties); - }; - - /** - * Encodes the specified WebsiteDataSource message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.verify|verify} messages. - * @function encode - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource - * @static - * @param {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.IWebsiteDataSource} message WebsiteDataSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WebsiteDataSource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.estimatorUriPatterns != null && message.estimatorUriPatterns.length) - for (var i = 0; i < message.estimatorUriPatterns.length; ++i) - $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern.encode(message.estimatorUriPatterns[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified WebsiteDataSource message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource - * @static - * @param {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.IWebsiteDataSource} message WebsiteDataSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WebsiteDataSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WebsiteDataSource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource} WebsiteDataSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WebsiteDataSource.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.estimatorUriPatterns && message.estimatorUriPatterns.length)) - message.estimatorUriPatterns = []; - message.estimatorUriPatterns.push($root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WebsiteDataSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource} WebsiteDataSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WebsiteDataSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return EstimateDataSizeResponse; + })(); - /** - * Verifies a WebsiteDataSource message. - * @function verify - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WebsiteDataSource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.estimatorUriPatterns != null && message.hasOwnProperty("estimatorUriPatterns")) { - if (!Array.isArray(message.estimatorUriPatterns)) - return "estimatorUriPatterns: array expected"; - for (var i = 0; i < message.estimatorUriPatterns.length; ++i) { - var error = $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern.verify(message.estimatorUriPatterns[i]); - if (error) - return "estimatorUriPatterns." + error; - } - } - return null; - }; + v1alpha.EstimateDataSizeMetadata = (function() { - /** - * Creates a WebsiteDataSource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource} WebsiteDataSource - */ - WebsiteDataSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource) - return object; - var message = new $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource(); - if (object.estimatorUriPatterns) { - if (!Array.isArray(object.estimatorUriPatterns)) - throw TypeError(".google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.estimatorUriPatterns: array expected"); - message.estimatorUriPatterns = []; - for (var i = 0; i < object.estimatorUriPatterns.length; ++i) { - if (typeof object.estimatorUriPatterns[i] !== "object") - throw TypeError(".google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.estimatorUriPatterns: object expected"); - message.estimatorUriPatterns[i] = $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern.fromObject(object.estimatorUriPatterns[i]); - } - } - return message; - }; + /** + * Properties of an EstimateDataSizeMetadata. + * @memberof google.cloud.discoveryengine.v1alpha + * @interface IEstimateDataSizeMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] EstimateDataSizeMetadata createTime + */ - /** - * Creates a plain object from a WebsiteDataSource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource - * @static - * @param {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource} message WebsiteDataSource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WebsiteDataSource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.estimatorUriPatterns = []; - if (message.estimatorUriPatterns && message.estimatorUriPatterns.length) { - object.estimatorUriPatterns = []; - for (var j = 0; j < message.estimatorUriPatterns.length; ++j) - object.estimatorUriPatterns[j] = $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern.toObject(message.estimatorUriPatterns[j], options); - } - return object; - }; + /** + * Constructs a new EstimateDataSizeMetadata. + * @memberof google.cloud.discoveryengine.v1alpha + * @classdesc Represents an EstimateDataSizeMetadata. + * @implements IEstimateDataSizeMetadata + * @constructor + * @param {google.cloud.discoveryengine.v1alpha.IEstimateDataSizeMetadata=} [properties] Properties to set + */ + function EstimateDataSizeMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Converts this WebsiteDataSource to JSON. - * @function toJSON - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource - * @instance - * @returns {Object.} JSON object - */ - WebsiteDataSource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * EstimateDataSizeMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata + * @instance + */ + EstimateDataSizeMetadata.prototype.createTime = null; - /** - * Gets the default type url for WebsiteDataSource - * @function getTypeUrl - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WebsiteDataSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource"; - }; + /** + * Creates a new EstimateDataSizeMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata + * @static + * @param {google.cloud.discoveryengine.v1alpha.IEstimateDataSizeMetadata=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata} EstimateDataSizeMetadata instance + */ + EstimateDataSizeMetadata.create = function create(properties) { + return new EstimateDataSizeMetadata(properties); + }; - WebsiteDataSource.EstimatorUriPattern = (function() { + /** + * Encodes the specified EstimateDataSizeMetadata message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata + * @static + * @param {google.cloud.discoveryengine.v1alpha.IEstimateDataSizeMetadata} message EstimateDataSizeMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EstimateDataSizeMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; - /** - * Properties of an EstimatorUriPattern. - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource - * @interface IEstimatorUriPattern - * @property {string|null} [providedUriPattern] EstimatorUriPattern providedUriPattern - * @property {boolean|null} [exactMatch] EstimatorUriPattern exactMatch - * @property {boolean|null} [exclusive] EstimatorUriPattern exclusive - */ + /** + * Encodes the specified EstimateDataSizeMetadata message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata + * @static + * @param {google.cloud.discoveryengine.v1alpha.IEstimateDataSizeMetadata} message EstimateDataSizeMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EstimateDataSizeMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Constructs a new EstimatorUriPattern. - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource - * @classdesc Represents an EstimatorUriPattern. - * @implements IEstimatorUriPattern - * @constructor - * @param {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.IEstimatorUriPattern=} [properties] Properties to set - */ - function EstimatorUriPattern(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Decodes an EstimateDataSizeMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata} EstimateDataSizeMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EstimateDataSizeMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; } + } + return message; + }; - /** - * EstimatorUriPattern providedUriPattern. - * @member {string} providedUriPattern - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern - * @instance - */ - EstimatorUriPattern.prototype.providedUriPattern = ""; - - /** - * EstimatorUriPattern exactMatch. - * @member {boolean} exactMatch - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern - * @instance - */ - EstimatorUriPattern.prototype.exactMatch = false; - - /** - * EstimatorUriPattern exclusive. - * @member {boolean} exclusive - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern - * @instance - */ - EstimatorUriPattern.prototype.exclusive = false; + /** + * Decodes an EstimateDataSizeMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata} EstimateDataSizeMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EstimateDataSizeMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a new EstimatorUriPattern instance using the specified properties. - * @function create - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern - * @static - * @param {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.IEstimatorUriPattern=} [properties] Properties to set - * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern} EstimatorUriPattern instance - */ - EstimatorUriPattern.create = function create(properties) { - return new EstimatorUriPattern(properties); - }; + /** + * Verifies an EstimateDataSizeMetadata message. + * @function verify + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EstimateDataSizeMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + return null; + }; - /** - * Encodes the specified EstimatorUriPattern message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern.verify|verify} messages. - * @function encode - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern - * @static - * @param {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.IEstimatorUriPattern} message EstimatorUriPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EstimatorUriPattern.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.providedUriPattern != null && Object.hasOwnProperty.call(message, "providedUriPattern")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.providedUriPattern); - if (message.exactMatch != null && Object.hasOwnProperty.call(message, "exactMatch")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.exactMatch); - if (message.exclusive != null && Object.hasOwnProperty.call(message, "exclusive")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.exclusive); - return writer; - }; + /** + * Creates an EstimateDataSizeMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata} EstimateDataSizeMetadata + */ + EstimateDataSizeMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata) + return object; + var message = new $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + return message; + }; - /** - * Encodes the specified EstimatorUriPattern message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern - * @static - * @param {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.IEstimatorUriPattern} message EstimatorUriPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EstimatorUriPattern.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a plain object from an EstimateDataSizeMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata + * @static + * @param {google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata} message EstimateDataSizeMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EstimateDataSizeMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.createTime = null; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + return object; + }; - /** - * Decodes an EstimatorUriPattern message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern} EstimatorUriPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EstimatorUriPattern.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.providedUriPattern = reader.string(); - break; - } - case 2: { - message.exactMatch = reader.bool(); - break; - } - case 3: { - message.exclusive = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Converts this EstimateDataSizeMetadata to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata + * @instance + * @returns {Object.} JSON object + */ + EstimateDataSizeMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes an EstimatorUriPattern message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern} EstimatorUriPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EstimatorUriPattern.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Gets the default type url for EstimateDataSizeMetadata + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EstimateDataSizeMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata"; + }; - /** - * Verifies an EstimatorUriPattern message. - * @function verify - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EstimatorUriPattern.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.providedUriPattern != null && message.hasOwnProperty("providedUriPattern")) - if (!$util.isString(message.providedUriPattern)) - return "providedUriPattern: string expected"; - if (message.exactMatch != null && message.hasOwnProperty("exactMatch")) - if (typeof message.exactMatch !== "boolean") - return "exactMatch: boolean expected"; - if (message.exclusive != null && message.hasOwnProperty("exclusive")) - if (typeof message.exclusive !== "boolean") - return "exclusive: boolean expected"; - return null; - }; + return EstimateDataSizeMetadata; + })(); - /** - * Creates an EstimatorUriPattern message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern} EstimatorUriPattern - */ - EstimatorUriPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern) - return object; - var message = new $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern(); - if (object.providedUriPattern != null) - message.providedUriPattern = String(object.providedUriPattern); - if (object.exactMatch != null) - message.exactMatch = Boolean(object.exactMatch); - if (object.exclusive != null) - message.exclusive = Boolean(object.exclusive); - return message; - }; + v1alpha.RankService = (function() { - /** - * Creates a plain object from an EstimatorUriPattern message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern - * @static - * @param {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern} message EstimatorUriPattern - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EstimatorUriPattern.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.providedUriPattern = ""; - object.exactMatch = false; - object.exclusive = false; - } - if (message.providedUriPattern != null && message.hasOwnProperty("providedUriPattern")) - object.providedUriPattern = message.providedUriPattern; - if (message.exactMatch != null && message.hasOwnProperty("exactMatch")) - object.exactMatch = message.exactMatch; - if (message.exclusive != null && message.hasOwnProperty("exclusive")) - object.exclusive = message.exclusive; - return object; - }; + /** + * Constructs a new RankService service. + * @memberof google.cloud.discoveryengine.v1alpha + * @classdesc Represents a RankService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function RankService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } - /** - * Converts this EstimatorUriPattern to JSON. - * @function toJSON - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern - * @instance - * @returns {Object.} JSON object - */ - EstimatorUriPattern.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + (RankService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = RankService; - /** - * Gets the default type url for EstimatorUriPattern - * @function getTypeUrl - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EstimatorUriPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.WebsiteDataSource.EstimatorUriPattern"; - }; + /** + * Creates new RankService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.discoveryengine.v1alpha.RankService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {RankService} RPC service. Useful where requests and/or responses are streamed. + */ + RankService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; - return EstimatorUriPattern; - })(); + /** + * Callback as used by {@link google.cloud.discoveryengine.v1alpha.RankService|rank}. + * @memberof google.cloud.discoveryengine.v1alpha.RankService + * @typedef RankCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.discoveryengine.v1alpha.RankResponse} [response] RankResponse + */ - return WebsiteDataSource; - })(); + /** + * Calls Rank. + * @function rank + * @memberof google.cloud.discoveryengine.v1alpha.RankService + * @instance + * @param {google.cloud.discoveryengine.v1alpha.IRankRequest} request RankRequest message or plain object + * @param {google.cloud.discoveryengine.v1alpha.RankService.RankCallback} callback Node-style callback called with the error, if any, and RankResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RankService.prototype.rank = function rank(request, callback) { + return this.rpcCall(rank, $root.google.cloud.discoveryengine.v1alpha.RankRequest, $root.google.cloud.discoveryengine.v1alpha.RankResponse, request, callback); + }, "name", { value: "Rank" }); - EstimateDataSizeRequest.FileDataSource = (function() { + /** + * Calls Rank. + * @function rank + * @memberof google.cloud.discoveryengine.v1alpha.RankService + * @instance + * @param {google.cloud.discoveryengine.v1alpha.IRankRequest} request RankRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Properties of a FileDataSource. - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest - * @interface IFileDataSource - * @property {google.cloud.discoveryengine.v1alpha.IGcsSource|null} [gcsSource] FileDataSource gcsSource - * @property {google.cloud.discoveryengine.v1alpha.IBigQuerySource|null} [bigquerySource] FileDataSource bigquerySource - */ + return RankService; + })(); - /** - * Constructs a new FileDataSource. - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest - * @classdesc Represents a FileDataSource. - * @implements IFileDataSource - * @constructor - * @param {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.IFileDataSource=} [properties] Properties to set - */ - function FileDataSource(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + v1alpha.RankingRecord = (function() { - /** - * FileDataSource gcsSource. - * @member {google.cloud.discoveryengine.v1alpha.IGcsSource|null|undefined} gcsSource - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource - * @instance - */ - FileDataSource.prototype.gcsSource = null; + /** + * Properties of a RankingRecord. + * @memberof google.cloud.discoveryengine.v1alpha + * @interface IRankingRecord + * @property {string|null} [id] RankingRecord id + * @property {string|null} [title] RankingRecord title + * @property {string|null} [content] RankingRecord content + * @property {number|null} [score] RankingRecord score + */ - /** - * FileDataSource bigquerySource. - * @member {google.cloud.discoveryengine.v1alpha.IBigQuerySource|null|undefined} bigquerySource - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource - * @instance - */ - FileDataSource.prototype.bigquerySource = null; + /** + * Constructs a new RankingRecord. + * @memberof google.cloud.discoveryengine.v1alpha + * @classdesc Represents a RankingRecord. + * @implements IRankingRecord + * @constructor + * @param {google.cloud.discoveryengine.v1alpha.IRankingRecord=} [properties] Properties to set + */ + function RankingRecord(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * RankingRecord id. + * @member {string} id + * @memberof google.cloud.discoveryengine.v1alpha.RankingRecord + * @instance + */ + RankingRecord.prototype.id = ""; - /** - * FileDataSource source. - * @member {"gcsSource"|"bigquerySource"|undefined} source - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource - * @instance - */ - Object.defineProperty(FileDataSource.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["gcsSource", "bigquerySource"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * RankingRecord title. + * @member {string} title + * @memberof google.cloud.discoveryengine.v1alpha.RankingRecord + * @instance + */ + RankingRecord.prototype.title = ""; - /** - * Creates a new FileDataSource instance using the specified properties. - * @function create - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource - * @static - * @param {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.IFileDataSource=} [properties] Properties to set - * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource} FileDataSource instance - */ - FileDataSource.create = function create(properties) { - return new FileDataSource(properties); - }; + /** + * RankingRecord content. + * @member {string} content + * @memberof google.cloud.discoveryengine.v1alpha.RankingRecord + * @instance + */ + RankingRecord.prototype.content = ""; - /** - * Encodes the specified FileDataSource message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource.verify|verify} messages. - * @function encode - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource - * @static - * @param {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.IFileDataSource} message FileDataSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDataSource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) - $root.google.cloud.discoveryengine.v1alpha.GcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.bigquerySource != null && Object.hasOwnProperty.call(message, "bigquerySource")) - $root.google.cloud.discoveryengine.v1alpha.BigQuerySource.encode(message.bigquerySource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + /** + * RankingRecord score. + * @member {number} score + * @memberof google.cloud.discoveryengine.v1alpha.RankingRecord + * @instance + */ + RankingRecord.prototype.score = 0; - /** - * Encodes the specified FileDataSource message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource - * @static - * @param {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.IFileDataSource} message FileDataSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDataSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a new RankingRecord instance using the specified properties. + * @function create + * @memberof google.cloud.discoveryengine.v1alpha.RankingRecord + * @static + * @param {google.cloud.discoveryengine.v1alpha.IRankingRecord=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.RankingRecord} RankingRecord instance + */ + RankingRecord.create = function create(properties) { + return new RankingRecord(properties); + }; - /** - * Decodes a FileDataSource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource} FileDataSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDataSource.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.gcsSource = $root.google.cloud.discoveryengine.v1alpha.GcsSource.decode(reader, reader.uint32()); - break; - } - case 2: { - message.bigquerySource = $root.google.cloud.discoveryengine.v1alpha.BigQuerySource.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Encodes the specified RankingRecord message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.RankingRecord.verify|verify} messages. + * @function encode + * @memberof google.cloud.discoveryengine.v1alpha.RankingRecord + * @static + * @param {google.cloud.discoveryengine.v1alpha.IRankingRecord} message RankingRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RankingRecord.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.content); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.score); + return writer; + }; - /** - * Decodes a FileDataSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource} FileDataSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDataSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified RankingRecord message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.RankingRecord.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.RankingRecord + * @static + * @param {google.cloud.discoveryengine.v1alpha.IRankingRecord} message RankingRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RankingRecord.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Verifies a FileDataSource message. - * @function verify - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDataSource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { - properties.source = 1; - { - var error = $root.google.cloud.discoveryengine.v1alpha.GcsSource.verify(message.gcsSource); - if (error) - return "gcsSource." + error; + /** + * Decodes a RankingRecord message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.discoveryengine.v1alpha.RankingRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.discoveryengine.v1alpha.RankingRecord} RankingRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RankingRecord.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.RankingRecord(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; } - } - if (message.bigquerySource != null && message.hasOwnProperty("bigquerySource")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.discoveryengine.v1alpha.BigQuerySource.verify(message.bigquerySource); - if (error) - return "bigquerySource." + error; + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.content = reader.string(); + break; + } + case 4: { + message.score = reader.float(); + break; } + default: + reader.skipType(tag & 7); + break; } - return null; - }; + } + return message; + }; - /** - * Creates a FileDataSource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource} FileDataSource - */ - FileDataSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource) - return object; - var message = new $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource(); - if (object.gcsSource != null) { - if (typeof object.gcsSource !== "object") - throw TypeError(".google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource.gcsSource: object expected"); - message.gcsSource = $root.google.cloud.discoveryengine.v1alpha.GcsSource.fromObject(object.gcsSource); - } - if (object.bigquerySource != null) { - if (typeof object.bigquerySource !== "object") - throw TypeError(".google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource.bigquerySource: object expected"); - message.bigquerySource = $root.google.cloud.discoveryengine.v1alpha.BigQuerySource.fromObject(object.bigquerySource); - } - return message; - }; + /** + * Decodes a RankingRecord message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.discoveryengine.v1alpha.RankingRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.discoveryengine.v1alpha.RankingRecord} RankingRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RankingRecord.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a plain object from a FileDataSource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource - * @static - * @param {google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource} message FileDataSource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDataSource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { - object.gcsSource = $root.google.cloud.discoveryengine.v1alpha.GcsSource.toObject(message.gcsSource, options); - if (options.oneofs) - object.source = "gcsSource"; - } - if (message.bigquerySource != null && message.hasOwnProperty("bigquerySource")) { - object.bigquerySource = $root.google.cloud.discoveryengine.v1alpha.BigQuerySource.toObject(message.bigquerySource, options); - if (options.oneofs) - object.source = "bigquerySource"; - } + /** + * Verifies a RankingRecord message. + * @function verify + * @memberof google.cloud.discoveryengine.v1alpha.RankingRecord + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RankingRecord.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + return null; + }; + + /** + * Creates a RankingRecord message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.discoveryengine.v1alpha.RankingRecord + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.discoveryengine.v1alpha.RankingRecord} RankingRecord + */ + RankingRecord.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.RankingRecord) return object; - }; + var message = new $root.google.cloud.discoveryengine.v1alpha.RankingRecord(); + if (object.id != null) + message.id = String(object.id); + if (object.title != null) + message.title = String(object.title); + if (object.content != null) + message.content = String(object.content); + if (object.score != null) + message.score = Number(object.score); + return message; + }; - /** - * Converts this FileDataSource to JSON. - * @function toJSON - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource - * @instance - * @returns {Object.} JSON object - */ - FileDataSource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a RankingRecord message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.discoveryengine.v1alpha.RankingRecord + * @static + * @param {google.cloud.discoveryengine.v1alpha.RankingRecord} message RankingRecord + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RankingRecord.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.title = ""; + object.content = ""; + object.score = 0; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + return object; + }; - /** - * Gets the default type url for FileDataSource - * @function getTypeUrl - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDataSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.EstimateDataSizeRequest.FileDataSource"; - }; + /** + * Converts this RankingRecord to JSON. + * @function toJSON + * @memberof google.cloud.discoveryengine.v1alpha.RankingRecord + * @instance + * @returns {Object.} JSON object + */ + RankingRecord.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return FileDataSource; - })(); + /** + * Gets the default type url for RankingRecord + * @function getTypeUrl + * @memberof google.cloud.discoveryengine.v1alpha.RankingRecord + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RankingRecord.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.RankingRecord"; + }; - return EstimateDataSizeRequest; + return RankingRecord; })(); - v1alpha.EstimateDataSizeResponse = (function() { + v1alpha.RankRequest = (function() { /** - * Properties of an EstimateDataSizeResponse. + * Properties of a RankRequest. * @memberof google.cloud.discoveryengine.v1alpha - * @interface IEstimateDataSizeResponse - * @property {number|Long|null} [dataSizeBytes] EstimateDataSizeResponse dataSizeBytes - * @property {number|Long|null} [documentCount] EstimateDataSizeResponse documentCount + * @interface IRankRequest + * @property {string|null} [rankingConfig] RankRequest rankingConfig + * @property {string|null} [model] RankRequest model + * @property {number|null} [topN] RankRequest topN + * @property {string|null} [query] RankRequest query + * @property {Array.|null} [records] RankRequest records + * @property {boolean|null} [ignoreRecordDetailsInResponse] RankRequest ignoreRecordDetailsInResponse */ /** - * Constructs a new EstimateDataSizeResponse. + * Constructs a new RankRequest. * @memberof google.cloud.discoveryengine.v1alpha - * @classdesc Represents an EstimateDataSizeResponse. - * @implements IEstimateDataSizeResponse + * @classdesc Represents a RankRequest. + * @implements IRankRequest * @constructor - * @param {google.cloud.discoveryengine.v1alpha.IEstimateDataSizeResponse=} [properties] Properties to set + * @param {google.cloud.discoveryengine.v1alpha.IRankRequest=} [properties] Properties to set */ - function EstimateDataSizeResponse(properties) { + function RankRequest(properties) { + this.records = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -87669,89 +94032,148 @@ } /** - * EstimateDataSizeResponse dataSizeBytes. - * @member {number|Long} dataSizeBytes - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse + * RankRequest rankingConfig. + * @member {string} rankingConfig + * @memberof google.cloud.discoveryengine.v1alpha.RankRequest * @instance */ - EstimateDataSizeResponse.prototype.dataSizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + RankRequest.prototype.rankingConfig = ""; /** - * EstimateDataSizeResponse documentCount. - * @member {number|Long} documentCount - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse + * RankRequest model. + * @member {string} model + * @memberof google.cloud.discoveryengine.v1alpha.RankRequest * @instance */ - EstimateDataSizeResponse.prototype.documentCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + RankRequest.prototype.model = ""; /** - * Creates a new EstimateDataSizeResponse instance using the specified properties. + * RankRequest topN. + * @member {number} topN + * @memberof google.cloud.discoveryengine.v1alpha.RankRequest + * @instance + */ + RankRequest.prototype.topN = 0; + + /** + * RankRequest query. + * @member {string} query + * @memberof google.cloud.discoveryengine.v1alpha.RankRequest + * @instance + */ + RankRequest.prototype.query = ""; + + /** + * RankRequest records. + * @member {Array.} records + * @memberof google.cloud.discoveryengine.v1alpha.RankRequest + * @instance + */ + RankRequest.prototype.records = $util.emptyArray; + + /** + * RankRequest ignoreRecordDetailsInResponse. + * @member {boolean} ignoreRecordDetailsInResponse + * @memberof google.cloud.discoveryengine.v1alpha.RankRequest + * @instance + */ + RankRequest.prototype.ignoreRecordDetailsInResponse = false; + + /** + * Creates a new RankRequest instance using the specified properties. * @function create - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse + * @memberof google.cloud.discoveryengine.v1alpha.RankRequest * @static - * @param {google.cloud.discoveryengine.v1alpha.IEstimateDataSizeResponse=} [properties] Properties to set - * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse} EstimateDataSizeResponse instance + * @param {google.cloud.discoveryengine.v1alpha.IRankRequest=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.RankRequest} RankRequest instance */ - EstimateDataSizeResponse.create = function create(properties) { - return new EstimateDataSizeResponse(properties); + RankRequest.create = function create(properties) { + return new RankRequest(properties); }; /** - * Encodes the specified EstimateDataSizeResponse message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse.verify|verify} messages. + * Encodes the specified RankRequest message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.RankRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse + * @memberof google.cloud.discoveryengine.v1alpha.RankRequest * @static - * @param {google.cloud.discoveryengine.v1alpha.IEstimateDataSizeResponse} message EstimateDataSizeResponse message or plain object to encode + * @param {google.cloud.discoveryengine.v1alpha.IRankRequest} message RankRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EstimateDataSizeResponse.encode = function encode(message, writer) { + RankRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.dataSizeBytes != null && Object.hasOwnProperty.call(message, "dataSizeBytes")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.dataSizeBytes); - if (message.documentCount != null && Object.hasOwnProperty.call(message, "documentCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.documentCount); + if (message.rankingConfig != null && Object.hasOwnProperty.call(message, "rankingConfig")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.rankingConfig); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.model); + if (message.topN != null && Object.hasOwnProperty.call(message, "topN")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.topN); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.query); + if (message.records != null && message.records.length) + for (var i = 0; i < message.records.length; ++i) + $root.google.cloud.discoveryengine.v1alpha.RankingRecord.encode(message.records[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.ignoreRecordDetailsInResponse != null && Object.hasOwnProperty.call(message, "ignoreRecordDetailsInResponse")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.ignoreRecordDetailsInResponse); return writer; }; /** - * Encodes the specified EstimateDataSizeResponse message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse.verify|verify} messages. + * Encodes the specified RankRequest message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.RankRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse + * @memberof google.cloud.discoveryengine.v1alpha.RankRequest * @static - * @param {google.cloud.discoveryengine.v1alpha.IEstimateDataSizeResponse} message EstimateDataSizeResponse message or plain object to encode + * @param {google.cloud.discoveryengine.v1alpha.IRankRequest} message RankRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EstimateDataSizeResponse.encodeDelimited = function encodeDelimited(message, writer) { + RankRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EstimateDataSizeResponse message from the specified reader or buffer. + * Decodes a RankRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse + * @memberof google.cloud.discoveryengine.v1alpha.RankRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse} EstimateDataSizeResponse + * @returns {google.cloud.discoveryengine.v1alpha.RankRequest} RankRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EstimateDataSizeResponse.decode = function decode(reader, length) { + RankRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.RankRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.dataSizeBytes = reader.int64(); + message.rankingConfig = reader.string(); break; } case 2: { - message.documentCount = reader.int64(); + message.model = reader.string(); + break; + } + case 3: { + message.topN = reader.int32(); + break; + } + case 4: { + message.query = reader.string(); + break; + } + case 5: { + if (!(message.records && message.records.length)) + message.records = []; + message.records.push($root.google.cloud.discoveryengine.v1alpha.RankingRecord.decode(reader, reader.uint32())); + break; + } + case 6: { + message.ignoreRecordDetailsInResponse = reader.bool(); break; } default: @@ -87763,159 +94185,182 @@ }; /** - * Decodes an EstimateDataSizeResponse message from the specified reader or buffer, length delimited. + * Decodes a RankRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse + * @memberof google.cloud.discoveryengine.v1alpha.RankRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse} EstimateDataSizeResponse + * @returns {google.cloud.discoveryengine.v1alpha.RankRequest} RankRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EstimateDataSizeResponse.decodeDelimited = function decodeDelimited(reader) { + RankRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EstimateDataSizeResponse message. + * Verifies a RankRequest message. * @function verify - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse + * @memberof google.cloud.discoveryengine.v1alpha.RankRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - EstimateDataSizeResponse.verify = function verify(message) { + RankRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.dataSizeBytes != null && message.hasOwnProperty("dataSizeBytes")) - if (!$util.isInteger(message.dataSizeBytes) && !(message.dataSizeBytes && $util.isInteger(message.dataSizeBytes.low) && $util.isInteger(message.dataSizeBytes.high))) - return "dataSizeBytes: integer|Long expected"; - if (message.documentCount != null && message.hasOwnProperty("documentCount")) - if (!$util.isInteger(message.documentCount) && !(message.documentCount && $util.isInteger(message.documentCount.low) && $util.isInteger(message.documentCount.high))) - return "documentCount: integer|Long expected"; + if (message.rankingConfig != null && message.hasOwnProperty("rankingConfig")) + if (!$util.isString(message.rankingConfig)) + return "rankingConfig: string expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.topN != null && message.hasOwnProperty("topN")) + if (!$util.isInteger(message.topN)) + return "topN: integer expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.records != null && message.hasOwnProperty("records")) { + if (!Array.isArray(message.records)) + return "records: array expected"; + for (var i = 0; i < message.records.length; ++i) { + var error = $root.google.cloud.discoveryengine.v1alpha.RankingRecord.verify(message.records[i]); + if (error) + return "records." + error; + } + } + if (message.ignoreRecordDetailsInResponse != null && message.hasOwnProperty("ignoreRecordDetailsInResponse")) + if (typeof message.ignoreRecordDetailsInResponse !== "boolean") + return "ignoreRecordDetailsInResponse: boolean expected"; return null; }; /** - * Creates an EstimateDataSizeResponse message from a plain object. Also converts values to their respective internal types. + * Creates a RankRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse + * @memberof google.cloud.discoveryengine.v1alpha.RankRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse} EstimateDataSizeResponse + * @returns {google.cloud.discoveryengine.v1alpha.RankRequest} RankRequest */ - EstimateDataSizeResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse) + RankRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.RankRequest) return object; - var message = new $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse(); - if (object.dataSizeBytes != null) - if ($util.Long) - (message.dataSizeBytes = $util.Long.fromValue(object.dataSizeBytes)).unsigned = false; - else if (typeof object.dataSizeBytes === "string") - message.dataSizeBytes = parseInt(object.dataSizeBytes, 10); - else if (typeof object.dataSizeBytes === "number") - message.dataSizeBytes = object.dataSizeBytes; - else if (typeof object.dataSizeBytes === "object") - message.dataSizeBytes = new $util.LongBits(object.dataSizeBytes.low >>> 0, object.dataSizeBytes.high >>> 0).toNumber(); - if (object.documentCount != null) - if ($util.Long) - (message.documentCount = $util.Long.fromValue(object.documentCount)).unsigned = false; - else if (typeof object.documentCount === "string") - message.documentCount = parseInt(object.documentCount, 10); - else if (typeof object.documentCount === "number") - message.documentCount = object.documentCount; - else if (typeof object.documentCount === "object") - message.documentCount = new $util.LongBits(object.documentCount.low >>> 0, object.documentCount.high >>> 0).toNumber(); + var message = new $root.google.cloud.discoveryengine.v1alpha.RankRequest(); + if (object.rankingConfig != null) + message.rankingConfig = String(object.rankingConfig); + if (object.model != null) + message.model = String(object.model); + if (object.topN != null) + message.topN = object.topN | 0; + if (object.query != null) + message.query = String(object.query); + if (object.records) { + if (!Array.isArray(object.records)) + throw TypeError(".google.cloud.discoveryengine.v1alpha.RankRequest.records: array expected"); + message.records = []; + for (var i = 0; i < object.records.length; ++i) { + if (typeof object.records[i] !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.RankRequest.records: object expected"); + message.records[i] = $root.google.cloud.discoveryengine.v1alpha.RankingRecord.fromObject(object.records[i]); + } + } + if (object.ignoreRecordDetailsInResponse != null) + message.ignoreRecordDetailsInResponse = Boolean(object.ignoreRecordDetailsInResponse); return message; }; /** - * Creates a plain object from an EstimateDataSizeResponse message. Also converts values to other types if specified. + * Creates a plain object from a RankRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse + * @memberof google.cloud.discoveryengine.v1alpha.RankRequest * @static - * @param {google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse} message EstimateDataSizeResponse + * @param {google.cloud.discoveryengine.v1alpha.RankRequest} message RankRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EstimateDataSizeResponse.toObject = function toObject(message, options) { + RankRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.records = []; if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.dataSizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.dataSizeBytes = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.documentCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.documentCount = options.longs === String ? "0" : 0; + object.rankingConfig = ""; + object.model = ""; + object.topN = 0; + object.query = ""; + object.ignoreRecordDetailsInResponse = false; + } + if (message.rankingConfig != null && message.hasOwnProperty("rankingConfig")) + object.rankingConfig = message.rankingConfig; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.topN != null && message.hasOwnProperty("topN")) + object.topN = message.topN; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.records && message.records.length) { + object.records = []; + for (var j = 0; j < message.records.length; ++j) + object.records[j] = $root.google.cloud.discoveryengine.v1alpha.RankingRecord.toObject(message.records[j], options); } - if (message.dataSizeBytes != null && message.hasOwnProperty("dataSizeBytes")) - if (typeof message.dataSizeBytes === "number") - object.dataSizeBytes = options.longs === String ? String(message.dataSizeBytes) : message.dataSizeBytes; - else - object.dataSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.dataSizeBytes) : options.longs === Number ? new $util.LongBits(message.dataSizeBytes.low >>> 0, message.dataSizeBytes.high >>> 0).toNumber() : message.dataSizeBytes; - if (message.documentCount != null && message.hasOwnProperty("documentCount")) - if (typeof message.documentCount === "number") - object.documentCount = options.longs === String ? String(message.documentCount) : message.documentCount; - else - object.documentCount = options.longs === String ? $util.Long.prototype.toString.call(message.documentCount) : options.longs === Number ? new $util.LongBits(message.documentCount.low >>> 0, message.documentCount.high >>> 0).toNumber() : message.documentCount; + if (message.ignoreRecordDetailsInResponse != null && message.hasOwnProperty("ignoreRecordDetailsInResponse")) + object.ignoreRecordDetailsInResponse = message.ignoreRecordDetailsInResponse; return object; }; /** - * Converts this EstimateDataSizeResponse to JSON. + * Converts this RankRequest to JSON. * @function toJSON - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse + * @memberof google.cloud.discoveryengine.v1alpha.RankRequest * @instance * @returns {Object.} JSON object */ - EstimateDataSizeResponse.prototype.toJSON = function toJSON() { + RankRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EstimateDataSizeResponse + * Gets the default type url for RankRequest * @function getTypeUrl - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse + * @memberof google.cloud.discoveryengine.v1alpha.RankRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EstimateDataSizeResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RankRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.EstimateDataSizeResponse"; + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.RankRequest"; }; - return EstimateDataSizeResponse; + return RankRequest; })(); - v1alpha.EstimateDataSizeMetadata = (function() { + v1alpha.RankResponse = (function() { /** - * Properties of an EstimateDataSizeMetadata. + * Properties of a RankResponse. * @memberof google.cloud.discoveryengine.v1alpha - * @interface IEstimateDataSizeMetadata - * @property {google.protobuf.ITimestamp|null} [createTime] EstimateDataSizeMetadata createTime + * @interface IRankResponse + * @property {Array.|null} [records] RankResponse records */ /** - * Constructs a new EstimateDataSizeMetadata. + * Constructs a new RankResponse. * @memberof google.cloud.discoveryengine.v1alpha - * @classdesc Represents an EstimateDataSizeMetadata. - * @implements IEstimateDataSizeMetadata + * @classdesc Represents a RankResponse. + * @implements IRankResponse * @constructor - * @param {google.cloud.discoveryengine.v1alpha.IEstimateDataSizeMetadata=} [properties] Properties to set + * @param {google.cloud.discoveryengine.v1alpha.IRankResponse=} [properties] Properties to set */ - function EstimateDataSizeMetadata(properties) { + function RankResponse(properties) { + this.records = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -87923,75 +94368,78 @@ } /** - * EstimateDataSizeMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata + * RankResponse records. + * @member {Array.} records + * @memberof google.cloud.discoveryengine.v1alpha.RankResponse * @instance */ - EstimateDataSizeMetadata.prototype.createTime = null; + RankResponse.prototype.records = $util.emptyArray; /** - * Creates a new EstimateDataSizeMetadata instance using the specified properties. + * Creates a new RankResponse instance using the specified properties. * @function create - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata + * @memberof google.cloud.discoveryengine.v1alpha.RankResponse * @static - * @param {google.cloud.discoveryengine.v1alpha.IEstimateDataSizeMetadata=} [properties] Properties to set - * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata} EstimateDataSizeMetadata instance + * @param {google.cloud.discoveryengine.v1alpha.IRankResponse=} [properties] Properties to set + * @returns {google.cloud.discoveryengine.v1alpha.RankResponse} RankResponse instance */ - EstimateDataSizeMetadata.create = function create(properties) { - return new EstimateDataSizeMetadata(properties); + RankResponse.create = function create(properties) { + return new RankResponse(properties); }; /** - * Encodes the specified EstimateDataSizeMetadata message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata.verify|verify} messages. + * Encodes the specified RankResponse message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.RankResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata + * @memberof google.cloud.discoveryengine.v1alpha.RankResponse * @static - * @param {google.cloud.discoveryengine.v1alpha.IEstimateDataSizeMetadata} message EstimateDataSizeMetadata message or plain object to encode + * @param {google.cloud.discoveryengine.v1alpha.IRankResponse} message RankResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EstimateDataSizeMetadata.encode = function encode(message, writer) { + RankResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.records != null && message.records.length) + for (var i = 0; i < message.records.length; ++i) + $root.google.cloud.discoveryengine.v1alpha.RankingRecord.encode(message.records[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; /** - * Encodes the specified EstimateDataSizeMetadata message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata.verify|verify} messages. + * Encodes the specified RankResponse message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.RankResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata + * @memberof google.cloud.discoveryengine.v1alpha.RankResponse * @static - * @param {google.cloud.discoveryengine.v1alpha.IEstimateDataSizeMetadata} message EstimateDataSizeMetadata message or plain object to encode + * @param {google.cloud.discoveryengine.v1alpha.IRankResponse} message RankResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EstimateDataSizeMetadata.encodeDelimited = function encodeDelimited(message, writer) { + RankResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EstimateDataSizeMetadata message from the specified reader or buffer. + * Decodes a RankResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata + * @memberof google.cloud.discoveryengine.v1alpha.RankResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata} EstimateDataSizeMetadata + * @returns {google.cloud.discoveryengine.v1alpha.RankResponse} RankResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EstimateDataSizeMetadata.decode = function decode(reader, length) { + RankResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.RankResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + case 5: { + if (!(message.records && message.records.length)) + message.records = []; + message.records.push($root.google.cloud.discoveryengine.v1alpha.RankingRecord.decode(reader, reader.uint32())); break; } default: @@ -88003,107 +94451,119 @@ }; /** - * Decodes an EstimateDataSizeMetadata message from the specified reader or buffer, length delimited. + * Decodes a RankResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata + * @memberof google.cloud.discoveryengine.v1alpha.RankResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata} EstimateDataSizeMetadata + * @returns {google.cloud.discoveryengine.v1alpha.RankResponse} RankResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EstimateDataSizeMetadata.decodeDelimited = function decodeDelimited(reader) { + RankResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EstimateDataSizeMetadata message. + * Verifies a RankResponse message. * @function verify - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata + * @memberof google.cloud.discoveryengine.v1alpha.RankResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - EstimateDataSizeMetadata.verify = function verify(message) { + RankResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; + if (message.records != null && message.hasOwnProperty("records")) { + if (!Array.isArray(message.records)) + return "records: array expected"; + for (var i = 0; i < message.records.length; ++i) { + var error = $root.google.cloud.discoveryengine.v1alpha.RankingRecord.verify(message.records[i]); + if (error) + return "records." + error; + } } return null; }; /** - * Creates an EstimateDataSizeMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a RankResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata + * @memberof google.cloud.discoveryengine.v1alpha.RankResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata} EstimateDataSizeMetadata + * @returns {google.cloud.discoveryengine.v1alpha.RankResponse} RankResponse */ - EstimateDataSizeMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata) + RankResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.discoveryengine.v1alpha.RankResponse) return object; - var message = new $root.google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata(); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + var message = new $root.google.cloud.discoveryengine.v1alpha.RankResponse(); + if (object.records) { + if (!Array.isArray(object.records)) + throw TypeError(".google.cloud.discoveryengine.v1alpha.RankResponse.records: array expected"); + message.records = []; + for (var i = 0; i < object.records.length; ++i) { + if (typeof object.records[i] !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.RankResponse.records: object expected"); + message.records[i] = $root.google.cloud.discoveryengine.v1alpha.RankingRecord.fromObject(object.records[i]); + } } return message; }; /** - * Creates a plain object from an EstimateDataSizeMetadata message. Also converts values to other types if specified. + * Creates a plain object from a RankResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata + * @memberof google.cloud.discoveryengine.v1alpha.RankResponse * @static - * @param {google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata} message EstimateDataSizeMetadata + * @param {google.cloud.discoveryengine.v1alpha.RankResponse} message RankResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EstimateDataSizeMetadata.toObject = function toObject(message, options) { + RankResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.createTime = null; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (options.arrays || options.defaults) + object.records = []; + if (message.records && message.records.length) { + object.records = []; + for (var j = 0; j < message.records.length; ++j) + object.records[j] = $root.google.cloud.discoveryengine.v1alpha.RankingRecord.toObject(message.records[j], options); + } return object; }; /** - * Converts this EstimateDataSizeMetadata to JSON. + * Converts this RankResponse to JSON. * @function toJSON - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata + * @memberof google.cloud.discoveryengine.v1alpha.RankResponse * @instance * @returns {Object.} JSON object */ - EstimateDataSizeMetadata.prototype.toJSON = function toJSON() { + RankResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EstimateDataSizeMetadata + * Gets the default type url for RankResponse * @function getTypeUrl - * @memberof google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata + * @memberof google.cloud.discoveryengine.v1alpha.RankResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EstimateDataSizeMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RankResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.EstimateDataSizeMetadata"; + return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.RankResponse"; }; - return EstimateDataSizeMetadata; + return RankResponse; })(); v1alpha.RecommendationService = (function() { @@ -92164,6 +98624,7 @@ * @property {Array.|null} [errorSamples] TrainCustomModelResponse errorSamples * @property {google.cloud.discoveryengine.v1alpha.IImportErrorConfig|null} [errorConfig] TrainCustomModelResponse errorConfig * @property {string|null} [modelStatus] TrainCustomModelResponse modelStatus + * @property {Object.|null} [metrics] TrainCustomModelResponse metrics */ /** @@ -92176,6 +98637,7 @@ */ function TrainCustomModelResponse(properties) { this.errorSamples = []; + this.metrics = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -92206,6 +98668,14 @@ */ TrainCustomModelResponse.prototype.modelStatus = ""; + /** + * TrainCustomModelResponse metrics. + * @member {Object.} metrics + * @memberof google.cloud.discoveryengine.v1alpha.TrainCustomModelResponse + * @instance + */ + TrainCustomModelResponse.prototype.metrics = $util.emptyObject; + /** * Creates a new TrainCustomModelResponse instance using the specified properties. * @function create @@ -92237,6 +98707,9 @@ $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.encode(message.errorConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.modelStatus != null && Object.hasOwnProperty.call(message, "modelStatus")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.modelStatus); + if (message.metrics != null && Object.hasOwnProperty.call(message, "metrics")) + for (var keys = Object.keys(message.metrics), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 1 =*/17).double(message.metrics[keys[i]]).ldelim(); return writer; }; @@ -92267,7 +98740,7 @@ TrainCustomModelResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.TrainCustomModelResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.TrainCustomModelResponse(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -92285,6 +98758,29 @@ message.modelStatus = reader.string(); break; } + case 4: { + if (message.metrics === $util.emptyObject) + message.metrics = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = 0; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.double(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.metrics[key] = value; + break; + } default: reader.skipType(tag & 7); break; @@ -92337,6 +98833,14 @@ if (message.modelStatus != null && message.hasOwnProperty("modelStatus")) if (!$util.isString(message.modelStatus)) return "modelStatus: string expected"; + if (message.metrics != null && message.hasOwnProperty("metrics")) { + if (!$util.isObject(message.metrics)) + return "metrics: object expected"; + var key = Object.keys(message.metrics); + for (var i = 0; i < key.length; ++i) + if (typeof message.metrics[key[i]] !== "number") + return "metrics: number{k:string} expected"; + } return null; }; @@ -92369,6 +98873,13 @@ } if (object.modelStatus != null) message.modelStatus = String(object.modelStatus); + if (object.metrics) { + if (typeof object.metrics !== "object") + throw TypeError(".google.cloud.discoveryengine.v1alpha.TrainCustomModelResponse.metrics: object expected"); + message.metrics = {}; + for (var keys = Object.keys(object.metrics), i = 0; i < keys.length; ++i) + message.metrics[keys[i]] = Number(object.metrics[keys[i]]); + } return message; }; @@ -92387,6 +98898,8 @@ var object = {}; if (options.arrays || options.defaults) object.errorSamples = []; + if (options.objects || options.defaults) + object.metrics = {}; if (options.defaults) { object.errorConfig = null; object.modelStatus = ""; @@ -92400,6 +98913,12 @@ object.errorConfig = $root.google.cloud.discoveryengine.v1alpha.ImportErrorConfig.toObject(message.errorConfig, options); if (message.modelStatus != null && message.hasOwnProperty("modelStatus")) object.modelStatus = message.modelStatus; + var keys2; + if (message.metrics && (keys2 = Object.keys(message.metrics)).length) { + object.metrics = {}; + for (var j = 0; j < keys2.length; ++j) + object.metrics[keys2[j]] = options.json && !isFinite(message.metrics[keys2[j]]) ? String(message.metrics[keys2[j]]) : message.metrics[keys2[j]]; + } return object; }; @@ -93179,6 +99698,7 @@ case 1: case 2: case 3: + case 4: break; } if (message.modelId != null && message.hasOwnProperty("modelId")) @@ -93323,6 +99843,10 @@ case 3: message.solutionType = 3; break; + case "SOLUTION_TYPE_GENERATIVE_CHAT": + case 4: + message.solutionType = 4; + break; } if (object.modelId != null) message.modelId = String(object.modelId); diff --git a/packages/google-cloud-discoveryengine/protos/protos.json b/packages/google-cloud-discoveryengine/protos/protos.json index 3605db30619..7cc669b7328 100644 --- a/packages/google-cloud-discoveryengine/protos/protos.json +++ b/packages/google-cloud-discoveryengine/protos/protos.json @@ -4538,8 +4538,8 @@ "objc_class_prefix": "DISCOVERYENGINE", "php_namespace": "Google\\Cloud\\DiscoveryEngine\\V1alpha", "ruby_package": "Google::Cloud::DiscoveryEngine::V1alpha", - "(google.api.resource_definition).type": "discoveryengine.googleapis.com/Location", - "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}" + "(google.api.resource_definition).type": "healthcare.googleapis.com/FhirStore", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/datasets/{dataset}/fhirStores/{fhir_store}" }, "nested": { "AclConfig": { @@ -4565,7 +4565,8 @@ "values": { "INDUSTRY_VERTICAL_UNSPECIFIED": 0, "GENERIC": 1, - "MEDIA": 2 + "MEDIA": 2, + "HEALTHCARE_FHIR": 7 } }, "SolutionType": { @@ -4573,7 +4574,8 @@ "SOLUTION_TYPE_UNSPECIFIED": 0, "SOLUTION_TYPE_RECOMMENDATION": 1, "SOLUTION_TYPE_SEARCH": 2, - "SOLUTION_TYPE_CHAT": 3 + "SOLUTION_TYPE_CHAT": 3, + "SOLUTION_TYPE_GENERATIVE_CHAT": 4 } }, "SearchTier": { @@ -4832,6 +4834,17 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "pageSpan": { + "type": "PageSpan", + "id": 6 + }, + "chunkMetadata": { + "type": "ChunkMetadata", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { @@ -4846,6 +4859,32 @@ "id": 2 } } + }, + "PageSpan": { + "fields": { + "pageStart": { + "type": "int32", + "id": 1 + }, + "pageEnd": { + "type": "int32", + "id": 2 + } + } + }, + "ChunkMetadata": { + "fields": { + "previousChunks": { + "rule": "repeated", + "type": "Chunk", + "id": 1 + }, + "nextChunks": { + "rule": "repeated", + "type": "Chunk", + "id": 2 + } + } } } }, @@ -5175,6 +5214,225 @@ } } }, + "SpannerSource": { + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "instanceId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "databaseId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "tableId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "enableDataBoost": { + "type": "bool", + "id": 5 + } + } + }, + "BigtableOptions": { + "fields": { + "keyFieldName": { + "type": "string", + "id": 1 + }, + "families": { + "keyType": "string", + "type": "BigtableColumnFamily", + "id": 2 + } + }, + "nested": { + "BigtableColumnFamily": { + "fields": { + "fieldName": { + "type": "string", + "id": 1 + }, + "encoding": { + "type": "Encoding", + "id": 2 + }, + "type": { + "type": "Type", + "id": 3 + }, + "columns": { + "rule": "repeated", + "type": "BigtableColumn", + "id": 4 + } + } + }, + "BigtableColumn": { + "fields": { + "qualifier": { + "type": "bytes", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "fieldName": { + "type": "string", + "id": 2 + }, + "encoding": { + "type": "Encoding", + "id": 3 + }, + "type": { + "type": "Type", + "id": 4 + } + } + }, + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "STRING": 1, + "NUMBER": 2, + "INTEGER": 3, + "VAR_INTEGER": 4, + "BIG_NUMERIC": 5, + "BOOLEAN": 6, + "JSON": 7 + } + }, + "Encoding": { + "values": { + "ENCODING_UNSPECIFIED": 0, + "TEXT": 1, + "BINARY": 2 + } + } + } + }, + "BigtableSource": { + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "instanceId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "tableId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "bigtableOptions": { + "type": "BigtableOptions", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "FhirStoreSource": { + "fields": { + "fhirStore": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "healthcare.googleapis.com/FhirStore" + } + }, + "gcsStagingDir": { + "type": "string", + "id": 2 + } + } + }, + "CloudSqlSource": { + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "instanceId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "databaseId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "tableId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "gcsStagingDir": { + "type": "string", + "id": 5 + }, + "offload": { + "type": "bool", + "id": 6 + } + } + }, + "FirestoreSource": { + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "databaseId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "collectionId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "gcsStagingDir": { + "type": "string", + "id": 4 + } + } + }, "ImportErrorConfig": { "oneofs": { "destination": { @@ -5299,6 +5557,10 @@ "failureCount": { "type": "int64", "id": 4 + }, + "totalCount": { + "type": "int64", + "id": 5 } } }, @@ -5308,7 +5570,12 @@ "oneof": [ "inlineSource", "gcsSource", - "bigquerySource" + "bigquerySource", + "fhirStoreSource", + "spannerSource", + "cloudSqlSource", + "firestoreSource", + "bigtableSource" ] } }, @@ -5325,6 +5592,26 @@ "type": "BigQuerySource", "id": 4 }, + "fhirStoreSource": { + "type": "FhirStoreSource", + "id": 10 + }, + "spannerSource": { + "type": "SpannerSource", + "id": 11 + }, + "cloudSqlSource": { + "type": "CloudSqlSource", + "id": 12 + }, + "firestoreSource": { + "type": "FirestoreSource", + "id": 13 + }, + "bigtableSource": { + "type": "BigtableSource", + "id": 15 + }, "parent": { "type": "string", "id": 1, @@ -5341,6 +5628,10 @@ "type": "ReconciliationMode", "id": 6 }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 7 + }, "autoGenerateIds": { "type": "bool", "id": 8 @@ -5456,6 +5747,35 @@ } } }, + "ImportCompletionSuggestionsResponse": { + "fields": { + "errorSamples": { + "rule": "repeated", + "type": "google.rpc.Status", + "id": 1 + }, + "successCount": { + "type": "int64", + "id": 2 + }, + "failureCount": { + "type": "int64", + "id": 3 + } + } + }, + "ImportCompletionSuggestionsMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, "Document": { "options": { "(google.api.resource).type": "discoveryengine.googleapis.com/Document", @@ -5570,6 +5890,29 @@ } } }, + "ProcessedDocument": { + "oneofs": { + "processedDataFormat": { + "oneof": [ + "jsonData" + ] + } + }, + "fields": { + "jsonData": { + "type": "string", + "id": 2 + }, + "document": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "discoveryengine.googleapis.com/Document" + } + } + } + }, "UserEvent": { "fields": { "eventType": { @@ -6477,6 +6820,60 @@ "boost": { "type": "float", "id": 2 + }, + "boostControlSpec": { + "type": "BoostControlSpec", + "id": 3 + } + }, + "nested": { + "BoostControlSpec": { + "fields": { + "fieldName": { + "type": "string", + "id": 1 + }, + "attributeType": { + "type": "AttributeType", + "id": 2 + }, + "interpolationType": { + "type": "InterpolationType", + "id": 3 + }, + "controlPoints": { + "rule": "repeated", + "type": "ControlPoint", + "id": 4 + } + }, + "nested": { + "ControlPoint": { + "fields": { + "attributeValue": { + "type": "string", + "id": 1 + }, + "boostAmount": { + "type": "float", + "id": 2 + } + } + }, + "AttributeType": { + "values": { + "ATTRIBUTE_TYPE_UNSPECIFIED": 0, + "NUMERICAL": 1, + "FRESHNESS": 2 + } + }, + "InterpolationType": { + "values": { + "INTERPOLATION_TYPE_UNSPECIFIED": 0, + "LINEAR": 1 + } + } + } } } } @@ -6537,6 +6934,10 @@ "searchResultMode": { "type": "SearchResultMode", "id": 4 + }, + "chunkSpec": { + "type": "ChunkSpec", + "id": 5 } }, "nested": { @@ -6591,6 +6992,10 @@ "modelSpec": { "type": "ModelSpec", "id": 7 + }, + "useSemanticChunks": { + "type": "bool", + "id": 8 } }, "nested": { @@ -6636,6 +7041,18 @@ } } }, + "ChunkSpec": { + "fields": { + "numPreviousChunks": { + "type": "int32", + "id": 1 + }, + "numNextChunks": { + "type": "int32", + "id": 2 + } + } + }, "SearchResultMode": { "values": { "SEARCH_RESULT_MODE_UNSPECIFIED": 0, @@ -6905,6 +7322,25 @@ "uri": { "type": "string", "id": 3 + }, + "chunkContents": { + "rule": "repeated", + "type": "ChunkContent", + "id": 4 + } + }, + "nested": { + "ChunkContent": { + "fields": { + "content": { + "type": "string", + "id": 1 + }, + "pageIdentifier": { + "type": "string", + "id": 2 + } + } } } }, @@ -8183,6 +8619,28 @@ } } ] + }, + "GetProcessedDocument": { + "requestType": "GetProcessedDocumentRequest", + "responseType": "ProcessedDocument", + "options": { + "(google.api.http).get": "/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*/documents/*}:getProcessedDocument", + "(google.api.http).additional_bindings.get": "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}:getProcessedDocument", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*/documents/*}:getProcessedDocument", + "additional_bindings": { + "get": "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}:getProcessedDocument" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] } } }, @@ -8288,6 +8746,44 @@ } } }, + "GetProcessedDocumentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "discoveryengine.googleapis.com/Document" + } + }, + "processedDocumentType": { + "type": "ProcessedDocumentType", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "processedDocumentFormat": { + "type": "ProcessedDocumentFormat", + "id": 3 + } + }, + "nested": { + "ProcessedDocumentType": { + "values": { + "PROCESSED_DOCUMENT_TYPE_UNSPECIFIED": 0, + "PARSED_DOCUMENT": 1, + "CHUNKED_DOCUMENT": 2 + } + }, + "ProcessedDocumentFormat": { + "values": { + "PROCESSED_DOCUMENT_FORMAT_UNSPECIFIED": 0, + "JSON": 1 + } + } + } + }, "Engine": { "options": { "(google.api.resource).type": "discoveryengine.googleapis.com/Engine", @@ -9067,6 +9563,95 @@ } } }, + "RankService": { + "options": { + "(google.api.default_host)": "discoveryengine.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Rank": { + "requestType": "RankRequest", + "responseType": "RankResponse", + "options": { + "(google.api.http).post": "/v1alpha/{ranking_config=projects/*/locations/*/rankingConfigs/*}:rank", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{ranking_config=projects/*/locations/*/rankingConfigs/*}:rank", + "body": "*" + } + } + ] + } + } + }, + "RankingRecord": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "content": { + "type": "string", + "id": 3 + }, + "score": { + "type": "float", + "id": 4 + } + } + }, + "RankRequest": { + "fields": { + "rankingConfig": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "discoveryengine.googleapis.com/RankingConfig" + } + }, + "model": { + "type": "string", + "id": 2 + }, + "topN": { + "type": "int32", + "id": 3 + }, + "query": { + "type": "string", + "id": 4 + }, + "records": { + "rule": "repeated", + "type": "RankingRecord", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "ignoreRecordDetailsInResponse": { + "type": "bool", + "id": 6 + } + } + }, + "RankResponse": { + "fields": { + "records": { + "rule": "repeated", + "type": "RankingRecord", + "id": 5 + } + } + }, "RecommendationService": { "options": { "(google.api.default_host)": "discoveryengine.googleapis.com", @@ -9564,6 +10149,11 @@ "modelStatus": { "type": "string", "id": 3 + }, + "metrics": { + "keyType": "string", + "type": "double", + "id": 4 } } }, diff --git a/packages/google-cloud-discoveryengine/samples/README.md b/packages/google-cloud-discoveryengine/samples/README.md index 5717a687316..33ef00c9dd1 100644 --- a/packages/google-cloud-discoveryengine/samples/README.md +++ b/packages/google-cloud-discoveryengine/samples/README.md @@ -82,6 +82,7 @@ * [Document_service.create_document](#document_service.create_document) * [Document_service.delete_document](#document_service.delete_document) * [Document_service.get_document](#document_service.get_document) + * [Document_service.get_processed_document](#document_service.get_processed_document) * [Document_service.import_documents](#document_service.import_documents) * [Document_service.list_documents](#document_service.list_documents) * [Document_service.purge_documents](#document_service.purge_documents) @@ -95,6 +96,7 @@ * [Engine_service.tune_engine](#engine_service.tune_engine) * [Engine_service.update_engine](#engine_service.update_engine) * [Estimate_billing_service.estimate_data_size](#estimate_billing_service.estimate_data_size) + * [Rank_service.rank](#rank_service.rank) * [Recommendation_service.recommend](#recommendation_service.recommend) * [Schema_service.create_schema](#schema_service.create_schema) * [Schema_service.delete_schema](#schema_service.delete_schema) @@ -1381,6 +1383,23 @@ __Usage:__ +### Document_service.get_processed_document + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1alpha/document_service.get_processed_document.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-discoveryengine/samples/generated/v1alpha/document_service.get_processed_document.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-discoveryengine/samples/generated/v1alpha/document_service.get_processed_document.js` + + +----- + + + + ### Document_service.import_documents View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1alpha/document_service.import_documents.js). @@ -1602,6 +1621,23 @@ __Usage:__ +### Rank_service.rank + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1alpha/rank_service.rank.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-discoveryengine/samples/generated/v1alpha/rank_service.rank.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-discoveryengine/samples/generated/v1alpha/rank_service.rank.js` + + +----- + + + + ### Recommendation_service.recommend View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1alpha/recommendation_service.recommend.js). diff --git a/packages/google-cloud-discoveryengine/samples/generated/v1alpha/document_service.get_processed_document.js b/packages/google-cloud-discoveryengine/samples/generated/v1alpha/document_service.get_processed_document.js new file mode 100644 index 00000000000..b76dc518423 --- /dev/null +++ b/packages/google-cloud-discoveryengine/samples/generated/v1alpha/document_service.get_processed_document.js @@ -0,0 +1,77 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, processedDocumentType) { + // [START discoveryengine_v1alpha_generated_DocumentService_GetProcessedDocument_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Full resource name of + * Document google.cloud.discoveryengine.v1alpha.Document, such as + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. + * If the caller does not have permission to access the + * Document google.cloud.discoveryengine.v1alpha.Document, regardless of + * whether or not it exists, a `PERMISSION_DENIED` error is returned. + * If the requested Document google.cloud.discoveryengine.v1alpha.Document + * does not exist, a `NOT_FOUND` error is returned. + */ + // const name = 'abc123' + /** + * Required. What type of processing to return. + */ + // const processedDocumentType = {} + /** + * What format output should be. If unspecified, defaults to JSON. + */ + // const processedDocumentFormat = {} + + // Imports the Discoveryengine library + const {DocumentServiceClient} = require('@google-cloud/discoveryengine').v1alpha; + + // Instantiates a client + const discoveryengineClient = new DocumentServiceClient(); + + async function callGetProcessedDocument() { + // Construct request + const request = { + name, + processedDocumentType, + }; + + // Run request + const response = await discoveryengineClient.getProcessedDocument(request); + console.log(response); + } + + callGetProcessedDocument(); + // [END discoveryengine_v1alpha_generated_DocumentService_GetProcessedDocument_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-discoveryengine/samples/generated/v1alpha/document_service.import_documents.js b/packages/google-cloud-discoveryengine/samples/generated/v1alpha/document_service.import_documents.js index cb5cc92879e..b76c943c4c7 100644 --- a/packages/google-cloud-discoveryengine/samples/generated/v1alpha/document_service.import_documents.js +++ b/packages/google-cloud-discoveryengine/samples/generated/v1alpha/document_service.import_documents.js @@ -40,6 +40,26 @@ function main(parent) { * BigQuery input source. */ // const bigquerySource = {} + /** + * FhirStore input source. + */ + // const fhirStoreSource = {} + /** + * Spanner input source. + */ + // const spannerSource = {} + /** + * Cloud SQL input source. + */ + // const cloudSqlSource = {} + /** + * Firestore input source. + */ + // const firestoreSource = {} + /** + * Cloud Bigtable input source. + */ + // const bigtableSource = {} /** * Required. The parent branch resource name, such as * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. @@ -56,6 +76,11 @@ function main(parent) { * ReconciliationMode.INCREMENTAL google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode.INCREMENTAL. */ // const reconciliationMode = {} + /** + * Indicates which fields in the provided imported documents to update. If + * not set, the default is to update all fields. + */ + // const updateMask = {} /** * Whether to automatically generate IDs for the documents if absent. * If set to `true`, @@ -68,42 +93,48 @@ function main(parent) { * have to be specified using * id_field google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.id_field, * otherwise, documents without IDs fail to be imported. - * Only set this field when using - * GcsSource google.cloud.discoveryengine.v1alpha.GcsSource or - * BigQuerySource google.cloud.discoveryengine.v1alpha.BigQuerySource, and - * when + * Supported data sources: + * * GcsSource google.cloud.discoveryengine.v1alpha.GcsSource. * GcsSource.data_schema google.cloud.discoveryengine.v1alpha.GcsSource.data_schema - * or + * must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. + * * BigQuerySource google.cloud.discoveryengine.v1alpha.BigQuerySource. * BigQuerySource.data_schema google.cloud.discoveryengine.v1alpha.BigQuerySource.data_schema - * is `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. + * must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. + * * SpannerSource google.cloud.discoveryengine.v1alpha.SpannerSource. + * * CloudSqlSource google.cloud.discoveryengine.v1alpha.CloudSqlSource. + * * FirestoreSource google.cloud.discoveryengine.v1alpha.FirestoreSource. + * * BigtableSource google.cloud.discoveryengine.v1alpha.BigtableSource. */ // const autoGenerateIds = true /** - * The field in the Cloud Storage and BigQuery sources that indicates the - * unique IDs of the documents. + * The field indicates the ID field or column to be used as unique IDs of + * the documents. * For GcsSource google.cloud.discoveryengine.v1alpha.GcsSource it is the * key of the JSON field. For instance, `my_id` for JSON `{"my_id": - * "some_uuid"}`. For - * BigQuerySource google.cloud.discoveryengine.v1alpha.BigQuerySource it is - * the column name of the BigQuery table where the unique ids are stored. - * The values of the JSON field or the BigQuery column are used as the + * "some_uuid"}`. For others, it may be the column name of the table where the + * unique ids are stored. + * The values of the JSON field or the table column are used as the * Document.id google.cloud.discoveryengine.v1alpha.Document.id s. The JSON - * field or the BigQuery column must be of string type, and the values must be + * field or the table column must be of string type, and the values must be * set as valid strings conform to * RFC-1034 (https://tools.ietf.org/html/rfc1034) with 1-63 characters. * Otherwise, documents without valid IDs fail to be imported. - * Only set this field when using - * GcsSource google.cloud.discoveryengine.v1alpha.GcsSource or - * BigQuerySource google.cloud.discoveryengine.v1alpha.BigQuerySource, and - * when - * GcsSource.data_schema google.cloud.discoveryengine.v1alpha.GcsSource.data_schema - * or - * BigQuerySource.data_schema google.cloud.discoveryengine.v1alpha.BigQuerySource.data_schema - * is `custom`. And only set this field when + * Only set this field when * auto_generate_ids google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.auto_generate_ids * is unset or set as `false`. Otherwise, an INVALID_ARGUMENT error is thrown. * If it is unset, a default value `_id` is used when importing from the * allowed data sources. + * Supported data sources: + * * GcsSource google.cloud.discoveryengine.v1alpha.GcsSource. + * GcsSource.data_schema google.cloud.discoveryengine.v1alpha.GcsSource.data_schema + * must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. + * * BigQuerySource google.cloud.discoveryengine.v1alpha.BigQuerySource. + * BigQuerySource.data_schema google.cloud.discoveryengine.v1alpha.BigQuerySource.data_schema + * must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. + * * SpannerSource google.cloud.discoveryengine.v1alpha.SpannerSource. + * * CloudSqlSource google.cloud.discoveryengine.v1alpha.CloudSqlSource. + * * FirestoreSource google.cloud.discoveryengine.v1alpha.FirestoreSource. + * * BigtableSource google.cloud.discoveryengine.v1alpha.BigtableSource. */ // const idField = 'abc123' diff --git a/packages/google-cloud-discoveryengine/samples/generated/v1alpha/rank_service.rank.js b/packages/google-cloud-discoveryengine/samples/generated/v1alpha/rank_service.rank.js new file mode 100644 index 00000000000..5f7fe5694b3 --- /dev/null +++ b/packages/google-cloud-discoveryengine/samples/generated/v1alpha/rank_service.rank.js @@ -0,0 +1,88 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(rankingConfig, records) { + // [START discoveryengine_v1alpha_generated_RankService_Rank_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the rank service config, such as + * `projects/{project_num}/locations/{location_id}/rankingConfigs/default_ranking_config`. + */ + // const rankingConfig = 'abc123' + /** + * The identifier of the model to use. It is one of: + * * `semantic-ranker-512@latest`: Semantic ranking model with maxiumn input + * token size 512. + * It is set to `semantic-ranker-512@latest` by default if unspecified. + */ + // const model = 'abc123' + /** + * The number of results to return. If this is unset or no bigger than zero, + * returns all results. + */ + // const topN = 1234 + /** + * The query to use. + */ + // const query = 'abc123' + /** + * Required. A list of records to rank. At most 200 records to rank. + */ + // const records = [1,2,3,4] + /** + * If true, the response will contain only record ID and score. By default, it + * is false, the response will contain record details. + */ + // const ignoreRecordDetailsInResponse = true + + // Imports the Discoveryengine library + const {RankServiceClient} = require('@google-cloud/discoveryengine').v1alpha; + + // Instantiates a client + const discoveryengineClient = new RankServiceClient(); + + async function callRank() { + // Construct request + const request = { + rankingConfig, + records, + }; + + // Run request + const response = await discoveryengineClient.rank(request); + console.log(response); + } + + callRank(); + // [END discoveryengine_v1alpha_generated_RankService_Rank_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-discoveryengine/samples/generated/v1alpha/search_service.search.js b/packages/google-cloud-discoveryengine/samples/generated/v1alpha/search_service.search.js index 1e789713536..48bc12ada5f 100644 --- a/packages/google-cloud-discoveryengine/samples/generated/v1alpha/search_service.search.js +++ b/packages/google-cloud-discoveryengine/samples/generated/v1alpha/search_service.search.js @@ -54,10 +54,13 @@ function main(servingConfig) { // const imageQuery = {} /** * Maximum number of - * Document google.cloud.discoveryengine.v1alpha.Document s to return. If - * unspecified, defaults to a reasonable value. The maximum allowed value is - * 100. Values above 100 are coerced to 100. - * If this field is negative, an `INVALID_ARGUMENT` is returned. + * Document google.cloud.discoveryengine.v1alpha.Document s to return. The + * maximum allowed value depends on the data type. Values above the maximum + * value are coerced to the maximum value. + * * Websites with basic indexing: Default `10`, Maximum `25`. + * * Websites with advanced indexing: Default `25`, Maximum `50`. + * * Other: Default `50`, Maximum `100`. + * If this field is negative, an `INVALID_ARGUMENT` is returned. */ // const pageSize = 1234 /** @@ -192,7 +195,8 @@ function main(servingConfig) { * SearchRequest.EmbeddingSpec.EmbeddingVector.field_path google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector.field_path. * If * SearchRequest.EmbeddingSpec.EmbeddingVector.field_path google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector.field_path - * is not provided, it will use ServingConfig.EmbeddingConfig.field_path . + * is not provided, it will use + * ServingConfig.EmbeddingConfig.field_path google.cloud.discoveryengine.v1alpha.ServingConfig.embedding_config. */ // const embeddingSpec = {} /** diff --git a/packages/google-cloud-discoveryengine/samples/generated/v1alpha/snippet_metadata_google.cloud.discoveryengine.v1alpha.json b/packages/google-cloud-discoveryengine/samples/generated/v1alpha/snippet_metadata_google.cloud.discoveryengine.v1alpha.json index 80c62112447..875e65ae9e0 100644 --- a/packages/google-cloud-discoveryengine/samples/generated/v1alpha/snippet_metadata_google.cloud.discoveryengine.v1alpha.json +++ b/packages/google-cloud-discoveryengine/samples/generated/v1alpha/snippet_metadata_google.cloud.discoveryengine.v1alpha.json @@ -1166,7 +1166,7 @@ "segments": [ { "start": 25, - "end": 128, + "end": 159, "type": "FULL" } ], @@ -1187,6 +1187,26 @@ "name": "bigquery_source", "type": ".google.cloud.discoveryengine.v1alpha.BigQuerySource" }, + { + "name": "fhir_store_source", + "type": ".google.cloud.discoveryengine.v1alpha.FhirStoreSource" + }, + { + "name": "spanner_source", + "type": ".google.cloud.discoveryengine.v1alpha.SpannerSource" + }, + { + "name": "cloud_sql_source", + "type": ".google.cloud.discoveryengine.v1alpha.CloudSqlSource" + }, + { + "name": "firestore_source", + "type": ".google.cloud.discoveryengine.v1alpha.FirestoreSource" + }, + { + "name": "bigtable_source", + "type": ".google.cloud.discoveryengine.v1alpha.BigtableSource" + }, { "name": "parent", "type": "TYPE_STRING" @@ -1199,6 +1219,10 @@ "name": "reconciliation_mode", "type": ".google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode" }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, { "name": "auto_generate_ids", "type": "TYPE_BOOL" @@ -1279,6 +1303,54 @@ } } }, + { + "regionTag": "discoveryengine_v1alpha_generated_DocumentService_GetProcessedDocument_async", + "title": "AclConfigService getProcessedDocument Sample", + "origin": "API_DEFINITION", + "description": " Gets the parsed layout information for a [Document][google.cloud.discoveryengine.v1alpha.Document].", + "canonical": true, + "file": "document_service.get_processed_document.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetProcessedDocument", + "fullName": "google.cloud.discoveryengine.v1alpha.DocumentService.GetProcessedDocument", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "processed_document_type", + "type": ".google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest.ProcessedDocumentType" + }, + { + "name": "processed_document_format", + "type": ".google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest.ProcessedDocumentFormat" + } + ], + "resultType": ".google.cloud.discoveryengine.v1alpha.ProcessedDocument", + "client": { + "shortName": "DocumentServiceClient", + "fullName": "google.cloud.discoveryengine.v1alpha.DocumentServiceClient" + }, + "method": { + "shortName": "GetProcessedDocument", + "fullName": "google.cloud.discoveryengine.v1alpha.DocumentService.GetProcessedDocument", + "service": { + "shortName": "DocumentService", + "fullName": "google.cloud.discoveryengine.v1alpha.DocumentService" + } + } + } + }, { "regionTag": "discoveryengine_v1alpha_generated_EngineService_CreateEngine_async", "title": "AclConfigService createEngine Sample", @@ -1671,6 +1743,66 @@ } } }, + { + "regionTag": "discoveryengine_v1alpha_generated_RankService_Rank_async", + "title": "AclConfigService rank Sample", + "origin": "API_DEFINITION", + "description": " Ranks a list of text records based on the given input query.", + "canonical": true, + "file": "rank_service.rank.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "Rank", + "fullName": "google.cloud.discoveryengine.v1alpha.RankService.Rank", + "async": true, + "parameters": [ + { + "name": "ranking_config", + "type": "TYPE_STRING" + }, + { + "name": "model", + "type": "TYPE_STRING" + }, + { + "name": "top_n", + "type": "TYPE_INT32" + }, + { + "name": "query", + "type": "TYPE_STRING" + }, + { + "name": "records", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "ignore_record_details_in_response", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.discoveryengine.v1alpha.RankResponse", + "client": { + "shortName": "RankServiceClient", + "fullName": "google.cloud.discoveryengine.v1alpha.RankServiceClient" + }, + "method": { + "shortName": "Rank", + "fullName": "google.cloud.discoveryengine.v1alpha.RankService.Rank", + "service": { + "shortName": "RankService", + "fullName": "google.cloud.discoveryengine.v1alpha.RankService" + } + } + } + }, { "regionTag": "discoveryengine_v1alpha_generated_RecommendationService_Recommend_async", "title": "AclConfigService recommend Sample", @@ -1966,7 +2098,7 @@ "segments": [ { "start": 25, - "end": 267, + "end": 271, "type": "FULL" } ], diff --git a/packages/google-cloud-discoveryengine/src/v1/completion_service_client.ts b/packages/google-cloud-discoveryengine/src/v1/completion_service_client.ts index f6ee1d1c556..81a4102930f 100644 --- a/packages/google-cloud-discoveryengine/src/v1/completion_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1/completion_service_client.ts @@ -123,8 +123,15 @@ export class CompletionServiceClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'discoveryengine.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -180,7 +187,7 @@ export class CompletionServiceClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -482,7 +489,7 @@ export class CompletionServiceClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -500,7 +507,7 @@ export class CompletionServiceClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( diff --git a/packages/google-cloud-discoveryengine/src/v1/conversational_search_service_client.ts b/packages/google-cloud-discoveryengine/src/v1/conversational_search_service_client.ts index 36e80ed98e9..2642ced2f24 100644 --- a/packages/google-cloud-discoveryengine/src/v1/conversational_search_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1/conversational_search_service_client.ts @@ -123,8 +123,15 @@ export class ConversationalSearchServiceClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'discoveryengine.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -180,7 +187,7 @@ export class ConversationalSearchServiceClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -373,7 +380,7 @@ export class ConversationalSearchServiceClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -391,7 +398,7 @@ export class ConversationalSearchServiceClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( diff --git a/packages/google-cloud-discoveryengine/src/v1/data_store_service_client.ts b/packages/google-cloud-discoveryengine/src/v1/data_store_service_client.ts index 59248c235c5..ebdf7c92142 100644 --- a/packages/google-cloud-discoveryengine/src/v1/data_store_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1/data_store_service_client.ts @@ -126,8 +126,15 @@ export class DataStoreServiceClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'discoveryengine.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -183,7 +190,7 @@ export class DataStoreServiceClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -495,7 +502,7 @@ export class DataStoreServiceClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -513,7 +520,7 @@ export class DataStoreServiceClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( diff --git a/packages/google-cloud-discoveryengine/src/v1/document_service_client.ts b/packages/google-cloud-discoveryengine/src/v1/document_service_client.ts index 20000dc058c..0990593ce63 100644 --- a/packages/google-cloud-discoveryengine/src/v1/document_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1/document_service_client.ts @@ -126,8 +126,15 @@ export class DocumentServiceClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'discoveryengine.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -183,7 +190,7 @@ export class DocumentServiceClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -501,7 +508,7 @@ export class DocumentServiceClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -519,7 +526,7 @@ export class DocumentServiceClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( diff --git a/packages/google-cloud-discoveryengine/src/v1/engine_service_client.ts b/packages/google-cloud-discoveryengine/src/v1/engine_service_client.ts index eaadfcdcb26..189171ec1a2 100644 --- a/packages/google-cloud-discoveryengine/src/v1/engine_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1/engine_service_client.ts @@ -126,8 +126,15 @@ export class EngineServiceClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'discoveryengine.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -183,7 +190,7 @@ export class EngineServiceClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -494,7 +501,7 @@ export class EngineServiceClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -512,7 +519,7 @@ export class EngineServiceClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( diff --git a/packages/google-cloud-discoveryengine/src/v1/schema_service_client.ts b/packages/google-cloud-discoveryengine/src/v1/schema_service_client.ts index 14f3a14c161..0f5ecfe28ae 100644 --- a/packages/google-cloud-discoveryengine/src/v1/schema_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1/schema_service_client.ts @@ -125,8 +125,15 @@ export class SchemaServiceClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'discoveryengine.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -182,7 +189,7 @@ export class SchemaServiceClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -501,7 +508,7 @@ export class SchemaServiceClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -519,7 +526,7 @@ export class SchemaServiceClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( diff --git a/packages/google-cloud-discoveryengine/src/v1/search_service_client.ts b/packages/google-cloud-discoveryengine/src/v1/search_service_client.ts index 73d9c8fb50d..287d26a5a33 100644 --- a/packages/google-cloud-discoveryengine/src/v1/search_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1/search_service_client.ts @@ -122,8 +122,15 @@ export class SearchServiceClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'discoveryengine.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -179,7 +186,7 @@ export class SearchServiceClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -372,7 +379,7 @@ export class SearchServiceClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -390,7 +397,7 @@ export class SearchServiceClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( diff --git a/packages/google-cloud-discoveryengine/src/v1/site_search_engine_service_client.ts b/packages/google-cloud-discoveryengine/src/v1/site_search_engine_service_client.ts index 6e9fec3d16d..f7bcb01f097 100644 --- a/packages/google-cloud-discoveryengine/src/v1/site_search_engine_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1/site_search_engine_service_client.ts @@ -126,8 +126,15 @@ export class SiteSearchEngineServiceClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'discoveryengine.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -183,7 +190,7 @@ export class SiteSearchEngineServiceClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -586,7 +593,7 @@ export class SiteSearchEngineServiceClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -604,7 +611,7 @@ export class SiteSearchEngineServiceClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( diff --git a/packages/google-cloud-discoveryengine/src/v1/user_event_service_client.ts b/packages/google-cloud-discoveryengine/src/v1/user_event_service_client.ts index d503d1cfbfa..3b6420a1aa9 100644 --- a/packages/google-cloud-discoveryengine/src/v1/user_event_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1/user_event_service_client.ts @@ -123,8 +123,15 @@ export class UserEventServiceClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'discoveryengine.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -180,7 +187,7 @@ export class UserEventServiceClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -462,7 +469,7 @@ export class UserEventServiceClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -480,7 +487,7 @@ export class UserEventServiceClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( diff --git a/packages/google-cloud-discoveryengine/src/v1alpha/acl_config_service_client.ts b/packages/google-cloud-discoveryengine/src/v1alpha/acl_config_service_client.ts index 411bc89d714..7b3de54681f 100644 --- a/packages/google-cloud-discoveryengine/src/v1alpha/acl_config_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1alpha/acl_config_service_client.ts @@ -120,8 +120,15 @@ export class AclConfigServiceClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'discoveryengine.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -177,7 +184,7 @@ export class AclConfigServiceClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -371,7 +378,7 @@ export class AclConfigServiceClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -389,7 +396,7 @@ export class AclConfigServiceClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( diff --git a/packages/google-cloud-discoveryengine/src/v1alpha/acl_config_service_proto_list.json b/packages/google-cloud-discoveryengine/src/v1alpha/acl_config_service_proto_list.json index 02ce2e2381b..006edd1f929 100644 --- a/packages/google-cloud-discoveryengine/src/v1alpha/acl_config_service_proto_list.json +++ b/packages/google-cloud-discoveryengine/src/v1alpha/acl_config_service_proto_list.json @@ -18,6 +18,7 @@ "../../protos/google/cloud/discoveryengine/v1alpha/estimate_billing_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/import_config.proto", "../../protos/google/cloud/discoveryengine/v1alpha/purge_config.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/rank_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/recommendation_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/schema.proto", "../../protos/google/cloud/discoveryengine/v1alpha/schema_service.proto", diff --git a/packages/google-cloud-discoveryengine/src/v1alpha/chunk_service_client.ts b/packages/google-cloud-discoveryengine/src/v1alpha/chunk_service_client.ts index 90719915702..5ddc0393a4d 100644 --- a/packages/google-cloud-discoveryengine/src/v1alpha/chunk_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1alpha/chunk_service_client.ts @@ -124,8 +124,15 @@ export class ChunkServiceClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'discoveryengine.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -181,7 +188,7 @@ export class ChunkServiceClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -386,7 +393,7 @@ export class ChunkServiceClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -404,7 +411,7 @@ export class ChunkServiceClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( diff --git a/packages/google-cloud-discoveryengine/src/v1alpha/chunk_service_proto_list.json b/packages/google-cloud-discoveryengine/src/v1alpha/chunk_service_proto_list.json index 02ce2e2381b..006edd1f929 100644 --- a/packages/google-cloud-discoveryengine/src/v1alpha/chunk_service_proto_list.json +++ b/packages/google-cloud-discoveryengine/src/v1alpha/chunk_service_proto_list.json @@ -18,6 +18,7 @@ "../../protos/google/cloud/discoveryengine/v1alpha/estimate_billing_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/import_config.proto", "../../protos/google/cloud/discoveryengine/v1alpha/purge_config.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/rank_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/recommendation_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/schema.proto", "../../protos/google/cloud/discoveryengine/v1alpha/schema_service.proto", diff --git a/packages/google-cloud-discoveryengine/src/v1alpha/completion_service_client.ts b/packages/google-cloud-discoveryengine/src/v1alpha/completion_service_client.ts index 308e79cb850..85068c5c667 100644 --- a/packages/google-cloud-discoveryengine/src/v1alpha/completion_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1alpha/completion_service_client.ts @@ -123,8 +123,15 @@ export class CompletionServiceClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'discoveryengine.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -180,7 +187,7 @@ export class CompletionServiceClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -335,6 +342,9 @@ export class CompletionServiceClient { { get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/operations/*}', }, + { + get: '/v1alpha/{name=projects/*/locations/*/evaluations/*/operations/*}', + }, {get: '/v1alpha/{name=projects/*/locations/*/operations/*}'}, {get: '/v1alpha/{name=projects/*/operations/*}'}, ], @@ -511,7 +521,7 @@ export class CompletionServiceClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -529,7 +539,7 @@ export class CompletionServiceClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( diff --git a/packages/google-cloud-discoveryengine/src/v1alpha/completion_service_proto_list.json b/packages/google-cloud-discoveryengine/src/v1alpha/completion_service_proto_list.json index 02ce2e2381b..006edd1f929 100644 --- a/packages/google-cloud-discoveryengine/src/v1alpha/completion_service_proto_list.json +++ b/packages/google-cloud-discoveryengine/src/v1alpha/completion_service_proto_list.json @@ -18,6 +18,7 @@ "../../protos/google/cloud/discoveryengine/v1alpha/estimate_billing_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/import_config.proto", "../../protos/google/cloud/discoveryengine/v1alpha/purge_config.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/rank_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/recommendation_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/schema.proto", "../../protos/google/cloud/discoveryengine/v1alpha/schema_service.proto", diff --git a/packages/google-cloud-discoveryengine/src/v1alpha/conversational_search_service_client.ts b/packages/google-cloud-discoveryengine/src/v1alpha/conversational_search_service_client.ts index cd13f96e9e7..03672c76980 100644 --- a/packages/google-cloud-discoveryengine/src/v1alpha/conversational_search_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1alpha/conversational_search_service_client.ts @@ -123,8 +123,15 @@ export class ConversationalSearchServiceClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'discoveryengine.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -180,7 +187,7 @@ export class ConversationalSearchServiceClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -392,7 +399,7 @@ export class ConversationalSearchServiceClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -410,7 +417,7 @@ export class ConversationalSearchServiceClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( diff --git a/packages/google-cloud-discoveryengine/src/v1alpha/conversational_search_service_proto_list.json b/packages/google-cloud-discoveryengine/src/v1alpha/conversational_search_service_proto_list.json index 02ce2e2381b..006edd1f929 100644 --- a/packages/google-cloud-discoveryengine/src/v1alpha/conversational_search_service_proto_list.json +++ b/packages/google-cloud-discoveryengine/src/v1alpha/conversational_search_service_proto_list.json @@ -18,6 +18,7 @@ "../../protos/google/cloud/discoveryengine/v1alpha/estimate_billing_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/import_config.proto", "../../protos/google/cloud/discoveryengine/v1alpha/purge_config.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/rank_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/recommendation_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/schema.proto", "../../protos/google/cloud/discoveryengine/v1alpha/schema_service.proto", diff --git a/packages/google-cloud-discoveryengine/src/v1alpha/data_store_service_client.ts b/packages/google-cloud-discoveryengine/src/v1alpha/data_store_service_client.ts index dbf01ae9e44..e903d0612db 100644 --- a/packages/google-cloud-discoveryengine/src/v1alpha/data_store_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1alpha/data_store_service_client.ts @@ -126,8 +126,15 @@ export class DataStoreServiceClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'discoveryengine.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -183,7 +190,7 @@ export class DataStoreServiceClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -352,6 +359,9 @@ export class DataStoreServiceClient { { get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/operations/*}', }, + { + get: '/v1alpha/{name=projects/*/locations/*/evaluations/*/operations/*}', + }, {get: '/v1alpha/{name=projects/*/locations/*/operations/*}'}, {get: '/v1alpha/{name=projects/*/operations/*}'}, ], @@ -526,7 +536,7 @@ export class DataStoreServiceClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -544,7 +554,7 @@ export class DataStoreServiceClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( diff --git a/packages/google-cloud-discoveryengine/src/v1alpha/data_store_service_proto_list.json b/packages/google-cloud-discoveryengine/src/v1alpha/data_store_service_proto_list.json index 02ce2e2381b..006edd1f929 100644 --- a/packages/google-cloud-discoveryengine/src/v1alpha/data_store_service_proto_list.json +++ b/packages/google-cloud-discoveryengine/src/v1alpha/data_store_service_proto_list.json @@ -18,6 +18,7 @@ "../../protos/google/cloud/discoveryengine/v1alpha/estimate_billing_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/import_config.proto", "../../protos/google/cloud/discoveryengine/v1alpha/purge_config.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/rank_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/recommendation_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/schema.proto", "../../protos/google/cloud/discoveryengine/v1alpha/schema_service.proto", diff --git a/packages/google-cloud-discoveryengine/src/v1alpha/document_service_client.ts b/packages/google-cloud-discoveryengine/src/v1alpha/document_service_client.ts index 00d5a82608c..74f8380ba88 100644 --- a/packages/google-cloud-discoveryengine/src/v1alpha/document_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1alpha/document_service_client.ts @@ -127,8 +127,15 @@ export class DocumentServiceClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'discoveryengine.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -184,7 +191,7 @@ export class DocumentServiceClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -358,6 +365,9 @@ export class DocumentServiceClient { { get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/operations/*}', }, + { + get: '/v1alpha/{name=projects/*/locations/*/evaluations/*/operations/*}', + }, {get: '/v1alpha/{name=projects/*/locations/*/operations/*}'}, {get: '/v1alpha/{name=projects/*/operations/*}'}, ], @@ -492,6 +502,7 @@ export class DocumentServiceClient { 'deleteDocument', 'importDocuments', 'purgeDocuments', + 'getProcessedDocument', ]; for (const methodName of documentServiceStubMethods) { const callPromise = this.documentServiceStub.then( @@ -532,7 +543,7 @@ export class DocumentServiceClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -550,7 +561,7 @@ export class DocumentServiceClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -1050,6 +1061,116 @@ export class DocumentServiceClient { this.initialize(); return this.innerApiCalls.deleteDocument(request, options, callback); } + /** + * Gets the parsed layout information for a + * {@link protos.google.cloud.discoveryengine.v1alpha.Document|Document}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Full resource name of + * {@link protos.google.cloud.discoveryengine.v1alpha.Document|Document}, such as + * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. + * + * If the caller does not have permission to access the + * {@link protos.google.cloud.discoveryengine.v1alpha.Document|Document}, regardless of + * whether or not it exists, a `PERMISSION_DENIED` error is returned. + * + * If the requested {@link protos.google.cloud.discoveryengine.v1alpha.Document|Document} + * does not exist, a `NOT_FOUND` error is returned. + * @param {google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest.ProcessedDocumentType} request.processedDocumentType + * Required. What type of processing to return. + * @param {google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest.ProcessedDocumentFormat} request.processedDocumentFormat + * What format output should be. If unspecified, defaults to JSON. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.discoveryengine.v1alpha.ProcessedDocument|ProcessedDocument}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/document_service.get_processed_document.js + * region_tag:discoveryengine_v1alpha_generated_DocumentService_GetProcessedDocument_async + */ + getProcessedDocument( + request?: protos.google.cloud.discoveryengine.v1alpha.IGetProcessedDocumentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.discoveryengine.v1alpha.IProcessedDocument, + ( + | protos.google.cloud.discoveryengine.v1alpha.IGetProcessedDocumentRequest + | undefined + ), + {} | undefined, + ] + >; + getProcessedDocument( + request: protos.google.cloud.discoveryengine.v1alpha.IGetProcessedDocumentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.discoveryengine.v1alpha.IProcessedDocument, + | protos.google.cloud.discoveryengine.v1alpha.IGetProcessedDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getProcessedDocument( + request: protos.google.cloud.discoveryengine.v1alpha.IGetProcessedDocumentRequest, + callback: Callback< + protos.google.cloud.discoveryengine.v1alpha.IProcessedDocument, + | protos.google.cloud.discoveryengine.v1alpha.IGetProcessedDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getProcessedDocument( + request?: protos.google.cloud.discoveryengine.v1alpha.IGetProcessedDocumentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.discoveryengine.v1alpha.IProcessedDocument, + | protos.google.cloud.discoveryengine.v1alpha.IGetProcessedDocumentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.discoveryengine.v1alpha.IProcessedDocument, + | protos.google.cloud.discoveryengine.v1alpha.IGetProcessedDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.discoveryengine.v1alpha.IProcessedDocument, + ( + | protos.google.cloud.discoveryengine.v1alpha.IGetProcessedDocumentRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getProcessedDocument(request, options, callback); + } /** * Bulk import of multiple @@ -1068,6 +1189,16 @@ export class DocumentServiceClient { * Cloud Storage location for the input content. * @param {google.cloud.discoveryengine.v1alpha.BigQuerySource} request.bigquerySource * BigQuery input source. + * @param {google.cloud.discoveryengine.v1alpha.FhirStoreSource} request.fhirStoreSource + * FhirStore input source. + * @param {google.cloud.discoveryengine.v1alpha.SpannerSource} request.spannerSource + * Spanner input source. + * @param {google.cloud.discoveryengine.v1alpha.CloudSqlSource} request.cloudSqlSource + * Cloud SQL input source. + * @param {google.cloud.discoveryengine.v1alpha.FirestoreSource} request.firestoreSource + * Firestore input source. + * @param {google.cloud.discoveryengine.v1alpha.BigtableSource} request.bigtableSource + * Cloud Bigtable input source. * @param {string} request.parent * Required. The parent branch resource name, such as * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. @@ -1078,6 +1209,9 @@ export class DocumentServiceClient { * The mode of reconciliation between existing documents and the documents to * be imported. Defaults to * {@link protos.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.ReconciliationMode.INCREMENTAL|ReconciliationMode.INCREMENTAL}. + * @param {google.protobuf.FieldMask} request.updateMask + * Indicates which fields in the provided imported documents to update. If + * not set, the default is to update all fields. * @param {boolean} request.autoGenerateIds * Whether to automatically generate IDs for the documents if absent. * @@ -1092,44 +1226,53 @@ export class DocumentServiceClient { * {@link protos.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.id_field|id_field}, * otherwise, documents without IDs fail to be imported. * - * Only set this field when using - * {@link protos.google.cloud.discoveryengine.v1alpha.GcsSource|GcsSource} or - * {@link protos.google.cloud.discoveryengine.v1alpha.BigQuerySource|BigQuerySource}, and - * when + * Supported data sources: + * + * * {@link protos.google.cloud.discoveryengine.v1alpha.GcsSource|GcsSource}. * {@link protos.google.cloud.discoveryengine.v1alpha.GcsSource.data_schema|GcsSource.data_schema} - * or + * must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. + * * {@link protos.google.cloud.discoveryengine.v1alpha.BigQuerySource|BigQuerySource}. * {@link protos.google.cloud.discoveryengine.v1alpha.BigQuerySource.data_schema|BigQuerySource.data_schema} - * is `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. + * must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. + * * {@link protos.google.cloud.discoveryengine.v1alpha.SpannerSource|SpannerSource}. + * * {@link protos.google.cloud.discoveryengine.v1alpha.CloudSqlSource|CloudSqlSource}. + * * {@link protos.google.cloud.discoveryengine.v1alpha.FirestoreSource|FirestoreSource}. + * * {@link protos.google.cloud.discoveryengine.v1alpha.BigtableSource|BigtableSource}. * @param {string} request.idField - * The field in the Cloud Storage and BigQuery sources that indicates the - * unique IDs of the documents. + * The field indicates the ID field or column to be used as unique IDs of + * the documents. * * For {@link protos.google.cloud.discoveryengine.v1alpha.GcsSource|GcsSource} it is the * key of the JSON field. For instance, `my_id` for JSON `{"my_id": - * "some_uuid"}`. For - * {@link protos.google.cloud.discoveryengine.v1alpha.BigQuerySource|BigQuerySource} it is - * the column name of the BigQuery table where the unique ids are stored. + * "some_uuid"}`. For others, it may be the column name of the table where the + * unique ids are stored. * - * The values of the JSON field or the BigQuery column are used as the + * The values of the JSON field or the table column are used as the * {@link protos.google.cloud.discoveryengine.v1alpha.Document.id|Document.id}s. The JSON - * field or the BigQuery column must be of string type, and the values must be + * field or the table column must be of string type, and the values must be * set as valid strings conform to * [RFC-1034](https://tools.ietf.org/html/rfc1034) with 1-63 characters. * Otherwise, documents without valid IDs fail to be imported. * - * Only set this field when using - * {@link protos.google.cloud.discoveryengine.v1alpha.GcsSource|GcsSource} or - * {@link protos.google.cloud.discoveryengine.v1alpha.BigQuerySource|BigQuerySource}, and - * when - * {@link protos.google.cloud.discoveryengine.v1alpha.GcsSource.data_schema|GcsSource.data_schema} - * or - * {@link protos.google.cloud.discoveryengine.v1alpha.BigQuerySource.data_schema|BigQuerySource.data_schema} - * is `custom`. And only set this field when + * Only set this field when * {@link protos.google.cloud.discoveryengine.v1alpha.ImportDocumentsRequest.auto_generate_ids|auto_generate_ids} * is unset or set as `false`. Otherwise, an INVALID_ARGUMENT error is thrown. * * If it is unset, a default value `_id` is used when importing from the * allowed data sources. + * + * Supported data sources: + * + * * {@link protos.google.cloud.discoveryengine.v1alpha.GcsSource|GcsSource}. + * {@link protos.google.cloud.discoveryengine.v1alpha.GcsSource.data_schema|GcsSource.data_schema} + * must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. + * * {@link protos.google.cloud.discoveryengine.v1alpha.BigQuerySource|BigQuerySource}. + * {@link protos.google.cloud.discoveryengine.v1alpha.BigQuerySource.data_schema|BigQuerySource.data_schema} + * must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. + * * {@link protos.google.cloud.discoveryengine.v1alpha.SpannerSource|SpannerSource}. + * * {@link protos.google.cloud.discoveryengine.v1alpha.CloudSqlSource|CloudSqlSource}. + * * {@link protos.google.cloud.discoveryengine.v1alpha.FirestoreSource|FirestoreSource}. + * * {@link protos.google.cloud.discoveryengine.v1alpha.BigtableSource|BigtableSource}. * @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. diff --git a/packages/google-cloud-discoveryengine/src/v1alpha/document_service_client_config.json b/packages/google-cloud-discoveryengine/src/v1alpha/document_service_client_config.json index 37517455cd1..a484665d14e 100644 --- a/packages/google-cloud-discoveryengine/src/v1alpha/document_service_client_config.json +++ b/packages/google-cloud-discoveryengine/src/v1alpha/document_service_client_config.json @@ -75,6 +75,11 @@ "timeout_millis": 30000, "retry_codes_name": "unavailable", "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetProcessedDocument": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" } } } diff --git a/packages/google-cloud-discoveryengine/src/v1alpha/document_service_proto_list.json b/packages/google-cloud-discoveryengine/src/v1alpha/document_service_proto_list.json index 02ce2e2381b..006edd1f929 100644 --- a/packages/google-cloud-discoveryengine/src/v1alpha/document_service_proto_list.json +++ b/packages/google-cloud-discoveryengine/src/v1alpha/document_service_proto_list.json @@ -18,6 +18,7 @@ "../../protos/google/cloud/discoveryengine/v1alpha/estimate_billing_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/import_config.proto", "../../protos/google/cloud/discoveryengine/v1alpha/purge_config.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/rank_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/recommendation_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/schema.proto", "../../protos/google/cloud/discoveryengine/v1alpha/schema_service.proto", diff --git a/packages/google-cloud-discoveryengine/src/v1alpha/engine_service_client.ts b/packages/google-cloud-discoveryengine/src/v1alpha/engine_service_client.ts index 4fc88367405..cc608486214 100644 --- a/packages/google-cloud-discoveryengine/src/v1alpha/engine_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1alpha/engine_service_client.ts @@ -126,8 +126,15 @@ export class EngineServiceClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'discoveryengine.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -183,7 +190,7 @@ export class EngineServiceClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -352,6 +359,9 @@ export class EngineServiceClient { { get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/operations/*}', }, + { + get: '/v1alpha/{name=projects/*/locations/*/evaluations/*/operations/*}', + }, {get: '/v1alpha/{name=projects/*/locations/*/operations/*}'}, {get: '/v1alpha/{name=projects/*/operations/*}'}, ], @@ -538,7 +548,7 @@ export class EngineServiceClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -556,7 +566,7 @@ export class EngineServiceClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( diff --git a/packages/google-cloud-discoveryengine/src/v1alpha/engine_service_proto_list.json b/packages/google-cloud-discoveryengine/src/v1alpha/engine_service_proto_list.json index 02ce2e2381b..006edd1f929 100644 --- a/packages/google-cloud-discoveryengine/src/v1alpha/engine_service_proto_list.json +++ b/packages/google-cloud-discoveryengine/src/v1alpha/engine_service_proto_list.json @@ -18,6 +18,7 @@ "../../protos/google/cloud/discoveryengine/v1alpha/estimate_billing_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/import_config.proto", "../../protos/google/cloud/discoveryengine/v1alpha/purge_config.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/rank_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/recommendation_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/schema.proto", "../../protos/google/cloud/discoveryengine/v1alpha/schema_service.proto", diff --git a/packages/google-cloud-discoveryengine/src/v1alpha/estimate_billing_service_client.ts b/packages/google-cloud-discoveryengine/src/v1alpha/estimate_billing_service_client.ts index 625d11e5b4a..f25a94071a6 100644 --- a/packages/google-cloud-discoveryengine/src/v1alpha/estimate_billing_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1alpha/estimate_billing_service_client.ts @@ -124,8 +124,15 @@ export class EstimateBillingServiceClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'discoveryengine.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -181,7 +188,7 @@ export class EstimateBillingServiceClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -339,6 +346,9 @@ export class EstimateBillingServiceClient { { get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/operations/*}', }, + { + get: '/v1alpha/{name=projects/*/locations/*/evaluations/*/operations/*}', + }, {get: '/v1alpha/{name=projects/*/locations/*/operations/*}'}, {get: '/v1alpha/{name=projects/*/operations/*}'}, ], @@ -491,7 +501,7 @@ export class EstimateBillingServiceClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -509,7 +519,7 @@ export class EstimateBillingServiceClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( diff --git a/packages/google-cloud-discoveryengine/src/v1alpha/estimate_billing_service_proto_list.json b/packages/google-cloud-discoveryengine/src/v1alpha/estimate_billing_service_proto_list.json index 02ce2e2381b..006edd1f929 100644 --- a/packages/google-cloud-discoveryengine/src/v1alpha/estimate_billing_service_proto_list.json +++ b/packages/google-cloud-discoveryengine/src/v1alpha/estimate_billing_service_proto_list.json @@ -18,6 +18,7 @@ "../../protos/google/cloud/discoveryengine/v1alpha/estimate_billing_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/import_config.proto", "../../protos/google/cloud/discoveryengine/v1alpha/purge_config.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/rank_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/recommendation_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/schema.proto", "../../protos/google/cloud/discoveryengine/v1alpha/schema_service.proto", diff --git a/packages/google-cloud-discoveryengine/src/v1alpha/gapic_metadata.json b/packages/google-cloud-discoveryengine/src/v1alpha/gapic_metadata.json index 68ff7a95bb6..44cac9fbf23 100644 --- a/packages/google-cloud-discoveryengine/src/v1alpha/gapic_metadata.json +++ b/packages/google-cloud-discoveryengine/src/v1alpha/gapic_metadata.json @@ -312,6 +312,11 @@ "deleteDocument" ] }, + "GetProcessedDocument": { + "methods": [ + "getProcessedDocument" + ] + }, "ImportDocuments": { "methods": [ "importDocuments" @@ -354,6 +359,11 @@ "deleteDocument" ] }, + "GetProcessedDocument": { + "methods": [ + "getProcessedDocument" + ] + }, "ImportDocuments": { "methods": [ "importDocuments" @@ -497,6 +507,30 @@ } } }, + "RankService": { + "clients": { + "grpc": { + "libraryClient": "RankServiceClient", + "rpcs": { + "Rank": { + "methods": [ + "rank" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RankServiceClient", + "rpcs": { + "Rank": { + "methods": [ + "rank" + ] + } + } + } + } + }, "RecommendationService": { "clients": { "grpc": { diff --git a/packages/google-cloud-discoveryengine/src/v1alpha/index.ts b/packages/google-cloud-discoveryengine/src/v1alpha/index.ts index 2603f3433ae..16989b8b96b 100644 --- a/packages/google-cloud-discoveryengine/src/v1alpha/index.ts +++ b/packages/google-cloud-discoveryengine/src/v1alpha/index.ts @@ -24,6 +24,7 @@ export {DataStoreServiceClient} from './data_store_service_client'; export {DocumentServiceClient} from './document_service_client'; export {EngineServiceClient} from './engine_service_client'; export {EstimateBillingServiceClient} from './estimate_billing_service_client'; +export {RankServiceClient} from './rank_service_client'; export {RecommendationServiceClient} from './recommendation_service_client'; export {SchemaServiceClient} from './schema_service_client'; export {SearchServiceClient} from './search_service_client'; diff --git a/packages/google-cloud-discoveryengine/src/v1alpha/rank_service_client.ts b/packages/google-cloud-discoveryengine/src/v1alpha/rank_service_client.ts new file mode 100644 index 00000000000..e7c4b0fc03c --- /dev/null +++ b/packages/google-cloud-discoveryengine/src/v1alpha/rank_service_client.ts @@ -0,0 +1,2721 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + LocationsClient, + LocationProtos, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); + +/** + * Client JSON configuration object, loaded from + * `src/v1alpha/rank_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './rank_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for ranking text records. + * @class + * @memberof v1alpha + */ +export class RankServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + rankServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of RankServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new RankServiceClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof RankServiceClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.' + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'discoveryengine.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + aclConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/aclConfig' + ), + enginePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/collections/{collection}/engines/{engine}' + ), + projectLocationCollectionDataStorePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}' + ), + projectLocationCollectionDataStoreBranchDocumentPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}' + ), + projectLocationCollectionDataStoreBranchDocumentChunkPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}/chunks/{chunk}' + ), + projectLocationCollectionDataStoreConversationPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/conversations/{conversation}' + ), + projectLocationCollectionDataStoreDocumentProcessingConfigPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/documentProcessingConfig' + ), + projectLocationCollectionDataStoreSchemaPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}' + ), + projectLocationCollectionDataStoreServingConfigPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}' + ), + projectLocationCollectionDataStoreSiteSearchEnginePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine' + ), + projectLocationCollectionDataStoreSiteSearchEngineTargetSitePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}' + ), + projectLocationCollectionEngineConversationPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/conversations/{conversation}' + ), + projectLocationCollectionEngineServingConfigPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{serving_config}' + ), + projectLocationDataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataStores/{data_store}' + ), + projectLocationDataStoreBranchDocumentPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}' + ), + projectLocationDataStoreBranchDocumentChunkPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}/chunks/{chunk}' + ), + projectLocationDataStoreConversationPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataStores/{data_store}/conversations/{conversation}' + ), + projectLocationDataStoreDocumentProcessingConfigPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataStores/{data_store}/documentProcessingConfig' + ), + projectLocationDataStoreSchemaPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataStores/{data_store}/schemas/{schema}' + ), + projectLocationDataStoreServingConfigPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}' + ), + projectLocationDataStoreSiteSearchEnginePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataStores/{data_store}/siteSearchEngine' + ), + projectLocationDataStoreSiteSearchEngineTargetSitePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}' + ), + rankingConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/rankingConfigs/{ranking_config}' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.discoveryengine.v1alpha.RankService', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.rankServiceStub) { + return this.rankServiceStub; + } + + // Put together the "service stub" for + // google.cloud.discoveryengine.v1alpha.RankService. + this.rankServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.discoveryengine.v1alpha.RankService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.discoveryengine.v1alpha + .RankService, + this._opts, + this._providedCustomServicePath + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const rankServiceStubMethods = ['rank']; + for (const methodName of rankServiceStubMethods) { + const callPromise = this.rankServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.rankServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning' + ); + } + return 'discoveryengine.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning' + ); + } + return 'discoveryengine.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Ranks a list of text records based on the given input query. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.rankingConfig + * Required. The resource name of the rank service config, such as + * `projects/{project_num}/locations/{location_id}/rankingConfigs/default_ranking_config`. + * @param {string} request.model + * The identifier of the model to use. It is one of: + * + * * `semantic-ranker-512@latest`: Semantic ranking model with maxiumn input + * token size 512. + * + * It is set to `semantic-ranker-512@latest` by default if unspecified. + * @param {number} request.topN + * The number of results to return. If this is unset or no bigger than zero, + * returns all results. + * @param {string} request.query + * The query to use. + * @param {number[]} request.records + * Required. A list of records to rank. At most 200 records to rank. + * @param {boolean} request.ignoreRecordDetailsInResponse + * If true, the response will contain only record ID and score. By default, it + * is false, the response will contain record details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.discoveryengine.v1alpha.RankResponse|RankResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/rank_service.rank.js + * region_tag:discoveryengine_v1alpha_generated_RankService_Rank_async + */ + rank( + request?: protos.google.cloud.discoveryengine.v1alpha.IRankRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.discoveryengine.v1alpha.IRankResponse, + protos.google.cloud.discoveryengine.v1alpha.IRankRequest | undefined, + {} | undefined, + ] + >; + rank( + request: protos.google.cloud.discoveryengine.v1alpha.IRankRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.discoveryengine.v1alpha.IRankResponse, + | protos.google.cloud.discoveryengine.v1alpha.IRankRequest + | null + | undefined, + {} | null | undefined + > + ): void; + rank( + request: protos.google.cloud.discoveryengine.v1alpha.IRankRequest, + callback: Callback< + protos.google.cloud.discoveryengine.v1alpha.IRankResponse, + | protos.google.cloud.discoveryengine.v1alpha.IRankRequest + | null + | undefined, + {} | null | undefined + > + ): void; + rank( + request?: protos.google.cloud.discoveryengine.v1alpha.IRankRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.discoveryengine.v1alpha.IRankResponse, + | protos.google.cloud.discoveryengine.v1alpha.IRankRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.discoveryengine.v1alpha.IRankResponse, + | protos.google.cloud.discoveryengine.v1alpha.IRankRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.discoveryengine.v1alpha.IRankResponse, + protos.google.cloud.discoveryengine.v1alpha.IRankRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + ranking_config: request.rankingConfig ?? '', + }); + this.initialize(); + return this.innerApiCalls.rank(request, options, callback); + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + + /** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified aclConfig resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + aclConfigPath(project: string, location: string) { + return this.pathTemplates.aclConfigPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from AclConfig resource. + * + * @param {string} aclConfigName + * A fully-qualified path representing AclConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAclConfigName(aclConfigName: string) { + return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName) + .project; + } + + /** + * Parse the location from AclConfig resource. + * + * @param {string} aclConfigName + * A fully-qualified path representing AclConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAclConfigName(aclConfigName: string) { + return this.pathTemplates.aclConfigPathTemplate.match(aclConfigName) + .location; + } + + /** + * Return a fully-qualified engine resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} collection + * @param {string} engine + * @returns {string} Resource name string. + */ + enginePath( + project: string, + location: string, + collection: string, + engine: string + ) { + return this.pathTemplates.enginePathTemplate.render({ + project: project, + location: location, + collection: collection, + engine: engine, + }); + } + + /** + * Parse the project from Engine resource. + * + * @param {string} engineName + * A fully-qualified path representing Engine resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEngineName(engineName: string) { + return this.pathTemplates.enginePathTemplate.match(engineName).project; + } + + /** + * Parse the location from Engine resource. + * + * @param {string} engineName + * A fully-qualified path representing Engine resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEngineName(engineName: string) { + return this.pathTemplates.enginePathTemplate.match(engineName).location; + } + + /** + * Parse the collection from Engine resource. + * + * @param {string} engineName + * A fully-qualified path representing Engine resource. + * @returns {string} A string representing the collection. + */ + matchCollectionFromEngineName(engineName: string) { + return this.pathTemplates.enginePathTemplate.match(engineName).collection; + } + + /** + * Parse the engine from Engine resource. + * + * @param {string} engineName + * A fully-qualified path representing Engine resource. + * @returns {string} A string representing the engine. + */ + matchEngineFromEngineName(engineName: string) { + return this.pathTemplates.enginePathTemplate.match(engineName).engine; + } + + /** + * Return a fully-qualified projectLocationCollectionDataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} collection + * @param {string} data_store + * @returns {string} Resource name string. + */ + projectLocationCollectionDataStorePath( + project: string, + location: string, + collection: string, + dataStore: string + ) { + return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.render( + { + project: project, + location: location, + collection: collection, + data_store: dataStore, + } + ); + } + + /** + * Parse the project from ProjectLocationCollectionDataStore resource. + * + * @param {string} projectLocationCollectionDataStoreName + * A fully-qualified path representing project_location_collection_data_store resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationCollectionDataStoreName( + projectLocationCollectionDataStoreName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match( + projectLocationCollectionDataStoreName + ).project; + } + + /** + * Parse the location from ProjectLocationCollectionDataStore resource. + * + * @param {string} projectLocationCollectionDataStoreName + * A fully-qualified path representing project_location_collection_data_store resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationCollectionDataStoreName( + projectLocationCollectionDataStoreName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match( + projectLocationCollectionDataStoreName + ).location; + } + + /** + * Parse the collection from ProjectLocationCollectionDataStore resource. + * + * @param {string} projectLocationCollectionDataStoreName + * A fully-qualified path representing project_location_collection_data_store resource. + * @returns {string} A string representing the collection. + */ + matchCollectionFromProjectLocationCollectionDataStoreName( + projectLocationCollectionDataStoreName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match( + projectLocationCollectionDataStoreName + ).collection; + } + + /** + * Parse the data_store from ProjectLocationCollectionDataStore resource. + * + * @param {string} projectLocationCollectionDataStoreName + * A fully-qualified path representing project_location_collection_data_store resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationCollectionDataStoreName( + projectLocationCollectionDataStoreName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStorePathTemplate.match( + projectLocationCollectionDataStoreName + ).data_store; + } + + /** + * Return a fully-qualified projectLocationCollectionDataStoreBranchDocument resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} collection + * @param {string} data_store + * @param {string} branch + * @param {string} document + * @returns {string} Resource name string. + */ + projectLocationCollectionDataStoreBranchDocumentPath( + project: string, + location: string, + collection: string, + dataStore: string, + branch: string, + document: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.render( + { + project: project, + location: location, + collection: collection, + data_store: dataStore, + branch: branch, + document: document, + } + ); + } + + /** + * Parse the project from ProjectLocationCollectionDataStoreBranchDocument resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentName + * A fully-qualified path representing project_location_collection_data_store_branch_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationCollectionDataStoreBranchDocumentName( + projectLocationCollectionDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentName + ).project; + } + + /** + * Parse the location from ProjectLocationCollectionDataStoreBranchDocument resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentName + * A fully-qualified path representing project_location_collection_data_store_branch_document resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationCollectionDataStoreBranchDocumentName( + projectLocationCollectionDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentName + ).location; + } + + /** + * Parse the collection from ProjectLocationCollectionDataStoreBranchDocument resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentName + * A fully-qualified path representing project_location_collection_data_store_branch_document resource. + * @returns {string} A string representing the collection. + */ + matchCollectionFromProjectLocationCollectionDataStoreBranchDocumentName( + projectLocationCollectionDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentName + ).collection; + } + + /** + * Parse the data_store from ProjectLocationCollectionDataStoreBranchDocument resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentName + * A fully-qualified path representing project_location_collection_data_store_branch_document resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationCollectionDataStoreBranchDocumentName( + projectLocationCollectionDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentName + ).data_store; + } + + /** + * Parse the branch from ProjectLocationCollectionDataStoreBranchDocument resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentName + * A fully-qualified path representing project_location_collection_data_store_branch_document resource. + * @returns {string} A string representing the branch. + */ + matchBranchFromProjectLocationCollectionDataStoreBranchDocumentName( + projectLocationCollectionDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentName + ).branch; + } + + /** + * Parse the document from ProjectLocationCollectionDataStoreBranchDocument resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentName + * A fully-qualified path representing project_location_collection_data_store_branch_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectLocationCollectionDataStoreBranchDocumentName( + projectLocationCollectionDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentName + ).document; + } + + /** + * Return a fully-qualified projectLocationCollectionDataStoreBranchDocumentChunk resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} collection + * @param {string} data_store + * @param {string} branch + * @param {string} document + * @param {string} chunk + * @returns {string} Resource name string. + */ + projectLocationCollectionDataStoreBranchDocumentChunkPath( + project: string, + location: string, + collection: string, + dataStore: string, + branch: string, + document: string, + chunk: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentChunkPathTemplate.render( + { + project: project, + location: location, + collection: collection, + data_store: dataStore, + branch: branch, + document: document, + chunk: chunk, + } + ); + } + + /** + * Parse the project from ProjectLocationCollectionDataStoreBranchDocumentChunk resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentChunkName + * A fully-qualified path representing project_location_collection_data_store_branch_document_chunk resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationCollectionDataStoreBranchDocumentChunkName( + projectLocationCollectionDataStoreBranchDocumentChunkName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentChunkPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentChunkName + ).project; + } + + /** + * Parse the location from ProjectLocationCollectionDataStoreBranchDocumentChunk resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentChunkName + * A fully-qualified path representing project_location_collection_data_store_branch_document_chunk resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationCollectionDataStoreBranchDocumentChunkName( + projectLocationCollectionDataStoreBranchDocumentChunkName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentChunkPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentChunkName + ).location; + } + + /** + * Parse the collection from ProjectLocationCollectionDataStoreBranchDocumentChunk resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentChunkName + * A fully-qualified path representing project_location_collection_data_store_branch_document_chunk resource. + * @returns {string} A string representing the collection. + */ + matchCollectionFromProjectLocationCollectionDataStoreBranchDocumentChunkName( + projectLocationCollectionDataStoreBranchDocumentChunkName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentChunkPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentChunkName + ).collection; + } + + /** + * Parse the data_store from ProjectLocationCollectionDataStoreBranchDocumentChunk resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentChunkName + * A fully-qualified path representing project_location_collection_data_store_branch_document_chunk resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationCollectionDataStoreBranchDocumentChunkName( + projectLocationCollectionDataStoreBranchDocumentChunkName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentChunkPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentChunkName + ).data_store; + } + + /** + * Parse the branch from ProjectLocationCollectionDataStoreBranchDocumentChunk resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentChunkName + * A fully-qualified path representing project_location_collection_data_store_branch_document_chunk resource. + * @returns {string} A string representing the branch. + */ + matchBranchFromProjectLocationCollectionDataStoreBranchDocumentChunkName( + projectLocationCollectionDataStoreBranchDocumentChunkName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentChunkPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentChunkName + ).branch; + } + + /** + * Parse the document from ProjectLocationCollectionDataStoreBranchDocumentChunk resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentChunkName + * A fully-qualified path representing project_location_collection_data_store_branch_document_chunk resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectLocationCollectionDataStoreBranchDocumentChunkName( + projectLocationCollectionDataStoreBranchDocumentChunkName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentChunkPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentChunkName + ).document; + } + + /** + * Parse the chunk from ProjectLocationCollectionDataStoreBranchDocumentChunk resource. + * + * @param {string} projectLocationCollectionDataStoreBranchDocumentChunkName + * A fully-qualified path representing project_location_collection_data_store_branch_document_chunk resource. + * @returns {string} A string representing the chunk. + */ + matchChunkFromProjectLocationCollectionDataStoreBranchDocumentChunkName( + projectLocationCollectionDataStoreBranchDocumentChunkName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreBranchDocumentChunkPathTemplate.match( + projectLocationCollectionDataStoreBranchDocumentChunkName + ).chunk; + } + + /** + * Return a fully-qualified projectLocationCollectionDataStoreConversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} collection + * @param {string} data_store + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectLocationCollectionDataStoreConversationPath( + project: string, + location: string, + collection: string, + dataStore: string, + conversation: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreConversationPathTemplate.render( + { + project: project, + location: location, + collection: collection, + data_store: dataStore, + conversation: conversation, + } + ); + } + + /** + * Parse the project from ProjectLocationCollectionDataStoreConversation resource. + * + * @param {string} projectLocationCollectionDataStoreConversationName + * A fully-qualified path representing project_location_collection_data_store_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationCollectionDataStoreConversationName( + projectLocationCollectionDataStoreConversationName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreConversationPathTemplate.match( + projectLocationCollectionDataStoreConversationName + ).project; + } + + /** + * Parse the location from ProjectLocationCollectionDataStoreConversation resource. + * + * @param {string} projectLocationCollectionDataStoreConversationName + * A fully-qualified path representing project_location_collection_data_store_conversation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationCollectionDataStoreConversationName( + projectLocationCollectionDataStoreConversationName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreConversationPathTemplate.match( + projectLocationCollectionDataStoreConversationName + ).location; + } + + /** + * Parse the collection from ProjectLocationCollectionDataStoreConversation resource. + * + * @param {string} projectLocationCollectionDataStoreConversationName + * A fully-qualified path representing project_location_collection_data_store_conversation resource. + * @returns {string} A string representing the collection. + */ + matchCollectionFromProjectLocationCollectionDataStoreConversationName( + projectLocationCollectionDataStoreConversationName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreConversationPathTemplate.match( + projectLocationCollectionDataStoreConversationName + ).collection; + } + + /** + * Parse the data_store from ProjectLocationCollectionDataStoreConversation resource. + * + * @param {string} projectLocationCollectionDataStoreConversationName + * A fully-qualified path representing project_location_collection_data_store_conversation resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationCollectionDataStoreConversationName( + projectLocationCollectionDataStoreConversationName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreConversationPathTemplate.match( + projectLocationCollectionDataStoreConversationName + ).data_store; + } + + /** + * Parse the conversation from ProjectLocationCollectionDataStoreConversation resource. + * + * @param {string} projectLocationCollectionDataStoreConversationName + * A fully-qualified path representing project_location_collection_data_store_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationCollectionDataStoreConversationName( + projectLocationCollectionDataStoreConversationName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreConversationPathTemplate.match( + projectLocationCollectionDataStoreConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectLocationCollectionDataStoreDocumentProcessingConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} collection + * @param {string} data_store + * @returns {string} Resource name string. + */ + projectLocationCollectionDataStoreDocumentProcessingConfigPath( + project: string, + location: string, + collection: string, + dataStore: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreDocumentProcessingConfigPathTemplate.render( + { + project: project, + location: location, + collection: collection, + data_store: dataStore, + } + ); + } + + /** + * Parse the project from ProjectLocationCollectionDataStoreDocumentProcessingConfig resource. + * + * @param {string} projectLocationCollectionDataStoreDocumentProcessingConfigName + * A fully-qualified path representing project_location_collection_data_store_documentProcessingConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationCollectionDataStoreDocumentProcessingConfigName( + projectLocationCollectionDataStoreDocumentProcessingConfigName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreDocumentProcessingConfigPathTemplate.match( + projectLocationCollectionDataStoreDocumentProcessingConfigName + ).project; + } + + /** + * Parse the location from ProjectLocationCollectionDataStoreDocumentProcessingConfig resource. + * + * @param {string} projectLocationCollectionDataStoreDocumentProcessingConfigName + * A fully-qualified path representing project_location_collection_data_store_documentProcessingConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationCollectionDataStoreDocumentProcessingConfigName( + projectLocationCollectionDataStoreDocumentProcessingConfigName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreDocumentProcessingConfigPathTemplate.match( + projectLocationCollectionDataStoreDocumentProcessingConfigName + ).location; + } + + /** + * Parse the collection from ProjectLocationCollectionDataStoreDocumentProcessingConfig resource. + * + * @param {string} projectLocationCollectionDataStoreDocumentProcessingConfigName + * A fully-qualified path representing project_location_collection_data_store_documentProcessingConfig resource. + * @returns {string} A string representing the collection. + */ + matchCollectionFromProjectLocationCollectionDataStoreDocumentProcessingConfigName( + projectLocationCollectionDataStoreDocumentProcessingConfigName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreDocumentProcessingConfigPathTemplate.match( + projectLocationCollectionDataStoreDocumentProcessingConfigName + ).collection; + } + + /** + * Parse the data_store from ProjectLocationCollectionDataStoreDocumentProcessingConfig resource. + * + * @param {string} projectLocationCollectionDataStoreDocumentProcessingConfigName + * A fully-qualified path representing project_location_collection_data_store_documentProcessingConfig resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationCollectionDataStoreDocumentProcessingConfigName( + projectLocationCollectionDataStoreDocumentProcessingConfigName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreDocumentProcessingConfigPathTemplate.match( + projectLocationCollectionDataStoreDocumentProcessingConfigName + ).data_store; + } + + /** + * Return a fully-qualified projectLocationCollectionDataStoreSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} collection + * @param {string} data_store + * @param {string} schema + * @returns {string} Resource name string. + */ + projectLocationCollectionDataStoreSchemaPath( + project: string, + location: string, + collection: string, + dataStore: string, + schema: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.render( + { + project: project, + location: location, + collection: collection, + data_store: dataStore, + schema: schema, + } + ); + } + + /** + * Parse the project from ProjectLocationCollectionDataStoreSchema resource. + * + * @param {string} projectLocationCollectionDataStoreSchemaName + * A fully-qualified path representing project_location_collection_data_store_schema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationCollectionDataStoreSchemaName( + projectLocationCollectionDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match( + projectLocationCollectionDataStoreSchemaName + ).project; + } + + /** + * Parse the location from ProjectLocationCollectionDataStoreSchema resource. + * + * @param {string} projectLocationCollectionDataStoreSchemaName + * A fully-qualified path representing project_location_collection_data_store_schema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationCollectionDataStoreSchemaName( + projectLocationCollectionDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match( + projectLocationCollectionDataStoreSchemaName + ).location; + } + + /** + * Parse the collection from ProjectLocationCollectionDataStoreSchema resource. + * + * @param {string} projectLocationCollectionDataStoreSchemaName + * A fully-qualified path representing project_location_collection_data_store_schema resource. + * @returns {string} A string representing the collection. + */ + matchCollectionFromProjectLocationCollectionDataStoreSchemaName( + projectLocationCollectionDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match( + projectLocationCollectionDataStoreSchemaName + ).collection; + } + + /** + * Parse the data_store from ProjectLocationCollectionDataStoreSchema resource. + * + * @param {string} projectLocationCollectionDataStoreSchemaName + * A fully-qualified path representing project_location_collection_data_store_schema resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationCollectionDataStoreSchemaName( + projectLocationCollectionDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match( + projectLocationCollectionDataStoreSchemaName + ).data_store; + } + + /** + * Parse the schema from ProjectLocationCollectionDataStoreSchema resource. + * + * @param {string} projectLocationCollectionDataStoreSchemaName + * A fully-qualified path representing project_location_collection_data_store_schema resource. + * @returns {string} A string representing the schema. + */ + matchSchemaFromProjectLocationCollectionDataStoreSchemaName( + projectLocationCollectionDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match( + projectLocationCollectionDataStoreSchemaName + ).schema; + } + + /** + * Return a fully-qualified projectLocationCollectionDataStoreServingConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} collection + * @param {string} data_store + * @param {string} serving_config + * @returns {string} Resource name string. + */ + projectLocationCollectionDataStoreServingConfigPath( + project: string, + location: string, + collection: string, + dataStore: string, + servingConfig: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreServingConfigPathTemplate.render( + { + project: project, + location: location, + collection: collection, + data_store: dataStore, + serving_config: servingConfig, + } + ); + } + + /** + * Parse the project from ProjectLocationCollectionDataStoreServingConfig resource. + * + * @param {string} projectLocationCollectionDataStoreServingConfigName + * A fully-qualified path representing project_location_collection_data_store_serving_config resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationCollectionDataStoreServingConfigName( + projectLocationCollectionDataStoreServingConfigName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreServingConfigPathTemplate.match( + projectLocationCollectionDataStoreServingConfigName + ).project; + } + + /** + * Parse the location from ProjectLocationCollectionDataStoreServingConfig resource. + * + * @param {string} projectLocationCollectionDataStoreServingConfigName + * A fully-qualified path representing project_location_collection_data_store_serving_config resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationCollectionDataStoreServingConfigName( + projectLocationCollectionDataStoreServingConfigName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreServingConfigPathTemplate.match( + projectLocationCollectionDataStoreServingConfigName + ).location; + } + + /** + * Parse the collection from ProjectLocationCollectionDataStoreServingConfig resource. + * + * @param {string} projectLocationCollectionDataStoreServingConfigName + * A fully-qualified path representing project_location_collection_data_store_serving_config resource. + * @returns {string} A string representing the collection. + */ + matchCollectionFromProjectLocationCollectionDataStoreServingConfigName( + projectLocationCollectionDataStoreServingConfigName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreServingConfigPathTemplate.match( + projectLocationCollectionDataStoreServingConfigName + ).collection; + } + + /** + * Parse the data_store from ProjectLocationCollectionDataStoreServingConfig resource. + * + * @param {string} projectLocationCollectionDataStoreServingConfigName + * A fully-qualified path representing project_location_collection_data_store_serving_config resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationCollectionDataStoreServingConfigName( + projectLocationCollectionDataStoreServingConfigName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreServingConfigPathTemplate.match( + projectLocationCollectionDataStoreServingConfigName + ).data_store; + } + + /** + * Parse the serving_config from ProjectLocationCollectionDataStoreServingConfig resource. + * + * @param {string} projectLocationCollectionDataStoreServingConfigName + * A fully-qualified path representing project_location_collection_data_store_serving_config resource. + * @returns {string} A string representing the serving_config. + */ + matchServingConfigFromProjectLocationCollectionDataStoreServingConfigName( + projectLocationCollectionDataStoreServingConfigName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreServingConfigPathTemplate.match( + projectLocationCollectionDataStoreServingConfigName + ).serving_config; + } + + /** + * Return a fully-qualified projectLocationCollectionDataStoreSiteSearchEngine resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} collection + * @param {string} data_store + * @returns {string} Resource name string. + */ + projectLocationCollectionDataStoreSiteSearchEnginePath( + project: string, + location: string, + collection: string, + dataStore: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSiteSearchEnginePathTemplate.render( + { + project: project, + location: location, + collection: collection, + data_store: dataStore, + } + ); + } + + /** + * Parse the project from ProjectLocationCollectionDataStoreSiteSearchEngine resource. + * + * @param {string} projectLocationCollectionDataStoreSiteSearchEngineName + * A fully-qualified path representing project_location_collection_data_store_siteSearchEngine resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationCollectionDataStoreSiteSearchEngineName( + projectLocationCollectionDataStoreSiteSearchEngineName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSiteSearchEnginePathTemplate.match( + projectLocationCollectionDataStoreSiteSearchEngineName + ).project; + } + + /** + * Parse the location from ProjectLocationCollectionDataStoreSiteSearchEngine resource. + * + * @param {string} projectLocationCollectionDataStoreSiteSearchEngineName + * A fully-qualified path representing project_location_collection_data_store_siteSearchEngine resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationCollectionDataStoreSiteSearchEngineName( + projectLocationCollectionDataStoreSiteSearchEngineName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSiteSearchEnginePathTemplate.match( + projectLocationCollectionDataStoreSiteSearchEngineName + ).location; + } + + /** + * Parse the collection from ProjectLocationCollectionDataStoreSiteSearchEngine resource. + * + * @param {string} projectLocationCollectionDataStoreSiteSearchEngineName + * A fully-qualified path representing project_location_collection_data_store_siteSearchEngine resource. + * @returns {string} A string representing the collection. + */ + matchCollectionFromProjectLocationCollectionDataStoreSiteSearchEngineName( + projectLocationCollectionDataStoreSiteSearchEngineName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSiteSearchEnginePathTemplate.match( + projectLocationCollectionDataStoreSiteSearchEngineName + ).collection; + } + + /** + * Parse the data_store from ProjectLocationCollectionDataStoreSiteSearchEngine resource. + * + * @param {string} projectLocationCollectionDataStoreSiteSearchEngineName + * A fully-qualified path representing project_location_collection_data_store_siteSearchEngine resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationCollectionDataStoreSiteSearchEngineName( + projectLocationCollectionDataStoreSiteSearchEngineName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSiteSearchEnginePathTemplate.match( + projectLocationCollectionDataStoreSiteSearchEngineName + ).data_store; + } + + /** + * Return a fully-qualified projectLocationCollectionDataStoreSiteSearchEngineTargetSite resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} collection + * @param {string} data_store + * @param {string} target_site + * @returns {string} Resource name string. + */ + projectLocationCollectionDataStoreSiteSearchEngineTargetSitePath( + project: string, + location: string, + collection: string, + dataStore: string, + targetSite: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSiteSearchEngineTargetSitePathTemplate.render( + { + project: project, + location: location, + collection: collection, + data_store: dataStore, + target_site: targetSite, + } + ); + } + + /** + * Parse the project from ProjectLocationCollectionDataStoreSiteSearchEngineTargetSite resource. + * + * @param {string} projectLocationCollectionDataStoreSiteSearchEngineTargetSiteName + * A fully-qualified path representing project_location_collection_data_store_siteSearchEngine_target_site resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationCollectionDataStoreSiteSearchEngineTargetSiteName( + projectLocationCollectionDataStoreSiteSearchEngineTargetSiteName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSiteSearchEngineTargetSitePathTemplate.match( + projectLocationCollectionDataStoreSiteSearchEngineTargetSiteName + ).project; + } + + /** + * Parse the location from ProjectLocationCollectionDataStoreSiteSearchEngineTargetSite resource. + * + * @param {string} projectLocationCollectionDataStoreSiteSearchEngineTargetSiteName + * A fully-qualified path representing project_location_collection_data_store_siteSearchEngine_target_site resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationCollectionDataStoreSiteSearchEngineTargetSiteName( + projectLocationCollectionDataStoreSiteSearchEngineTargetSiteName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSiteSearchEngineTargetSitePathTemplate.match( + projectLocationCollectionDataStoreSiteSearchEngineTargetSiteName + ).location; + } + + /** + * Parse the collection from ProjectLocationCollectionDataStoreSiteSearchEngineTargetSite resource. + * + * @param {string} projectLocationCollectionDataStoreSiteSearchEngineTargetSiteName + * A fully-qualified path representing project_location_collection_data_store_siteSearchEngine_target_site resource. + * @returns {string} A string representing the collection. + */ + matchCollectionFromProjectLocationCollectionDataStoreSiteSearchEngineTargetSiteName( + projectLocationCollectionDataStoreSiteSearchEngineTargetSiteName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSiteSearchEngineTargetSitePathTemplate.match( + projectLocationCollectionDataStoreSiteSearchEngineTargetSiteName + ).collection; + } + + /** + * Parse the data_store from ProjectLocationCollectionDataStoreSiteSearchEngineTargetSite resource. + * + * @param {string} projectLocationCollectionDataStoreSiteSearchEngineTargetSiteName + * A fully-qualified path representing project_location_collection_data_store_siteSearchEngine_target_site resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationCollectionDataStoreSiteSearchEngineTargetSiteName( + projectLocationCollectionDataStoreSiteSearchEngineTargetSiteName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSiteSearchEngineTargetSitePathTemplate.match( + projectLocationCollectionDataStoreSiteSearchEngineTargetSiteName + ).data_store; + } + + /** + * Parse the target_site from ProjectLocationCollectionDataStoreSiteSearchEngineTargetSite resource. + * + * @param {string} projectLocationCollectionDataStoreSiteSearchEngineTargetSiteName + * A fully-qualified path representing project_location_collection_data_store_siteSearchEngine_target_site resource. + * @returns {string} A string representing the target_site. + */ + matchTargetSiteFromProjectLocationCollectionDataStoreSiteSearchEngineTargetSiteName( + projectLocationCollectionDataStoreSiteSearchEngineTargetSiteName: string + ) { + return this.pathTemplates.projectLocationCollectionDataStoreSiteSearchEngineTargetSitePathTemplate.match( + projectLocationCollectionDataStoreSiteSearchEngineTargetSiteName + ).target_site; + } + + /** + * Return a fully-qualified projectLocationCollectionEngineConversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} collection + * @param {string} engine + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectLocationCollectionEngineConversationPath( + project: string, + location: string, + collection: string, + engine: string, + conversation: string + ) { + return this.pathTemplates.projectLocationCollectionEngineConversationPathTemplate.render( + { + project: project, + location: location, + collection: collection, + engine: engine, + conversation: conversation, + } + ); + } + + /** + * Parse the project from ProjectLocationCollectionEngineConversation resource. + * + * @param {string} projectLocationCollectionEngineConversationName + * A fully-qualified path representing project_location_collection_engine_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationCollectionEngineConversationName( + projectLocationCollectionEngineConversationName: string + ) { + return this.pathTemplates.projectLocationCollectionEngineConversationPathTemplate.match( + projectLocationCollectionEngineConversationName + ).project; + } + + /** + * Parse the location from ProjectLocationCollectionEngineConversation resource. + * + * @param {string} projectLocationCollectionEngineConversationName + * A fully-qualified path representing project_location_collection_engine_conversation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationCollectionEngineConversationName( + projectLocationCollectionEngineConversationName: string + ) { + return this.pathTemplates.projectLocationCollectionEngineConversationPathTemplate.match( + projectLocationCollectionEngineConversationName + ).location; + } + + /** + * Parse the collection from ProjectLocationCollectionEngineConversation resource. + * + * @param {string} projectLocationCollectionEngineConversationName + * A fully-qualified path representing project_location_collection_engine_conversation resource. + * @returns {string} A string representing the collection. + */ + matchCollectionFromProjectLocationCollectionEngineConversationName( + projectLocationCollectionEngineConversationName: string + ) { + return this.pathTemplates.projectLocationCollectionEngineConversationPathTemplate.match( + projectLocationCollectionEngineConversationName + ).collection; + } + + /** + * Parse the engine from ProjectLocationCollectionEngineConversation resource. + * + * @param {string} projectLocationCollectionEngineConversationName + * A fully-qualified path representing project_location_collection_engine_conversation resource. + * @returns {string} A string representing the engine. + */ + matchEngineFromProjectLocationCollectionEngineConversationName( + projectLocationCollectionEngineConversationName: string + ) { + return this.pathTemplates.projectLocationCollectionEngineConversationPathTemplate.match( + projectLocationCollectionEngineConversationName + ).engine; + } + + /** + * Parse the conversation from ProjectLocationCollectionEngineConversation resource. + * + * @param {string} projectLocationCollectionEngineConversationName + * A fully-qualified path representing project_location_collection_engine_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationCollectionEngineConversationName( + projectLocationCollectionEngineConversationName: string + ) { + return this.pathTemplates.projectLocationCollectionEngineConversationPathTemplate.match( + projectLocationCollectionEngineConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectLocationCollectionEngineServingConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} collection + * @param {string} engine + * @param {string} serving_config + * @returns {string} Resource name string. + */ + projectLocationCollectionEngineServingConfigPath( + project: string, + location: string, + collection: string, + engine: string, + servingConfig: string + ) { + return this.pathTemplates.projectLocationCollectionEngineServingConfigPathTemplate.render( + { + project: project, + location: location, + collection: collection, + engine: engine, + serving_config: servingConfig, + } + ); + } + + /** + * Parse the project from ProjectLocationCollectionEngineServingConfig resource. + * + * @param {string} projectLocationCollectionEngineServingConfigName + * A fully-qualified path representing project_location_collection_engine_serving_config resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationCollectionEngineServingConfigName( + projectLocationCollectionEngineServingConfigName: string + ) { + return this.pathTemplates.projectLocationCollectionEngineServingConfigPathTemplate.match( + projectLocationCollectionEngineServingConfigName + ).project; + } + + /** + * Parse the location from ProjectLocationCollectionEngineServingConfig resource. + * + * @param {string} projectLocationCollectionEngineServingConfigName + * A fully-qualified path representing project_location_collection_engine_serving_config resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationCollectionEngineServingConfigName( + projectLocationCollectionEngineServingConfigName: string + ) { + return this.pathTemplates.projectLocationCollectionEngineServingConfigPathTemplate.match( + projectLocationCollectionEngineServingConfigName + ).location; + } + + /** + * Parse the collection from ProjectLocationCollectionEngineServingConfig resource. + * + * @param {string} projectLocationCollectionEngineServingConfigName + * A fully-qualified path representing project_location_collection_engine_serving_config resource. + * @returns {string} A string representing the collection. + */ + matchCollectionFromProjectLocationCollectionEngineServingConfigName( + projectLocationCollectionEngineServingConfigName: string + ) { + return this.pathTemplates.projectLocationCollectionEngineServingConfigPathTemplate.match( + projectLocationCollectionEngineServingConfigName + ).collection; + } + + /** + * Parse the engine from ProjectLocationCollectionEngineServingConfig resource. + * + * @param {string} projectLocationCollectionEngineServingConfigName + * A fully-qualified path representing project_location_collection_engine_serving_config resource. + * @returns {string} A string representing the engine. + */ + matchEngineFromProjectLocationCollectionEngineServingConfigName( + projectLocationCollectionEngineServingConfigName: string + ) { + return this.pathTemplates.projectLocationCollectionEngineServingConfigPathTemplate.match( + projectLocationCollectionEngineServingConfigName + ).engine; + } + + /** + * Parse the serving_config from ProjectLocationCollectionEngineServingConfig resource. + * + * @param {string} projectLocationCollectionEngineServingConfigName + * A fully-qualified path representing project_location_collection_engine_serving_config resource. + * @returns {string} A string representing the serving_config. + */ + matchServingConfigFromProjectLocationCollectionEngineServingConfigName( + projectLocationCollectionEngineServingConfigName: string + ) { + return this.pathTemplates.projectLocationCollectionEngineServingConfigPathTemplate.match( + projectLocationCollectionEngineServingConfigName + ).serving_config; + } + + /** + * Return a fully-qualified projectLocationDataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_store + * @returns {string} Resource name string. + */ + projectLocationDataStorePath( + project: string, + location: string, + dataStore: string + ) { + return this.pathTemplates.projectLocationDataStorePathTemplate.render({ + project: project, + location: location, + data_store: dataStore, + }); + } + + /** + * Parse the project from ProjectLocationDataStore resource. + * + * @param {string} projectLocationDataStoreName + * A fully-qualified path representing project_location_data_store resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDataStoreName( + projectLocationDataStoreName: string + ) { + return this.pathTemplates.projectLocationDataStorePathTemplate.match( + projectLocationDataStoreName + ).project; + } + + /** + * Parse the location from ProjectLocationDataStore resource. + * + * @param {string} projectLocationDataStoreName + * A fully-qualified path representing project_location_data_store resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDataStoreName( + projectLocationDataStoreName: string + ) { + return this.pathTemplates.projectLocationDataStorePathTemplate.match( + projectLocationDataStoreName + ).location; + } + + /** + * Parse the data_store from ProjectLocationDataStore resource. + * + * @param {string} projectLocationDataStoreName + * A fully-qualified path representing project_location_data_store resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationDataStoreName( + projectLocationDataStoreName: string + ) { + return this.pathTemplates.projectLocationDataStorePathTemplate.match( + projectLocationDataStoreName + ).data_store; + } + + /** + * Return a fully-qualified projectLocationDataStoreBranchDocument resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_store + * @param {string} branch + * @param {string} document + * @returns {string} Resource name string. + */ + projectLocationDataStoreBranchDocumentPath( + project: string, + location: string, + dataStore: string, + branch: string, + document: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.render( + { + project: project, + location: location, + data_store: dataStore, + branch: branch, + document: document, + } + ); + } + + /** + * Parse the project from ProjectLocationDataStoreBranchDocument resource. + * + * @param {string} projectLocationDataStoreBranchDocumentName + * A fully-qualified path representing project_location_data_store_branch_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDataStoreBranchDocumentName( + projectLocationDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match( + projectLocationDataStoreBranchDocumentName + ).project; + } + + /** + * Parse the location from ProjectLocationDataStoreBranchDocument resource. + * + * @param {string} projectLocationDataStoreBranchDocumentName + * A fully-qualified path representing project_location_data_store_branch_document resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDataStoreBranchDocumentName( + projectLocationDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match( + projectLocationDataStoreBranchDocumentName + ).location; + } + + /** + * Parse the data_store from ProjectLocationDataStoreBranchDocument resource. + * + * @param {string} projectLocationDataStoreBranchDocumentName + * A fully-qualified path representing project_location_data_store_branch_document resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationDataStoreBranchDocumentName( + projectLocationDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match( + projectLocationDataStoreBranchDocumentName + ).data_store; + } + + /** + * Parse the branch from ProjectLocationDataStoreBranchDocument resource. + * + * @param {string} projectLocationDataStoreBranchDocumentName + * A fully-qualified path representing project_location_data_store_branch_document resource. + * @returns {string} A string representing the branch. + */ + matchBranchFromProjectLocationDataStoreBranchDocumentName( + projectLocationDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match( + projectLocationDataStoreBranchDocumentName + ).branch; + } + + /** + * Parse the document from ProjectLocationDataStoreBranchDocument resource. + * + * @param {string} projectLocationDataStoreBranchDocumentName + * A fully-qualified path representing project_location_data_store_branch_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectLocationDataStoreBranchDocumentName( + projectLocationDataStoreBranchDocumentName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match( + projectLocationDataStoreBranchDocumentName + ).document; + } + + /** + * Return a fully-qualified projectLocationDataStoreBranchDocumentChunk resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_store + * @param {string} branch + * @param {string} document + * @param {string} chunk + * @returns {string} Resource name string. + */ + projectLocationDataStoreBranchDocumentChunkPath( + project: string, + location: string, + dataStore: string, + branch: string, + document: string, + chunk: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentChunkPathTemplate.render( + { + project: project, + location: location, + data_store: dataStore, + branch: branch, + document: document, + chunk: chunk, + } + ); + } + + /** + * Parse the project from ProjectLocationDataStoreBranchDocumentChunk resource. + * + * @param {string} projectLocationDataStoreBranchDocumentChunkName + * A fully-qualified path representing project_location_data_store_branch_document_chunk resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDataStoreBranchDocumentChunkName( + projectLocationDataStoreBranchDocumentChunkName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentChunkPathTemplate.match( + projectLocationDataStoreBranchDocumentChunkName + ).project; + } + + /** + * Parse the location from ProjectLocationDataStoreBranchDocumentChunk resource. + * + * @param {string} projectLocationDataStoreBranchDocumentChunkName + * A fully-qualified path representing project_location_data_store_branch_document_chunk resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDataStoreBranchDocumentChunkName( + projectLocationDataStoreBranchDocumentChunkName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentChunkPathTemplate.match( + projectLocationDataStoreBranchDocumentChunkName + ).location; + } + + /** + * Parse the data_store from ProjectLocationDataStoreBranchDocumentChunk resource. + * + * @param {string} projectLocationDataStoreBranchDocumentChunkName + * A fully-qualified path representing project_location_data_store_branch_document_chunk resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationDataStoreBranchDocumentChunkName( + projectLocationDataStoreBranchDocumentChunkName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentChunkPathTemplate.match( + projectLocationDataStoreBranchDocumentChunkName + ).data_store; + } + + /** + * Parse the branch from ProjectLocationDataStoreBranchDocumentChunk resource. + * + * @param {string} projectLocationDataStoreBranchDocumentChunkName + * A fully-qualified path representing project_location_data_store_branch_document_chunk resource. + * @returns {string} A string representing the branch. + */ + matchBranchFromProjectLocationDataStoreBranchDocumentChunkName( + projectLocationDataStoreBranchDocumentChunkName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentChunkPathTemplate.match( + projectLocationDataStoreBranchDocumentChunkName + ).branch; + } + + /** + * Parse the document from ProjectLocationDataStoreBranchDocumentChunk resource. + * + * @param {string} projectLocationDataStoreBranchDocumentChunkName + * A fully-qualified path representing project_location_data_store_branch_document_chunk resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectLocationDataStoreBranchDocumentChunkName( + projectLocationDataStoreBranchDocumentChunkName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentChunkPathTemplate.match( + projectLocationDataStoreBranchDocumentChunkName + ).document; + } + + /** + * Parse the chunk from ProjectLocationDataStoreBranchDocumentChunk resource. + * + * @param {string} projectLocationDataStoreBranchDocumentChunkName + * A fully-qualified path representing project_location_data_store_branch_document_chunk resource. + * @returns {string} A string representing the chunk. + */ + matchChunkFromProjectLocationDataStoreBranchDocumentChunkName( + projectLocationDataStoreBranchDocumentChunkName: string + ) { + return this.pathTemplates.projectLocationDataStoreBranchDocumentChunkPathTemplate.match( + projectLocationDataStoreBranchDocumentChunkName + ).chunk; + } + + /** + * Return a fully-qualified projectLocationDataStoreConversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_store + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectLocationDataStoreConversationPath( + project: string, + location: string, + dataStore: string, + conversation: string + ) { + return this.pathTemplates.projectLocationDataStoreConversationPathTemplate.render( + { + project: project, + location: location, + data_store: dataStore, + conversation: conversation, + } + ); + } + + /** + * Parse the project from ProjectLocationDataStoreConversation resource. + * + * @param {string} projectLocationDataStoreConversationName + * A fully-qualified path representing project_location_data_store_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDataStoreConversationName( + projectLocationDataStoreConversationName: string + ) { + return this.pathTemplates.projectLocationDataStoreConversationPathTemplate.match( + projectLocationDataStoreConversationName + ).project; + } + + /** + * Parse the location from ProjectLocationDataStoreConversation resource. + * + * @param {string} projectLocationDataStoreConversationName + * A fully-qualified path representing project_location_data_store_conversation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDataStoreConversationName( + projectLocationDataStoreConversationName: string + ) { + return this.pathTemplates.projectLocationDataStoreConversationPathTemplate.match( + projectLocationDataStoreConversationName + ).location; + } + + /** + * Parse the data_store from ProjectLocationDataStoreConversation resource. + * + * @param {string} projectLocationDataStoreConversationName + * A fully-qualified path representing project_location_data_store_conversation resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationDataStoreConversationName( + projectLocationDataStoreConversationName: string + ) { + return this.pathTemplates.projectLocationDataStoreConversationPathTemplate.match( + projectLocationDataStoreConversationName + ).data_store; + } + + /** + * Parse the conversation from ProjectLocationDataStoreConversation resource. + * + * @param {string} projectLocationDataStoreConversationName + * A fully-qualified path representing project_location_data_store_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationDataStoreConversationName( + projectLocationDataStoreConversationName: string + ) { + return this.pathTemplates.projectLocationDataStoreConversationPathTemplate.match( + projectLocationDataStoreConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectLocationDataStoreDocumentProcessingConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_store + * @returns {string} Resource name string. + */ + projectLocationDataStoreDocumentProcessingConfigPath( + project: string, + location: string, + dataStore: string + ) { + return this.pathTemplates.projectLocationDataStoreDocumentProcessingConfigPathTemplate.render( + { + project: project, + location: location, + data_store: dataStore, + } + ); + } + + /** + * Parse the project from ProjectLocationDataStoreDocumentProcessingConfig resource. + * + * @param {string} projectLocationDataStoreDocumentProcessingConfigName + * A fully-qualified path representing project_location_data_store_documentProcessingConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDataStoreDocumentProcessingConfigName( + projectLocationDataStoreDocumentProcessingConfigName: string + ) { + return this.pathTemplates.projectLocationDataStoreDocumentProcessingConfigPathTemplate.match( + projectLocationDataStoreDocumentProcessingConfigName + ).project; + } + + /** + * Parse the location from ProjectLocationDataStoreDocumentProcessingConfig resource. + * + * @param {string} projectLocationDataStoreDocumentProcessingConfigName + * A fully-qualified path representing project_location_data_store_documentProcessingConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDataStoreDocumentProcessingConfigName( + projectLocationDataStoreDocumentProcessingConfigName: string + ) { + return this.pathTemplates.projectLocationDataStoreDocumentProcessingConfigPathTemplate.match( + projectLocationDataStoreDocumentProcessingConfigName + ).location; + } + + /** + * Parse the data_store from ProjectLocationDataStoreDocumentProcessingConfig resource. + * + * @param {string} projectLocationDataStoreDocumentProcessingConfigName + * A fully-qualified path representing project_location_data_store_documentProcessingConfig resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationDataStoreDocumentProcessingConfigName( + projectLocationDataStoreDocumentProcessingConfigName: string + ) { + return this.pathTemplates.projectLocationDataStoreDocumentProcessingConfigPathTemplate.match( + projectLocationDataStoreDocumentProcessingConfigName + ).data_store; + } + + /** + * Return a fully-qualified projectLocationDataStoreSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_store + * @param {string} schema + * @returns {string} Resource name string. + */ + projectLocationDataStoreSchemaPath( + project: string, + location: string, + dataStore: string, + schema: string + ) { + return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.render( + { + project: project, + location: location, + data_store: dataStore, + schema: schema, + } + ); + } + + /** + * Parse the project from ProjectLocationDataStoreSchema resource. + * + * @param {string} projectLocationDataStoreSchemaName + * A fully-qualified path representing project_location_data_store_schema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDataStoreSchemaName( + projectLocationDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match( + projectLocationDataStoreSchemaName + ).project; + } + + /** + * Parse the location from ProjectLocationDataStoreSchema resource. + * + * @param {string} projectLocationDataStoreSchemaName + * A fully-qualified path representing project_location_data_store_schema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDataStoreSchemaName( + projectLocationDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match( + projectLocationDataStoreSchemaName + ).location; + } + + /** + * Parse the data_store from ProjectLocationDataStoreSchema resource. + * + * @param {string} projectLocationDataStoreSchemaName + * A fully-qualified path representing project_location_data_store_schema resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationDataStoreSchemaName( + projectLocationDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match( + projectLocationDataStoreSchemaName + ).data_store; + } + + /** + * Parse the schema from ProjectLocationDataStoreSchema resource. + * + * @param {string} projectLocationDataStoreSchemaName + * A fully-qualified path representing project_location_data_store_schema resource. + * @returns {string} A string representing the schema. + */ + matchSchemaFromProjectLocationDataStoreSchemaName( + projectLocationDataStoreSchemaName: string + ) { + return this.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match( + projectLocationDataStoreSchemaName + ).schema; + } + + /** + * Return a fully-qualified projectLocationDataStoreServingConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_store + * @param {string} serving_config + * @returns {string} Resource name string. + */ + projectLocationDataStoreServingConfigPath( + project: string, + location: string, + dataStore: string, + servingConfig: string + ) { + return this.pathTemplates.projectLocationDataStoreServingConfigPathTemplate.render( + { + project: project, + location: location, + data_store: dataStore, + serving_config: servingConfig, + } + ); + } + + /** + * Parse the project from ProjectLocationDataStoreServingConfig resource. + * + * @param {string} projectLocationDataStoreServingConfigName + * A fully-qualified path representing project_location_data_store_serving_config resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDataStoreServingConfigName( + projectLocationDataStoreServingConfigName: string + ) { + return this.pathTemplates.projectLocationDataStoreServingConfigPathTemplate.match( + projectLocationDataStoreServingConfigName + ).project; + } + + /** + * Parse the location from ProjectLocationDataStoreServingConfig resource. + * + * @param {string} projectLocationDataStoreServingConfigName + * A fully-qualified path representing project_location_data_store_serving_config resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDataStoreServingConfigName( + projectLocationDataStoreServingConfigName: string + ) { + return this.pathTemplates.projectLocationDataStoreServingConfigPathTemplate.match( + projectLocationDataStoreServingConfigName + ).location; + } + + /** + * Parse the data_store from ProjectLocationDataStoreServingConfig resource. + * + * @param {string} projectLocationDataStoreServingConfigName + * A fully-qualified path representing project_location_data_store_serving_config resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationDataStoreServingConfigName( + projectLocationDataStoreServingConfigName: string + ) { + return this.pathTemplates.projectLocationDataStoreServingConfigPathTemplate.match( + projectLocationDataStoreServingConfigName + ).data_store; + } + + /** + * Parse the serving_config from ProjectLocationDataStoreServingConfig resource. + * + * @param {string} projectLocationDataStoreServingConfigName + * A fully-qualified path representing project_location_data_store_serving_config resource. + * @returns {string} A string representing the serving_config. + */ + matchServingConfigFromProjectLocationDataStoreServingConfigName( + projectLocationDataStoreServingConfigName: string + ) { + return this.pathTemplates.projectLocationDataStoreServingConfigPathTemplate.match( + projectLocationDataStoreServingConfigName + ).serving_config; + } + + /** + * Return a fully-qualified projectLocationDataStoreSiteSearchEngine resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_store + * @returns {string} Resource name string. + */ + projectLocationDataStoreSiteSearchEnginePath( + project: string, + location: string, + dataStore: string + ) { + return this.pathTemplates.projectLocationDataStoreSiteSearchEnginePathTemplate.render( + { + project: project, + location: location, + data_store: dataStore, + } + ); + } + + /** + * Parse the project from ProjectLocationDataStoreSiteSearchEngine resource. + * + * @param {string} projectLocationDataStoreSiteSearchEngineName + * A fully-qualified path representing project_location_data_store_siteSearchEngine resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDataStoreSiteSearchEngineName( + projectLocationDataStoreSiteSearchEngineName: string + ) { + return this.pathTemplates.projectLocationDataStoreSiteSearchEnginePathTemplate.match( + projectLocationDataStoreSiteSearchEngineName + ).project; + } + + /** + * Parse the location from ProjectLocationDataStoreSiteSearchEngine resource. + * + * @param {string} projectLocationDataStoreSiteSearchEngineName + * A fully-qualified path representing project_location_data_store_siteSearchEngine resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDataStoreSiteSearchEngineName( + projectLocationDataStoreSiteSearchEngineName: string + ) { + return this.pathTemplates.projectLocationDataStoreSiteSearchEnginePathTemplate.match( + projectLocationDataStoreSiteSearchEngineName + ).location; + } + + /** + * Parse the data_store from ProjectLocationDataStoreSiteSearchEngine resource. + * + * @param {string} projectLocationDataStoreSiteSearchEngineName + * A fully-qualified path representing project_location_data_store_siteSearchEngine resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationDataStoreSiteSearchEngineName( + projectLocationDataStoreSiteSearchEngineName: string + ) { + return this.pathTemplates.projectLocationDataStoreSiteSearchEnginePathTemplate.match( + projectLocationDataStoreSiteSearchEngineName + ).data_store; + } + + /** + * Return a fully-qualified projectLocationDataStoreSiteSearchEngineTargetSite resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_store + * @param {string} target_site + * @returns {string} Resource name string. + */ + projectLocationDataStoreSiteSearchEngineTargetSitePath( + project: string, + location: string, + dataStore: string, + targetSite: string + ) { + return this.pathTemplates.projectLocationDataStoreSiteSearchEngineTargetSitePathTemplate.render( + { + project: project, + location: location, + data_store: dataStore, + target_site: targetSite, + } + ); + } + + /** + * Parse the project from ProjectLocationDataStoreSiteSearchEngineTargetSite resource. + * + * @param {string} projectLocationDataStoreSiteSearchEngineTargetSiteName + * A fully-qualified path representing project_location_data_store_siteSearchEngine_target_site resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDataStoreSiteSearchEngineTargetSiteName( + projectLocationDataStoreSiteSearchEngineTargetSiteName: string + ) { + return this.pathTemplates.projectLocationDataStoreSiteSearchEngineTargetSitePathTemplate.match( + projectLocationDataStoreSiteSearchEngineTargetSiteName + ).project; + } + + /** + * Parse the location from ProjectLocationDataStoreSiteSearchEngineTargetSite resource. + * + * @param {string} projectLocationDataStoreSiteSearchEngineTargetSiteName + * A fully-qualified path representing project_location_data_store_siteSearchEngine_target_site resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDataStoreSiteSearchEngineTargetSiteName( + projectLocationDataStoreSiteSearchEngineTargetSiteName: string + ) { + return this.pathTemplates.projectLocationDataStoreSiteSearchEngineTargetSitePathTemplate.match( + projectLocationDataStoreSiteSearchEngineTargetSiteName + ).location; + } + + /** + * Parse the data_store from ProjectLocationDataStoreSiteSearchEngineTargetSite resource. + * + * @param {string} projectLocationDataStoreSiteSearchEngineTargetSiteName + * A fully-qualified path representing project_location_data_store_siteSearchEngine_target_site resource. + * @returns {string} A string representing the data_store. + */ + matchDataStoreFromProjectLocationDataStoreSiteSearchEngineTargetSiteName( + projectLocationDataStoreSiteSearchEngineTargetSiteName: string + ) { + return this.pathTemplates.projectLocationDataStoreSiteSearchEngineTargetSitePathTemplate.match( + projectLocationDataStoreSiteSearchEngineTargetSiteName + ).data_store; + } + + /** + * Parse the target_site from ProjectLocationDataStoreSiteSearchEngineTargetSite resource. + * + * @param {string} projectLocationDataStoreSiteSearchEngineTargetSiteName + * A fully-qualified path representing project_location_data_store_siteSearchEngine_target_site resource. + * @returns {string} A string representing the target_site. + */ + matchTargetSiteFromProjectLocationDataStoreSiteSearchEngineTargetSiteName( + projectLocationDataStoreSiteSearchEngineTargetSiteName: string + ) { + return this.pathTemplates.projectLocationDataStoreSiteSearchEngineTargetSitePathTemplate.match( + projectLocationDataStoreSiteSearchEngineTargetSiteName + ).target_site; + } + + /** + * Return a fully-qualified rankingConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} ranking_config + * @returns {string} Resource name string. + */ + rankingConfigPath(project: string, location: string, rankingConfig: string) { + return this.pathTemplates.rankingConfigPathTemplate.render({ + project: project, + location: location, + ranking_config: rankingConfig, + }); + } + + /** + * Parse the project from RankingConfig resource. + * + * @param {string} rankingConfigName + * A fully-qualified path representing RankingConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRankingConfigName(rankingConfigName: string) { + return this.pathTemplates.rankingConfigPathTemplate.match(rankingConfigName) + .project; + } + + /** + * Parse the location from RankingConfig resource. + * + * @param {string} rankingConfigName + * A fully-qualified path representing RankingConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRankingConfigName(rankingConfigName: string) { + return this.pathTemplates.rankingConfigPathTemplate.match(rankingConfigName) + .location; + } + + /** + * Parse the ranking_config from RankingConfig resource. + * + * @param {string} rankingConfigName + * A fully-qualified path representing RankingConfig resource. + * @returns {string} A string representing the ranking_config. + */ + matchRankingConfigFromRankingConfigName(rankingConfigName: string) { + return this.pathTemplates.rankingConfigPathTemplate.match(rankingConfigName) + .ranking_config; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.rankServiceStub && !this._terminated) { + return this.rankServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.locationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-discoveryengine/src/v1alpha/rank_service_client_config.json b/packages/google-cloud-discoveryengine/src/v1alpha/rank_service_client_config.json new file mode 100644 index 00000000000..57b47688441 --- /dev/null +++ b/packages/google-cloud-discoveryengine/src/v1alpha/rank_service_client_config.json @@ -0,0 +1,30 @@ +{ + "interfaces": { + "google.cloud.discoveryengine.v1alpha.RankService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "Rank": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-discoveryengine/src/v1alpha/rank_service_proto_list.json b/packages/google-cloud-discoveryengine/src/v1alpha/rank_service_proto_list.json new file mode 100644 index 00000000000..006edd1f929 --- /dev/null +++ b/packages/google-cloud-discoveryengine/src/v1alpha/rank_service_proto_list.json @@ -0,0 +1,33 @@ +[ + "../../protos/google/cloud/discoveryengine/v1alpha/acl_config.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/acl_config_service.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/chunk.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/chunk_service.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/common.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/completion.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/completion_service.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/conversation.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/conversational_search_service.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/data_store.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/data_store_service.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/document.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/document_processing_config.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/document_service.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/engine.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/engine_service.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/estimate_billing_service.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/import_config.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/purge_config.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/rank_service.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/recommendation_service.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/schema.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/schema_service.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/search_service.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/search_tuning_service.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/serving_config.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/serving_config_service.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/site_search_engine.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/site_search_engine_service.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/user_event.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/user_event_service.proto" +] diff --git a/packages/google-cloud-discoveryengine/src/v1alpha/recommendation_service_client.ts b/packages/google-cloud-discoveryengine/src/v1alpha/recommendation_service_client.ts index e574bc3bffb..fe703bc5a76 100644 --- a/packages/google-cloud-discoveryengine/src/v1alpha/recommendation_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1alpha/recommendation_service_client.ts @@ -121,8 +121,15 @@ export class RecommendationServiceClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'discoveryengine.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -178,7 +185,7 @@ export class RecommendationServiceClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -372,7 +379,7 @@ export class RecommendationServiceClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -390,7 +397,7 @@ export class RecommendationServiceClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( diff --git a/packages/google-cloud-discoveryengine/src/v1alpha/recommendation_service_proto_list.json b/packages/google-cloud-discoveryengine/src/v1alpha/recommendation_service_proto_list.json index 02ce2e2381b..006edd1f929 100644 --- a/packages/google-cloud-discoveryengine/src/v1alpha/recommendation_service_proto_list.json +++ b/packages/google-cloud-discoveryengine/src/v1alpha/recommendation_service_proto_list.json @@ -18,6 +18,7 @@ "../../protos/google/cloud/discoveryengine/v1alpha/estimate_billing_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/import_config.proto", "../../protos/google/cloud/discoveryengine/v1alpha/purge_config.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/rank_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/recommendation_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/schema.proto", "../../protos/google/cloud/discoveryengine/v1alpha/schema_service.proto", diff --git a/packages/google-cloud-discoveryengine/src/v1alpha/schema_service_client.ts b/packages/google-cloud-discoveryengine/src/v1alpha/schema_service_client.ts index d7fce3f31ee..9c67f3c22ee 100644 --- a/packages/google-cloud-discoveryengine/src/v1alpha/schema_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1alpha/schema_service_client.ts @@ -125,8 +125,15 @@ export class SchemaServiceClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'discoveryengine.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -182,7 +189,7 @@ export class SchemaServiceClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -348,6 +355,9 @@ export class SchemaServiceClient { { get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/operations/*}', }, + { + get: '/v1alpha/{name=projects/*/locations/*/evaluations/*/operations/*}', + }, {get: '/v1alpha/{name=projects/*/locations/*/operations/*}'}, {get: '/v1alpha/{name=projects/*/operations/*}'}, ], @@ -531,7 +541,7 @@ export class SchemaServiceClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -549,7 +559,7 @@ export class SchemaServiceClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( diff --git a/packages/google-cloud-discoveryengine/src/v1alpha/schema_service_proto_list.json b/packages/google-cloud-discoveryengine/src/v1alpha/schema_service_proto_list.json index 02ce2e2381b..006edd1f929 100644 --- a/packages/google-cloud-discoveryengine/src/v1alpha/schema_service_proto_list.json +++ b/packages/google-cloud-discoveryengine/src/v1alpha/schema_service_proto_list.json @@ -18,6 +18,7 @@ "../../protos/google/cloud/discoveryengine/v1alpha/estimate_billing_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/import_config.proto", "../../protos/google/cloud/discoveryengine/v1alpha/purge_config.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/rank_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/recommendation_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/schema.proto", "../../protos/google/cloud/discoveryengine/v1alpha/schema_service.proto", diff --git a/packages/google-cloud-discoveryengine/src/v1alpha/search_service_client.ts b/packages/google-cloud-discoveryengine/src/v1alpha/search_service_client.ts index 78a5cb2f183..9dade2c6b19 100644 --- a/packages/google-cloud-discoveryengine/src/v1alpha/search_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1alpha/search_service_client.ts @@ -122,8 +122,15 @@ export class SearchServiceClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'discoveryengine.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -179,7 +186,7 @@ export class SearchServiceClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -392,7 +399,7 @@ export class SearchServiceClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -410,7 +417,7 @@ export class SearchServiceClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -494,11 +501,15 @@ export class SearchServiceClient { * Raw image query. * @param {number} request.pageSize * Maximum number of - * {@link protos.google.cloud.discoveryengine.v1alpha.Document|Document}s to return. If - * unspecified, defaults to a reasonable value. The maximum allowed value is - * 100. Values above 100 are coerced to 100. + * {@link protos.google.cloud.discoveryengine.v1alpha.Document|Document}s to return. The + * maximum allowed value depends on the data type. Values above the maximum + * value are coerced to the maximum value. * - * If this field is negative, an `INVALID_ARGUMENT` is returned. + * * Websites with basic indexing: Default `10`, Maximum `25`. + * * Websites with advanced indexing: Default `25`, Maximum `50`. + * * Other: Default `50`, Maximum `100`. + * + * If this field is negative, an `INVALID_ARGUMENT` is returned. * @param {string} request.pageToken * A page token received from a previous * {@link protos.google.cloud.discoveryengine.v1alpha.SearchService.Search|SearchService.Search} @@ -620,7 +631,8 @@ export class SearchServiceClient { * * If * {@link protos.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector.field_path|SearchRequest.EmbeddingSpec.EmbeddingVector.field_path} - * is not provided, it will use {@link protos.|ServingConfig.EmbeddingConfig.field_path}. + * is not provided, it will use + * {@link protos.google.cloud.discoveryengine.v1alpha.ServingConfig.embedding_config|ServingConfig.EmbeddingConfig.field_path}. * @param {string} request.rankingExpression * The ranking expression controls the customized ranking on retrieval * documents. This overrides @@ -775,11 +787,15 @@ export class SearchServiceClient { * Raw image query. * @param {number} request.pageSize * Maximum number of - * {@link protos.google.cloud.discoveryengine.v1alpha.Document|Document}s to return. If - * unspecified, defaults to a reasonable value. The maximum allowed value is - * 100. Values above 100 are coerced to 100. + * {@link protos.google.cloud.discoveryengine.v1alpha.Document|Document}s to return. The + * maximum allowed value depends on the data type. Values above the maximum + * value are coerced to the maximum value. * - * If this field is negative, an `INVALID_ARGUMENT` is returned. + * * Websites with basic indexing: Default `10`, Maximum `25`. + * * Websites with advanced indexing: Default `25`, Maximum `50`. + * * Other: Default `50`, Maximum `100`. + * + * If this field is negative, an `INVALID_ARGUMENT` is returned. * @param {string} request.pageToken * A page token received from a previous * {@link protos.google.cloud.discoveryengine.v1alpha.SearchService.Search|SearchService.Search} @@ -901,7 +917,8 @@ export class SearchServiceClient { * * If * {@link protos.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector.field_path|SearchRequest.EmbeddingSpec.EmbeddingVector.field_path} - * is not provided, it will use {@link protos.|ServingConfig.EmbeddingConfig.field_path}. + * is not provided, it will use + * {@link protos.google.cloud.discoveryengine.v1alpha.ServingConfig.embedding_config|ServingConfig.EmbeddingConfig.field_path}. * @param {string} request.rankingExpression * The ranking expression controls the customized ranking on retrieval * documents. This overrides @@ -1004,11 +1021,15 @@ export class SearchServiceClient { * Raw image query. * @param {number} request.pageSize * Maximum number of - * {@link protos.google.cloud.discoveryengine.v1alpha.Document|Document}s to return. If - * unspecified, defaults to a reasonable value. The maximum allowed value is - * 100. Values above 100 are coerced to 100. + * {@link protos.google.cloud.discoveryengine.v1alpha.Document|Document}s to return. The + * maximum allowed value depends on the data type. Values above the maximum + * value are coerced to the maximum value. * - * If this field is negative, an `INVALID_ARGUMENT` is returned. + * * Websites with basic indexing: Default `10`, Maximum `25`. + * * Websites with advanced indexing: Default `25`, Maximum `50`. + * * Other: Default `50`, Maximum `100`. + * + * If this field is negative, an `INVALID_ARGUMENT` is returned. * @param {string} request.pageToken * A page token received from a previous * {@link protos.google.cloud.discoveryengine.v1alpha.SearchService.Search|SearchService.Search} @@ -1130,7 +1151,8 @@ export class SearchServiceClient { * * If * {@link protos.google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector.field_path|SearchRequest.EmbeddingSpec.EmbeddingVector.field_path} - * is not provided, it will use {@link protos.|ServingConfig.EmbeddingConfig.field_path}. + * is not provided, it will use + * {@link protos.google.cloud.discoveryengine.v1alpha.ServingConfig.embedding_config|ServingConfig.EmbeddingConfig.field_path}. * @param {string} request.rankingExpression * The ranking expression controls the customized ranking on retrieval * documents. This overrides diff --git a/packages/google-cloud-discoveryengine/src/v1alpha/search_service_proto_list.json b/packages/google-cloud-discoveryengine/src/v1alpha/search_service_proto_list.json index 02ce2e2381b..006edd1f929 100644 --- a/packages/google-cloud-discoveryengine/src/v1alpha/search_service_proto_list.json +++ b/packages/google-cloud-discoveryengine/src/v1alpha/search_service_proto_list.json @@ -18,6 +18,7 @@ "../../protos/google/cloud/discoveryengine/v1alpha/estimate_billing_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/import_config.proto", "../../protos/google/cloud/discoveryengine/v1alpha/purge_config.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/rank_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/recommendation_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/schema.proto", "../../protos/google/cloud/discoveryengine/v1alpha/schema_service.proto", diff --git a/packages/google-cloud-discoveryengine/src/v1alpha/search_tuning_service_client.ts b/packages/google-cloud-discoveryengine/src/v1alpha/search_tuning_service_client.ts index f529f5a06b3..53337eae67d 100644 --- a/packages/google-cloud-discoveryengine/src/v1alpha/search_tuning_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1alpha/search_tuning_service_client.ts @@ -123,8 +123,15 @@ export class SearchTuningServiceClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'discoveryengine.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -180,7 +187,7 @@ export class SearchTuningServiceClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -335,6 +342,9 @@ export class SearchTuningServiceClient { { get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/operations/*}', }, + { + get: '/v1alpha/{name=projects/*/locations/*/evaluations/*/operations/*}', + }, {get: '/v1alpha/{name=projects/*/locations/*/operations/*}'}, {get: '/v1alpha/{name=projects/*/operations/*}'}, ], @@ -487,7 +497,7 @@ export class SearchTuningServiceClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -505,7 +515,7 @@ export class SearchTuningServiceClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( diff --git a/packages/google-cloud-discoveryengine/src/v1alpha/search_tuning_service_proto_list.json b/packages/google-cloud-discoveryengine/src/v1alpha/search_tuning_service_proto_list.json index 02ce2e2381b..006edd1f929 100644 --- a/packages/google-cloud-discoveryengine/src/v1alpha/search_tuning_service_proto_list.json +++ b/packages/google-cloud-discoveryengine/src/v1alpha/search_tuning_service_proto_list.json @@ -18,6 +18,7 @@ "../../protos/google/cloud/discoveryengine/v1alpha/estimate_billing_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/import_config.proto", "../../protos/google/cloud/discoveryengine/v1alpha/purge_config.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/rank_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/recommendation_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/schema.proto", "../../protos/google/cloud/discoveryengine/v1alpha/schema_service.proto", diff --git a/packages/google-cloud-discoveryengine/src/v1alpha/serving_config_service_client.ts b/packages/google-cloud-discoveryengine/src/v1alpha/serving_config_service_client.ts index 2dcd153296b..4e98caf9419 100644 --- a/packages/google-cloud-discoveryengine/src/v1alpha/serving_config_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1alpha/serving_config_service_client.ts @@ -41,7 +41,8 @@ import * as gapicConfig from './serving_config_service_client_config.json'; const version = require('../../../package.json').version; /** - * Service for operations related to {@link protos.|ServingConfig}. + * Service for operations related to + * {@link protos.google.cloud.discoveryengine.v1alpha.ServingConfig|ServingConfig}. * @class * @memberof v1alpha */ @@ -122,8 +123,15 @@ export class ServingConfigServiceClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'discoveryengine.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -179,7 +187,7 @@ export class ServingConfigServiceClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -394,7 +402,7 @@ export class ServingConfigServiceClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -412,7 +420,7 @@ export class ServingConfigServiceClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( diff --git a/packages/google-cloud-discoveryengine/src/v1alpha/serving_config_service_proto_list.json b/packages/google-cloud-discoveryengine/src/v1alpha/serving_config_service_proto_list.json index 02ce2e2381b..006edd1f929 100644 --- a/packages/google-cloud-discoveryengine/src/v1alpha/serving_config_service_proto_list.json +++ b/packages/google-cloud-discoveryengine/src/v1alpha/serving_config_service_proto_list.json @@ -18,6 +18,7 @@ "../../protos/google/cloud/discoveryengine/v1alpha/estimate_billing_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/import_config.proto", "../../protos/google/cloud/discoveryengine/v1alpha/purge_config.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/rank_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/recommendation_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/schema.proto", "../../protos/google/cloud/discoveryengine/v1alpha/schema_service.proto", diff --git a/packages/google-cloud-discoveryengine/src/v1alpha/site_search_engine_service_client.ts b/packages/google-cloud-discoveryengine/src/v1alpha/site_search_engine_service_client.ts index 0d3a6e17ae4..99ff850ef6c 100644 --- a/packages/google-cloud-discoveryengine/src/v1alpha/site_search_engine_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1alpha/site_search_engine_service_client.ts @@ -126,8 +126,15 @@ export class SiteSearchEngineServiceClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'discoveryengine.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -183,7 +190,7 @@ export class SiteSearchEngineServiceClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -354,6 +361,9 @@ export class SiteSearchEngineServiceClient { { get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/operations/*}', }, + { + get: '/v1alpha/{name=projects/*/locations/*/evaluations/*/operations/*}', + }, {get: '/v1alpha/{name=projects/*/locations/*/operations/*}'}, {get: '/v1alpha/{name=projects/*/operations/*}'}, ], @@ -615,7 +625,7 @@ export class SiteSearchEngineServiceClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -633,7 +643,7 @@ export class SiteSearchEngineServiceClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( diff --git a/packages/google-cloud-discoveryengine/src/v1alpha/site_search_engine_service_proto_list.json b/packages/google-cloud-discoveryengine/src/v1alpha/site_search_engine_service_proto_list.json index 02ce2e2381b..006edd1f929 100644 --- a/packages/google-cloud-discoveryengine/src/v1alpha/site_search_engine_service_proto_list.json +++ b/packages/google-cloud-discoveryengine/src/v1alpha/site_search_engine_service_proto_list.json @@ -18,6 +18,7 @@ "../../protos/google/cloud/discoveryengine/v1alpha/estimate_billing_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/import_config.proto", "../../protos/google/cloud/discoveryengine/v1alpha/purge_config.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/rank_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/recommendation_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/schema.proto", "../../protos/google/cloud/discoveryengine/v1alpha/schema_service.proto", diff --git a/packages/google-cloud-discoveryengine/src/v1alpha/user_event_service_client.ts b/packages/google-cloud-discoveryengine/src/v1alpha/user_event_service_client.ts index 5c53cd7c953..415e162016e 100644 --- a/packages/google-cloud-discoveryengine/src/v1alpha/user_event_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1alpha/user_event_service_client.ts @@ -123,8 +123,15 @@ export class UserEventServiceClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'discoveryengine.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -180,7 +187,7 @@ export class UserEventServiceClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -335,6 +342,9 @@ export class UserEventServiceClient { { get: '/v1alpha/{name=projects/*/locations/*/dataStores/*/operations/*}', }, + { + get: '/v1alpha/{name=projects/*/locations/*/evaluations/*/operations/*}', + }, {get: '/v1alpha/{name=projects/*/locations/*/operations/*}'}, {get: '/v1alpha/{name=projects/*/operations/*}'}, ], @@ -503,7 +513,7 @@ export class UserEventServiceClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -521,7 +531,7 @@ export class UserEventServiceClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( diff --git a/packages/google-cloud-discoveryengine/src/v1alpha/user_event_service_proto_list.json b/packages/google-cloud-discoveryengine/src/v1alpha/user_event_service_proto_list.json index 02ce2e2381b..006edd1f929 100644 --- a/packages/google-cloud-discoveryengine/src/v1alpha/user_event_service_proto_list.json +++ b/packages/google-cloud-discoveryengine/src/v1alpha/user_event_service_proto_list.json @@ -18,6 +18,7 @@ "../../protos/google/cloud/discoveryengine/v1alpha/estimate_billing_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/import_config.proto", "../../protos/google/cloud/discoveryengine/v1alpha/purge_config.proto", + "../../protos/google/cloud/discoveryengine/v1alpha/rank_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/recommendation_service.proto", "../../protos/google/cloud/discoveryengine/v1alpha/schema.proto", "../../protos/google/cloud/discoveryengine/v1alpha/schema_service.proto", diff --git a/packages/google-cloud-discoveryengine/src/v1beta/completion_service_client.ts b/packages/google-cloud-discoveryengine/src/v1beta/completion_service_client.ts index ed153903805..abd97395207 100644 --- a/packages/google-cloud-discoveryengine/src/v1beta/completion_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1beta/completion_service_client.ts @@ -123,8 +123,15 @@ export class CompletionServiceClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'discoveryengine.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -180,7 +187,7 @@ export class CompletionServiceClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -500,7 +507,7 @@ export class CompletionServiceClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -518,7 +525,7 @@ export class CompletionServiceClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( diff --git a/packages/google-cloud-discoveryengine/src/v1beta/conversational_search_service_client.ts b/packages/google-cloud-discoveryengine/src/v1beta/conversational_search_service_client.ts index a08308e9d58..a8f1cc7269f 100644 --- a/packages/google-cloud-discoveryengine/src/v1beta/conversational_search_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1beta/conversational_search_service_client.ts @@ -123,8 +123,15 @@ export class ConversationalSearchServiceClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'discoveryengine.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -180,7 +187,7 @@ export class ConversationalSearchServiceClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -381,7 +388,7 @@ export class ConversationalSearchServiceClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -399,7 +406,7 @@ export class ConversationalSearchServiceClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( diff --git a/packages/google-cloud-discoveryengine/src/v1beta/data_store_service_client.ts b/packages/google-cloud-discoveryengine/src/v1beta/data_store_service_client.ts index 740581cebf9..bd7fd5dc5c0 100644 --- a/packages/google-cloud-discoveryengine/src/v1beta/data_store_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1beta/data_store_service_client.ts @@ -126,8 +126,15 @@ export class DataStoreServiceClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'discoveryengine.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -183,7 +190,7 @@ export class DataStoreServiceClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -513,7 +520,7 @@ export class DataStoreServiceClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -531,7 +538,7 @@ export class DataStoreServiceClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( diff --git a/packages/google-cloud-discoveryengine/src/v1beta/document_service_client.ts b/packages/google-cloud-discoveryengine/src/v1beta/document_service_client.ts index eaaca328706..cb12b120959 100644 --- a/packages/google-cloud-discoveryengine/src/v1beta/document_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1beta/document_service_client.ts @@ -127,8 +127,15 @@ export class DocumentServiceClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'discoveryengine.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -184,7 +191,7 @@ export class DocumentServiceClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -521,7 +528,7 @@ export class DocumentServiceClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -539,7 +546,7 @@ export class DocumentServiceClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( diff --git a/packages/google-cloud-discoveryengine/src/v1beta/engine_service_client.ts b/packages/google-cloud-discoveryengine/src/v1beta/engine_service_client.ts index 5508405c726..7b534c20d8b 100644 --- a/packages/google-cloud-discoveryengine/src/v1beta/engine_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1beta/engine_service_client.ts @@ -126,8 +126,15 @@ export class EngineServiceClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'discoveryengine.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -183,7 +190,7 @@ export class EngineServiceClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -513,7 +520,7 @@ export class EngineServiceClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -531,7 +538,7 @@ export class EngineServiceClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( diff --git a/packages/google-cloud-discoveryengine/src/v1beta/recommendation_service_client.ts b/packages/google-cloud-discoveryengine/src/v1beta/recommendation_service_client.ts index aa19eab04a2..2bcc1515e63 100644 --- a/packages/google-cloud-discoveryengine/src/v1beta/recommendation_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1beta/recommendation_service_client.ts @@ -121,8 +121,15 @@ export class RecommendationServiceClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'discoveryengine.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -178,7 +185,7 @@ export class RecommendationServiceClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -361,7 +368,7 @@ export class RecommendationServiceClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -379,7 +386,7 @@ export class RecommendationServiceClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( diff --git a/packages/google-cloud-discoveryengine/src/v1beta/schema_service_client.ts b/packages/google-cloud-discoveryengine/src/v1beta/schema_service_client.ts index b94d744d239..0f3cea228f5 100644 --- a/packages/google-cloud-discoveryengine/src/v1beta/schema_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1beta/schema_service_client.ts @@ -125,8 +125,15 @@ export class SchemaServiceClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'discoveryengine.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -182,7 +189,7 @@ export class SchemaServiceClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -520,7 +527,7 @@ export class SchemaServiceClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -538,7 +545,7 @@ export class SchemaServiceClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( diff --git a/packages/google-cloud-discoveryengine/src/v1beta/search_service_client.ts b/packages/google-cloud-discoveryengine/src/v1beta/search_service_client.ts index db8947800c8..c4f667ac976 100644 --- a/packages/google-cloud-discoveryengine/src/v1beta/search_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1beta/search_service_client.ts @@ -122,8 +122,15 @@ export class SearchServiceClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'discoveryengine.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -179,7 +186,7 @@ export class SearchServiceClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -381,7 +388,7 @@ export class SearchServiceClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -399,7 +406,7 @@ export class SearchServiceClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( diff --git a/packages/google-cloud-discoveryengine/src/v1beta/search_tuning_service_client.ts b/packages/google-cloud-discoveryengine/src/v1beta/search_tuning_service_client.ts index f999b35dbfb..6c29311c458 100644 --- a/packages/google-cloud-discoveryengine/src/v1beta/search_tuning_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1beta/search_tuning_service_client.ts @@ -123,8 +123,15 @@ export class SearchTuningServiceClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'discoveryengine.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -180,7 +187,7 @@ export class SearchTuningServiceClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -476,7 +483,7 @@ export class SearchTuningServiceClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -494,7 +501,7 @@ export class SearchTuningServiceClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( diff --git a/packages/google-cloud-discoveryengine/src/v1beta/serving_config_service_client.ts b/packages/google-cloud-discoveryengine/src/v1beta/serving_config_service_client.ts index 1ca83d5dbfd..cfdf43ed5fa 100644 --- a/packages/google-cloud-discoveryengine/src/v1beta/serving_config_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1beta/serving_config_service_client.ts @@ -123,8 +123,15 @@ export class ServingConfigServiceClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'discoveryengine.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -180,7 +187,7 @@ export class ServingConfigServiceClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -384,7 +391,7 @@ export class ServingConfigServiceClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -402,7 +409,7 @@ export class ServingConfigServiceClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( diff --git a/packages/google-cloud-discoveryengine/src/v1beta/site_search_engine_service_client.ts b/packages/google-cloud-discoveryengine/src/v1beta/site_search_engine_service_client.ts index c899051b721..24d5c2088a4 100644 --- a/packages/google-cloud-discoveryengine/src/v1beta/site_search_engine_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1beta/site_search_engine_service_client.ts @@ -126,8 +126,15 @@ export class SiteSearchEngineServiceClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'discoveryengine.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -183,7 +190,7 @@ export class SiteSearchEngineServiceClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -604,7 +611,7 @@ export class SiteSearchEngineServiceClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -622,7 +629,7 @@ export class SiteSearchEngineServiceClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( diff --git a/packages/google-cloud-discoveryengine/src/v1beta/user_event_service_client.ts b/packages/google-cloud-discoveryengine/src/v1beta/user_event_service_client.ts index e83af3e3f84..06c2a02d2d9 100644 --- a/packages/google-cloud-discoveryengine/src/v1beta/user_event_service_client.ts +++ b/packages/google-cloud-discoveryengine/src/v1beta/user_event_service_client.ts @@ -123,8 +123,15 @@ export class UserEventServiceClient { 'Please set either universe_domain or universeDomain, but not both.' ); } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; this._universeDomain = - opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com'; + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'discoveryengine.' + this._universeDomain; const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; @@ -180,7 +187,7 @@ export class UserEventServiceClient { // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process !== 'undefined' && 'versions' in process) { + if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); @@ -480,7 +487,7 @@ export class UserEventServiceClient { */ static get servicePath() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( @@ -498,7 +505,7 @@ export class UserEventServiceClient { */ static get apiEndpoint() { if ( - typeof process !== undefined && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { process.emitWarning( diff --git a/packages/google-cloud-discoveryengine/test/gapic_acl_config_service_v1alpha.ts b/packages/google-cloud-discoveryengine/test/gapic_acl_config_service_v1alpha.ts index 2a3615a921f..395b60e5108 100644 --- a/packages/google-cloud-discoveryengine/test/gapic_acl_config_service_v1alpha.ts +++ b/packages/google-cloud-discoveryengine/test/gapic_acl_config_service_v1alpha.ts @@ -104,7 +104,7 @@ describe('v1alpha.AclConfigServiceClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -140,6 +140,43 @@ describe('v1alpha.AclConfigServiceClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'discoveryengine.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new aclconfigserviceModule.v1alpha.AclConfigServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'discoveryengine.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new aclconfigserviceModule.v1alpha.AclConfigServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'discoveryengine.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new aclconfigserviceModule.v1alpha.AclConfigServiceClient({ diff --git a/packages/google-cloud-discoveryengine/test/gapic_chunk_service_v1alpha.ts b/packages/google-cloud-discoveryengine/test/gapic_chunk_service_v1alpha.ts index 38deebb52a5..b000f28d0c0 100644 --- a/packages/google-cloud-discoveryengine/test/gapic_chunk_service_v1alpha.ts +++ b/packages/google-cloud-discoveryengine/test/gapic_chunk_service_v1alpha.ts @@ -142,7 +142,7 @@ describe('v1alpha.ChunkServiceClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -178,6 +178,41 @@ describe('v1alpha.ChunkServiceClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'discoveryengine.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new chunkserviceModule.v1alpha.ChunkServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'discoveryengine.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new chunkserviceModule.v1alpha.ChunkServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'discoveryengine.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new chunkserviceModule.v1alpha.ChunkServiceClient({ diff --git a/packages/google-cloud-discoveryengine/test/gapic_completion_service_v1.ts b/packages/google-cloud-discoveryengine/test/gapic_completion_service_v1.ts index 7e53cc8a646..3dabf27ccc1 100644 --- a/packages/google-cloud-discoveryengine/test/gapic_completion_service_v1.ts +++ b/packages/google-cloud-discoveryengine/test/gapic_completion_service_v1.ts @@ -139,7 +139,7 @@ describe('v1.CompletionServiceClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -175,6 +175,42 @@ describe('v1.CompletionServiceClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'discoveryengine.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new completionserviceModule.v1.CompletionServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'discoveryengine.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new completionserviceModule.v1.CompletionServiceClient( + {universeDomain: 'configured.example.com'} + ); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'discoveryengine.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new completionserviceModule.v1.CompletionServiceClient({ diff --git a/packages/google-cloud-discoveryengine/test/gapic_completion_service_v1alpha.ts b/packages/google-cloud-discoveryengine/test/gapic_completion_service_v1alpha.ts index 3daab768330..2d2e7b38c72 100644 --- a/packages/google-cloud-discoveryengine/test/gapic_completion_service_v1alpha.ts +++ b/packages/google-cloud-discoveryengine/test/gapic_completion_service_v1alpha.ts @@ -141,7 +141,7 @@ describe('v1alpha.CompletionServiceClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -179,6 +179,43 @@ describe('v1alpha.CompletionServiceClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'discoveryengine.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new completionserviceModule.v1alpha.CompletionServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'discoveryengine.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new completionserviceModule.v1alpha.CompletionServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'discoveryengine.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new completionserviceModule.v1alpha.CompletionServiceClient({ diff --git a/packages/google-cloud-discoveryengine/test/gapic_completion_service_v1beta.ts b/packages/google-cloud-discoveryengine/test/gapic_completion_service_v1beta.ts index fb78abf79e1..18042d140ae 100644 --- a/packages/google-cloud-discoveryengine/test/gapic_completion_service_v1beta.ts +++ b/packages/google-cloud-discoveryengine/test/gapic_completion_service_v1beta.ts @@ -141,7 +141,7 @@ describe('v1beta.CompletionServiceClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -177,6 +177,43 @@ describe('v1beta.CompletionServiceClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'discoveryengine.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new completionserviceModule.v1beta.CompletionServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'discoveryengine.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new completionserviceModule.v1beta.CompletionServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'discoveryengine.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new completionserviceModule.v1beta.CompletionServiceClient({ diff --git a/packages/google-cloud-discoveryengine/test/gapic_conversational_search_service_v1.ts b/packages/google-cloud-discoveryengine/test/gapic_conversational_search_service_v1.ts index 7435a03a9d1..32deb0cbe24 100644 --- a/packages/google-cloud-discoveryengine/test/gapic_conversational_search_service_v1.ts +++ b/packages/google-cloud-discoveryengine/test/gapic_conversational_search_service_v1.ts @@ -144,7 +144,7 @@ describe('v1.ConversationalSearchServiceClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -184,6 +184,43 @@ describe('v1.ConversationalSearchServiceClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'discoveryengine.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new conversationalsearchserviceModule.v1.ConversationalSearchServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'discoveryengine.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new conversationalsearchserviceModule.v1.ConversationalSearchServiceClient( + {universeDomain: 'configured.example.com'} + ); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'discoveryengine.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new conversationalsearchserviceModule.v1.ConversationalSearchServiceClient( diff --git a/packages/google-cloud-discoveryengine/test/gapic_conversational_search_service_v1alpha.ts b/packages/google-cloud-discoveryengine/test/gapic_conversational_search_service_v1alpha.ts index b7d8fd527f0..239a751fca6 100644 --- a/packages/google-cloud-discoveryengine/test/gapic_conversational_search_service_v1alpha.ts +++ b/packages/google-cloud-discoveryengine/test/gapic_conversational_search_service_v1alpha.ts @@ -144,7 +144,7 @@ describe('v1alpha.ConversationalSearchServiceClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -184,6 +184,43 @@ describe('v1alpha.ConversationalSearchServiceClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'discoveryengine.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new conversationalsearchserviceModule.v1alpha.ConversationalSearchServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'discoveryengine.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new conversationalsearchserviceModule.v1alpha.ConversationalSearchServiceClient( + {universeDomain: 'configured.example.com'} + ); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'discoveryengine.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new conversationalsearchserviceModule.v1alpha.ConversationalSearchServiceClient( diff --git a/packages/google-cloud-discoveryengine/test/gapic_conversational_search_service_v1beta.ts b/packages/google-cloud-discoveryengine/test/gapic_conversational_search_service_v1beta.ts index 1ab2e918e43..be92c4e2b18 100644 --- a/packages/google-cloud-discoveryengine/test/gapic_conversational_search_service_v1beta.ts +++ b/packages/google-cloud-discoveryengine/test/gapic_conversational_search_service_v1beta.ts @@ -144,7 +144,7 @@ describe('v1beta.ConversationalSearchServiceClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -184,6 +184,43 @@ describe('v1beta.ConversationalSearchServiceClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'discoveryengine.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new conversationalsearchserviceModule.v1beta.ConversationalSearchServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'discoveryengine.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new conversationalsearchserviceModule.v1beta.ConversationalSearchServiceClient( + {universeDomain: 'configured.example.com'} + ); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'discoveryengine.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new conversationalsearchserviceModule.v1beta.ConversationalSearchServiceClient( diff --git a/packages/google-cloud-discoveryengine/test/gapic_data_store_service_v1.ts b/packages/google-cloud-discoveryengine/test/gapic_data_store_service_v1.ts index 4b8f3119de1..44d0beb997a 100644 --- a/packages/google-cloud-discoveryengine/test/gapic_data_store_service_v1.ts +++ b/packages/google-cloud-discoveryengine/test/gapic_data_store_service_v1.ts @@ -179,7 +179,7 @@ describe('v1.DataStoreServiceClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -215,6 +215,41 @@ describe('v1.DataStoreServiceClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'discoveryengine.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new datastoreserviceModule.v1.DataStoreServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'discoveryengine.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new datastoreserviceModule.v1.DataStoreServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'discoveryengine.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new datastoreserviceModule.v1.DataStoreServiceClient({ diff --git a/packages/google-cloud-discoveryengine/test/gapic_data_store_service_v1alpha.ts b/packages/google-cloud-discoveryengine/test/gapic_data_store_service_v1alpha.ts index b04dad9aedf..66fec313744 100644 --- a/packages/google-cloud-discoveryengine/test/gapic_data_store_service_v1alpha.ts +++ b/packages/google-cloud-discoveryengine/test/gapic_data_store_service_v1alpha.ts @@ -181,7 +181,7 @@ describe('v1alpha.DataStoreServiceClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -217,6 +217,43 @@ describe('v1alpha.DataStoreServiceClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'discoveryengine.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new datastoreserviceModule.v1alpha.DataStoreServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'discoveryengine.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new datastoreserviceModule.v1alpha.DataStoreServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'discoveryengine.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new datastoreserviceModule.v1alpha.DataStoreServiceClient({ diff --git a/packages/google-cloud-discoveryengine/test/gapic_data_store_service_v1beta.ts b/packages/google-cloud-discoveryengine/test/gapic_data_store_service_v1beta.ts index ebf76a25ca7..5a02f72df9e 100644 --- a/packages/google-cloud-discoveryengine/test/gapic_data_store_service_v1beta.ts +++ b/packages/google-cloud-discoveryengine/test/gapic_data_store_service_v1beta.ts @@ -179,7 +179,7 @@ describe('v1beta.DataStoreServiceClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -215,6 +215,43 @@ describe('v1beta.DataStoreServiceClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'discoveryengine.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new datastoreserviceModule.v1beta.DataStoreServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'discoveryengine.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new datastoreserviceModule.v1beta.DataStoreServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'discoveryengine.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new datastoreserviceModule.v1beta.DataStoreServiceClient({ diff --git a/packages/google-cloud-discoveryengine/test/gapic_document_service_v1.ts b/packages/google-cloud-discoveryengine/test/gapic_document_service_v1.ts index 7a59ea1859d..458dc78effa 100644 --- a/packages/google-cloud-discoveryengine/test/gapic_document_service_v1.ts +++ b/packages/google-cloud-discoveryengine/test/gapic_document_service_v1.ts @@ -179,7 +179,7 @@ describe('v1.DocumentServiceClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -215,6 +215,41 @@ describe('v1.DocumentServiceClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'discoveryengine.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new documentserviceModule.v1.DocumentServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'discoveryengine.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new documentserviceModule.v1.DocumentServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'discoveryengine.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new documentserviceModule.v1.DocumentServiceClient({ diff --git a/packages/google-cloud-discoveryengine/test/gapic_document_service_v1alpha.ts b/packages/google-cloud-discoveryengine/test/gapic_document_service_v1alpha.ts index 60c2dc53146..71600c9eef8 100644 --- a/packages/google-cloud-discoveryengine/test/gapic_document_service_v1alpha.ts +++ b/packages/google-cloud-discoveryengine/test/gapic_document_service_v1alpha.ts @@ -179,7 +179,7 @@ describe('v1alpha.DocumentServiceClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -215,6 +215,43 @@ describe('v1alpha.DocumentServiceClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'discoveryengine.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new documentserviceModule.v1alpha.DocumentServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'discoveryengine.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new documentserviceModule.v1alpha.DocumentServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'discoveryengine.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new documentserviceModule.v1alpha.DocumentServiceClient({ @@ -834,6 +871,137 @@ describe('v1alpha.DocumentServiceClient', () => { }); }); + describe('getProcessedDocument', () => { + it('invokes getProcessedDocument without error', async () => { + const client = new documentserviceModule.v1alpha.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1alpha.ProcessedDocument() + ); + client.innerApiCalls.getProcessedDocument = + stubSimpleCall(expectedResponse); + const [response] = await client.getProcessedDocument(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getProcessedDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getProcessedDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProcessedDocument without error using callback', async () => { + const client = new documentserviceModule.v1alpha.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1alpha.ProcessedDocument() + ); + client.innerApiCalls.getProcessedDocument = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getProcessedDocument( + request, + ( + err?: Error | null, + result?: protos.google.cloud.discoveryengine.v1alpha.IProcessedDocument | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getProcessedDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getProcessedDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProcessedDocument with error', async () => { + const client = new documentserviceModule.v1alpha.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getProcessedDocument = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getProcessedDocument(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getProcessedDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getProcessedDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProcessedDocument with closed client', async () => { + const client = new documentserviceModule.v1alpha.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1alpha.GetProcessedDocumentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getProcessedDocument(request), expectedError); + }); + }); + describe('importDocuments', () => { it('invokes importDocuments without error', async () => { const client = new documentserviceModule.v1alpha.DocumentServiceClient({ diff --git a/packages/google-cloud-discoveryengine/test/gapic_document_service_v1beta.ts b/packages/google-cloud-discoveryengine/test/gapic_document_service_v1beta.ts index 9fef599f846..7c3572ba65a 100644 --- a/packages/google-cloud-discoveryengine/test/gapic_document_service_v1beta.ts +++ b/packages/google-cloud-discoveryengine/test/gapic_document_service_v1beta.ts @@ -179,7 +179,7 @@ describe('v1beta.DocumentServiceClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -215,6 +215,42 @@ describe('v1beta.DocumentServiceClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'discoveryengine.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new documentserviceModule.v1beta.DocumentServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'discoveryengine.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new documentserviceModule.v1beta.DocumentServiceClient( + {universeDomain: 'configured.example.com'} + ); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'discoveryengine.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new documentserviceModule.v1beta.DocumentServiceClient({ diff --git a/packages/google-cloud-discoveryengine/test/gapic_engine_service_v1.ts b/packages/google-cloud-discoveryengine/test/gapic_engine_service_v1.ts index ad8db8c8780..e2c409989db 100644 --- a/packages/google-cloud-discoveryengine/test/gapic_engine_service_v1.ts +++ b/packages/google-cloud-discoveryengine/test/gapic_engine_service_v1.ts @@ -179,7 +179,7 @@ describe('v1.EngineServiceClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -215,6 +215,41 @@ describe('v1.EngineServiceClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'discoveryengine.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new engineserviceModule.v1.EngineServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'discoveryengine.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new engineserviceModule.v1.EngineServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'discoveryengine.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new engineserviceModule.v1.EngineServiceClient({ diff --git a/packages/google-cloud-discoveryengine/test/gapic_engine_service_v1alpha.ts b/packages/google-cloud-discoveryengine/test/gapic_engine_service_v1alpha.ts index 2e84aacd38c..c3c9554b168 100644 --- a/packages/google-cloud-discoveryengine/test/gapic_engine_service_v1alpha.ts +++ b/packages/google-cloud-discoveryengine/test/gapic_engine_service_v1alpha.ts @@ -179,7 +179,7 @@ describe('v1alpha.EngineServiceClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -215,6 +215,41 @@ describe('v1alpha.EngineServiceClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'discoveryengine.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new engineserviceModule.v1alpha.EngineServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'discoveryengine.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new engineserviceModule.v1alpha.EngineServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'discoveryengine.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new engineserviceModule.v1alpha.EngineServiceClient({ diff --git a/packages/google-cloud-discoveryengine/test/gapic_engine_service_v1beta.ts b/packages/google-cloud-discoveryengine/test/gapic_engine_service_v1beta.ts index c581347fefd..ef26186f3f4 100644 --- a/packages/google-cloud-discoveryengine/test/gapic_engine_service_v1beta.ts +++ b/packages/google-cloud-discoveryengine/test/gapic_engine_service_v1beta.ts @@ -179,7 +179,7 @@ describe('v1beta.EngineServiceClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -215,6 +215,41 @@ describe('v1beta.EngineServiceClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'discoveryengine.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new engineserviceModule.v1beta.EngineServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'discoveryengine.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new engineserviceModule.v1beta.EngineServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'discoveryengine.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new engineserviceModule.v1beta.EngineServiceClient({ diff --git a/packages/google-cloud-discoveryengine/test/gapic_estimate_billing_service_v1alpha.ts b/packages/google-cloud-discoveryengine/test/gapic_estimate_billing_service_v1alpha.ts index 78a5c141ff3..f2822b0561e 100644 --- a/packages/google-cloud-discoveryengine/test/gapic_estimate_billing_service_v1alpha.ts +++ b/packages/google-cloud-discoveryengine/test/gapic_estimate_billing_service_v1alpha.ts @@ -132,7 +132,7 @@ describe('v1alpha.EstimateBillingServiceClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -172,6 +172,43 @@ describe('v1alpha.EstimateBillingServiceClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'discoveryengine.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new estimatebillingserviceModule.v1alpha.EstimateBillingServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'discoveryengine.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new estimatebillingserviceModule.v1alpha.EstimateBillingServiceClient( + {universeDomain: 'configured.example.com'} + ); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'discoveryengine.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new estimatebillingserviceModule.v1alpha.EstimateBillingServiceClient({ diff --git a/packages/google-cloud-discoveryengine/test/gapic_rank_service_v1alpha.ts b/packages/google-cloud-discoveryengine/test/gapic_rank_service_v1alpha.ts new file mode 100644 index 00000000000..4f9a0675d4a --- /dev/null +++ b/packages/google-cloud-discoveryengine/test/gapic_rank_service_v1alpha.ts @@ -0,0 +1,3108 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as rankserviceModule from '../src'; + +import {protobuf, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1alpha.RankServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new rankserviceModule.v1alpha.RankServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'discoveryengine.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new rankserviceModule.v1alpha.RankServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + rankserviceModule.v1alpha.RankServiceClient.servicePath; + assert.strictEqual(servicePath, 'discoveryengine.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + rankserviceModule.v1alpha.RankServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'discoveryengine.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new rankserviceModule.v1alpha.RankServiceClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'discoveryengine.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new rankserviceModule.v1alpha.RankServiceClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'discoveryengine.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new rankserviceModule.v1alpha.RankServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'discoveryengine.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new rankserviceModule.v1alpha.RankServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'discoveryengine.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new rankserviceModule.v1alpha.RankServiceClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = rankserviceModule.v1alpha.RankServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new rankserviceModule.v1alpha.RankServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new rankserviceModule.v1alpha.RankServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new rankserviceModule.v1alpha.RankServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.rankServiceStub, undefined); + await client.initialize(); + assert(client.rankServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new rankserviceModule.v1alpha.RankServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.rankServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new rankserviceModule.v1alpha.RankServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.rankServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new rankserviceModule.v1alpha.RankServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new rankserviceModule.v1alpha.RankServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('rank', () => { + it('invokes rank without error', async () => { + const client = new rankserviceModule.v1alpha.RankServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1alpha.RankRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1alpha.RankRequest', + ['rankingConfig'] + ); + request.rankingConfig = defaultValue1; + const expectedHeaderRequestParams = `ranking_config=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1alpha.RankResponse() + ); + client.innerApiCalls.rank = stubSimpleCall(expectedResponse); + const [response] = await client.rank(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.rank as SinonStub).getCall(0) + .args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rank as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rank without error using callback', async () => { + const client = new rankserviceModule.v1alpha.RankServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1alpha.RankRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1alpha.RankRequest', + ['rankingConfig'] + ); + request.rankingConfig = defaultValue1; + const expectedHeaderRequestParams = `ranking_config=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1alpha.RankResponse() + ); + client.innerApiCalls.rank = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.rank( + request, + ( + err?: Error | null, + result?: protos.google.cloud.discoveryengine.v1alpha.IRankResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.rank as SinonStub).getCall(0) + .args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rank as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rank with error', async () => { + const client = new rankserviceModule.v1alpha.RankServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1alpha.RankRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1alpha.RankRequest', + ['rankingConfig'] + ); + request.rankingConfig = defaultValue1; + const expectedHeaderRequestParams = `ranking_config=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.rank = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.rank(request), expectedError); + const actualRequest = (client.innerApiCalls.rank as SinonStub).getCall(0) + .args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rank as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rank with closed client', async () => { + const client = new rankserviceModule.v1alpha.RankServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.discoveryengine.v1alpha.RankRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.discoveryengine.v1alpha.RankRequest', + ['rankingConfig'] + ); + request.rankingConfig = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.rank(request), expectedError); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new rankserviceModule.v1alpha.RankServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new rankserviceModule.v1alpha.RankServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new rankserviceModule.v1alpha.RankServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new rankserviceModule.v1alpha.RankServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new rankserviceModule.v1alpha.RankServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('aclConfig', () => { + const fakePath = '/rendered/path/aclConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new rankserviceModule.v1alpha.RankServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.aclConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.aclConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('aclConfigPath', () => { + const result = client.aclConfigPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.aclConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAclConfigName', () => { + const result = client.matchProjectFromAclConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.aclConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAclConfigName', () => { + const result = client.matchLocationFromAclConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.aclConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('engine', () => { + const fakePath = '/rendered/path/engine'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + collection: 'collectionValue', + engine: 'engineValue', + }; + const client = new rankserviceModule.v1alpha.RankServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.enginePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.enginePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('enginePath', () => { + const result = client.enginePath( + 'projectValue', + 'locationValue', + 'collectionValue', + 'engineValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.enginePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEngineName', () => { + const result = client.matchProjectFromEngineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.enginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromEngineName', () => { + const result = client.matchLocationFromEngineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.enginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCollectionFromEngineName', () => { + const result = client.matchCollectionFromEngineName(fakePath); + assert.strictEqual(result, 'collectionValue'); + assert( + (client.pathTemplates.enginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEngineFromEngineName', () => { + const result = client.matchEngineFromEngineName(fakePath); + assert.strictEqual(result, 'engineValue'); + assert( + (client.pathTemplates.enginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationCollectionDataStore', () => { + const fakePath = '/rendered/path/projectLocationCollectionDataStore'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + collection: 'collectionValue', + data_store: 'dataStoreValue', + }; + const client = new rankserviceModule.v1alpha.RankServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationCollectionDataStorePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationCollectionDataStorePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationCollectionDataStorePath', () => { + const result = client.projectLocationCollectionDataStorePath( + 'projectValue', + 'locationValue', + 'collectionValue', + 'dataStoreValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationCollectionDataStorePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationCollectionDataStoreName', () => { + const result = + client.matchProjectFromProjectLocationCollectionDataStoreName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationCollectionDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationCollectionDataStoreName', () => { + const result = + client.matchLocationFromProjectLocationCollectionDataStoreName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationCollectionDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCollectionFromProjectLocationCollectionDataStoreName', () => { + const result = + client.matchCollectionFromProjectLocationCollectionDataStoreName( + fakePath + ); + assert.strictEqual(result, 'collectionValue'); + assert( + ( + client.pathTemplates.projectLocationCollectionDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationCollectionDataStoreName', () => { + const result = + client.matchDataStoreFromProjectLocationCollectionDataStoreName( + fakePath + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates.projectLocationCollectionDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationCollectionDataStoreBranchDocument', () => { + const fakePath = + '/rendered/path/projectLocationCollectionDataStoreBranchDocument'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + collection: 'collectionValue', + data_store: 'dataStoreValue', + branch: 'branchValue', + document: 'documentValue', + }; + const client = new rankserviceModule.v1alpha.RankServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationCollectionDataStoreBranchDocumentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationCollectionDataStoreBranchDocumentPath', () => { + const result = + client.projectLocationCollectionDataStoreBranchDocumentPath( + 'projectValue', + 'locationValue', + 'collectionValue', + 'dataStoreValue', + 'branchValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationCollectionDataStoreBranchDocumentName', () => { + const result = + client.matchProjectFromProjectLocationCollectionDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationCollectionDataStoreBranchDocumentName', () => { + const result = + client.matchLocationFromProjectLocationCollectionDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCollectionFromProjectLocationCollectionDataStoreBranchDocumentName', () => { + const result = + client.matchCollectionFromProjectLocationCollectionDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'collectionValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationCollectionDataStoreBranchDocumentName', () => { + const result = + client.matchDataStoreFromProjectLocationCollectionDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBranchFromProjectLocationCollectionDataStoreBranchDocumentName', () => { + const result = + client.matchBranchFromProjectLocationCollectionDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'branchValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectLocationCollectionDataStoreBranchDocumentName', () => { + const result = + client.matchDocumentFromProjectLocationCollectionDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationCollectionDataStoreBranchDocumentChunk', () => { + const fakePath = + '/rendered/path/projectLocationCollectionDataStoreBranchDocumentChunk'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + collection: 'collectionValue', + data_store: 'dataStoreValue', + branch: 'branchValue', + document: 'documentValue', + chunk: 'chunkValue', + }; + const client = new rankserviceModule.v1alpha.RankServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationCollectionDataStoreBranchDocumentChunkPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationCollectionDataStoreBranchDocumentChunkPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationCollectionDataStoreBranchDocumentChunkPath', () => { + const result = + client.projectLocationCollectionDataStoreBranchDocumentChunkPath( + 'projectValue', + 'locationValue', + 'collectionValue', + 'dataStoreValue', + 'branchValue', + 'documentValue', + 'chunkValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentChunkPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationCollectionDataStoreBranchDocumentChunkName', () => { + const result = + client.matchProjectFromProjectLocationCollectionDataStoreBranchDocumentChunkName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentChunkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationCollectionDataStoreBranchDocumentChunkName', () => { + const result = + client.matchLocationFromProjectLocationCollectionDataStoreBranchDocumentChunkName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentChunkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCollectionFromProjectLocationCollectionDataStoreBranchDocumentChunkName', () => { + const result = + client.matchCollectionFromProjectLocationCollectionDataStoreBranchDocumentChunkName( + fakePath + ); + assert.strictEqual(result, 'collectionValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentChunkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationCollectionDataStoreBranchDocumentChunkName', () => { + const result = + client.matchDataStoreFromProjectLocationCollectionDataStoreBranchDocumentChunkName( + fakePath + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentChunkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBranchFromProjectLocationCollectionDataStoreBranchDocumentChunkName', () => { + const result = + client.matchBranchFromProjectLocationCollectionDataStoreBranchDocumentChunkName( + fakePath + ); + assert.strictEqual(result, 'branchValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentChunkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectLocationCollectionDataStoreBranchDocumentChunkName', () => { + const result = + client.matchDocumentFromProjectLocationCollectionDataStoreBranchDocumentChunkName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentChunkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchChunkFromProjectLocationCollectionDataStoreBranchDocumentChunkName', () => { + const result = + client.matchChunkFromProjectLocationCollectionDataStoreBranchDocumentChunkName( + fakePath + ); + assert.strictEqual(result, 'chunkValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreBranchDocumentChunkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationCollectionDataStoreConversation', () => { + const fakePath = + '/rendered/path/projectLocationCollectionDataStoreConversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + collection: 'collectionValue', + data_store: 'dataStoreValue', + conversation: 'conversationValue', + }; + const client = new rankserviceModule.v1alpha.RankServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationCollectionDataStoreConversationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationCollectionDataStoreConversationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationCollectionDataStoreConversationPath', () => { + const result = + client.projectLocationCollectionDataStoreConversationPath( + 'projectValue', + 'locationValue', + 'collectionValue', + 'dataStoreValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreConversationPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationCollectionDataStoreConversationName', () => { + const result = + client.matchProjectFromProjectLocationCollectionDataStoreConversationName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreConversationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationCollectionDataStoreConversationName', () => { + const result = + client.matchLocationFromProjectLocationCollectionDataStoreConversationName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreConversationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCollectionFromProjectLocationCollectionDataStoreConversationName', () => { + const result = + client.matchCollectionFromProjectLocationCollectionDataStoreConversationName( + fakePath + ); + assert.strictEqual(result, 'collectionValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreConversationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationCollectionDataStoreConversationName', () => { + const result = + client.matchDataStoreFromProjectLocationCollectionDataStoreConversationName( + fakePath + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreConversationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationCollectionDataStoreConversationName', () => { + const result = + client.matchConversationFromProjectLocationCollectionDataStoreConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreConversationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationCollectionDataStoreDocumentProcessingConfig', () => { + const fakePath = + '/rendered/path/projectLocationCollectionDataStoreDocumentProcessingConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + collection: 'collectionValue', + data_store: 'dataStoreValue', + }; + const client = new rankserviceModule.v1alpha.RankServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationCollectionDataStoreDocumentProcessingConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationCollectionDataStoreDocumentProcessingConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationCollectionDataStoreDocumentProcessingConfigPath', () => { + const result = + client.projectLocationCollectionDataStoreDocumentProcessingConfigPath( + 'projectValue', + 'locationValue', + 'collectionValue', + 'dataStoreValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreDocumentProcessingConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationCollectionDataStoreDocumentProcessingConfigName', () => { + const result = + client.matchProjectFromProjectLocationCollectionDataStoreDocumentProcessingConfigName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreDocumentProcessingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationCollectionDataStoreDocumentProcessingConfigName', () => { + const result = + client.matchLocationFromProjectLocationCollectionDataStoreDocumentProcessingConfigName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreDocumentProcessingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCollectionFromProjectLocationCollectionDataStoreDocumentProcessingConfigName', () => { + const result = + client.matchCollectionFromProjectLocationCollectionDataStoreDocumentProcessingConfigName( + fakePath + ); + assert.strictEqual(result, 'collectionValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreDocumentProcessingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationCollectionDataStoreDocumentProcessingConfigName', () => { + const result = + client.matchDataStoreFromProjectLocationCollectionDataStoreDocumentProcessingConfigName( + fakePath + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreDocumentProcessingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationCollectionDataStoreSchema', () => { + const fakePath = + '/rendered/path/projectLocationCollectionDataStoreSchema'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + collection: 'collectionValue', + data_store: 'dataStoreValue', + schema: 'schemaValue', + }; + const client = new rankserviceModule.v1alpha.RankServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationCollectionDataStoreSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationCollectionDataStoreSchemaPath', () => { + const result = client.projectLocationCollectionDataStoreSchemaPath( + 'projectValue', + 'locationValue', + 'collectionValue', + 'dataStoreValue', + 'schemaValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSchemaPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationCollectionDataStoreSchemaName', () => { + const result = + client.matchProjectFromProjectLocationCollectionDataStoreSchemaName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationCollectionDataStoreSchemaName', () => { + const result = + client.matchLocationFromProjectLocationCollectionDataStoreSchemaName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCollectionFromProjectLocationCollectionDataStoreSchemaName', () => { + const result = + client.matchCollectionFromProjectLocationCollectionDataStoreSchemaName( + fakePath + ); + assert.strictEqual(result, 'collectionValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationCollectionDataStoreSchemaName', () => { + const result = + client.matchDataStoreFromProjectLocationCollectionDataStoreSchemaName( + fakePath + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSchemaFromProjectLocationCollectionDataStoreSchemaName', () => { + const result = + client.matchSchemaFromProjectLocationCollectionDataStoreSchemaName( + fakePath + ); + assert.strictEqual(result, 'schemaValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationCollectionDataStoreServingConfig', () => { + const fakePath = + '/rendered/path/projectLocationCollectionDataStoreServingConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + collection: 'collectionValue', + data_store: 'dataStoreValue', + serving_config: 'servingConfigValue', + }; + const client = new rankserviceModule.v1alpha.RankServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationCollectionDataStoreServingConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationCollectionDataStoreServingConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationCollectionDataStoreServingConfigPath', () => { + const result = + client.projectLocationCollectionDataStoreServingConfigPath( + 'projectValue', + 'locationValue', + 'collectionValue', + 'dataStoreValue', + 'servingConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreServingConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationCollectionDataStoreServingConfigName', () => { + const result = + client.matchProjectFromProjectLocationCollectionDataStoreServingConfigName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreServingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationCollectionDataStoreServingConfigName', () => { + const result = + client.matchLocationFromProjectLocationCollectionDataStoreServingConfigName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreServingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCollectionFromProjectLocationCollectionDataStoreServingConfigName', () => { + const result = + client.matchCollectionFromProjectLocationCollectionDataStoreServingConfigName( + fakePath + ); + assert.strictEqual(result, 'collectionValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreServingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationCollectionDataStoreServingConfigName', () => { + const result = + client.matchDataStoreFromProjectLocationCollectionDataStoreServingConfigName( + fakePath + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreServingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchServingConfigFromProjectLocationCollectionDataStoreServingConfigName', () => { + const result = + client.matchServingConfigFromProjectLocationCollectionDataStoreServingConfigName( + fakePath + ); + assert.strictEqual(result, 'servingConfigValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreServingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationCollectionDataStoreSiteSearchEngine', () => { + const fakePath = + '/rendered/path/projectLocationCollectionDataStoreSiteSearchEngine'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + collection: 'collectionValue', + data_store: 'dataStoreValue', + }; + const client = new rankserviceModule.v1alpha.RankServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationCollectionDataStoreSiteSearchEnginePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationCollectionDataStoreSiteSearchEnginePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationCollectionDataStoreSiteSearchEnginePath', () => { + const result = + client.projectLocationCollectionDataStoreSiteSearchEnginePath( + 'projectValue', + 'locationValue', + 'collectionValue', + 'dataStoreValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSiteSearchEnginePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationCollectionDataStoreSiteSearchEngineName', () => { + const result = + client.matchProjectFromProjectLocationCollectionDataStoreSiteSearchEngineName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSiteSearchEnginePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationCollectionDataStoreSiteSearchEngineName', () => { + const result = + client.matchLocationFromProjectLocationCollectionDataStoreSiteSearchEngineName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSiteSearchEnginePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCollectionFromProjectLocationCollectionDataStoreSiteSearchEngineName', () => { + const result = + client.matchCollectionFromProjectLocationCollectionDataStoreSiteSearchEngineName( + fakePath + ); + assert.strictEqual(result, 'collectionValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSiteSearchEnginePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationCollectionDataStoreSiteSearchEngineName', () => { + const result = + client.matchDataStoreFromProjectLocationCollectionDataStoreSiteSearchEngineName( + fakePath + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSiteSearchEnginePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationCollectionDataStoreSiteSearchEngineTargetSite', () => { + const fakePath = + '/rendered/path/projectLocationCollectionDataStoreSiteSearchEngineTargetSite'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + collection: 'collectionValue', + data_store: 'dataStoreValue', + target_site: 'targetSiteValue', + }; + const client = new rankserviceModule.v1alpha.RankServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationCollectionDataStoreSiteSearchEngineTargetSitePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationCollectionDataStoreSiteSearchEngineTargetSitePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationCollectionDataStoreSiteSearchEngineTargetSitePath', () => { + const result = + client.projectLocationCollectionDataStoreSiteSearchEngineTargetSitePath( + 'projectValue', + 'locationValue', + 'collectionValue', + 'dataStoreValue', + 'targetSiteValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSiteSearchEngineTargetSitePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationCollectionDataStoreSiteSearchEngineTargetSiteName', () => { + const result = + client.matchProjectFromProjectLocationCollectionDataStoreSiteSearchEngineTargetSiteName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSiteSearchEngineTargetSitePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationCollectionDataStoreSiteSearchEngineTargetSiteName', () => { + const result = + client.matchLocationFromProjectLocationCollectionDataStoreSiteSearchEngineTargetSiteName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSiteSearchEngineTargetSitePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCollectionFromProjectLocationCollectionDataStoreSiteSearchEngineTargetSiteName', () => { + const result = + client.matchCollectionFromProjectLocationCollectionDataStoreSiteSearchEngineTargetSiteName( + fakePath + ); + assert.strictEqual(result, 'collectionValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSiteSearchEngineTargetSitePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationCollectionDataStoreSiteSearchEngineTargetSiteName', () => { + const result = + client.matchDataStoreFromProjectLocationCollectionDataStoreSiteSearchEngineTargetSiteName( + fakePath + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSiteSearchEngineTargetSitePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTargetSiteFromProjectLocationCollectionDataStoreSiteSearchEngineTargetSiteName', () => { + const result = + client.matchTargetSiteFromProjectLocationCollectionDataStoreSiteSearchEngineTargetSiteName( + fakePath + ); + assert.strictEqual(result, 'targetSiteValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionDataStoreSiteSearchEngineTargetSitePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationCollectionEngineConversation', () => { + const fakePath = + '/rendered/path/projectLocationCollectionEngineConversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + collection: 'collectionValue', + engine: 'engineValue', + conversation: 'conversationValue', + }; + const client = new rankserviceModule.v1alpha.RankServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationCollectionEngineConversationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationCollectionEngineConversationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationCollectionEngineConversationPath', () => { + const result = client.projectLocationCollectionEngineConversationPath( + 'projectValue', + 'locationValue', + 'collectionValue', + 'engineValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationCollectionEngineConversationPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationCollectionEngineConversationName', () => { + const result = + client.matchProjectFromProjectLocationCollectionEngineConversationName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionEngineConversationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationCollectionEngineConversationName', () => { + const result = + client.matchLocationFromProjectLocationCollectionEngineConversationName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionEngineConversationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCollectionFromProjectLocationCollectionEngineConversationName', () => { + const result = + client.matchCollectionFromProjectLocationCollectionEngineConversationName( + fakePath + ); + assert.strictEqual(result, 'collectionValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionEngineConversationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEngineFromProjectLocationCollectionEngineConversationName', () => { + const result = + client.matchEngineFromProjectLocationCollectionEngineConversationName( + fakePath + ); + assert.strictEqual(result, 'engineValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionEngineConversationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationCollectionEngineConversationName', () => { + const result = + client.matchConversationFromProjectLocationCollectionEngineConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionEngineConversationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationCollectionEngineServingConfig', () => { + const fakePath = + '/rendered/path/projectLocationCollectionEngineServingConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + collection: 'collectionValue', + engine: 'engineValue', + serving_config: 'servingConfigValue', + }; + const client = new rankserviceModule.v1alpha.RankServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationCollectionEngineServingConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationCollectionEngineServingConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationCollectionEngineServingConfigPath', () => { + const result = client.projectLocationCollectionEngineServingConfigPath( + 'projectValue', + 'locationValue', + 'collectionValue', + 'engineValue', + 'servingConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationCollectionEngineServingConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationCollectionEngineServingConfigName', () => { + const result = + client.matchProjectFromProjectLocationCollectionEngineServingConfigName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionEngineServingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationCollectionEngineServingConfigName', () => { + const result = + client.matchLocationFromProjectLocationCollectionEngineServingConfigName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionEngineServingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCollectionFromProjectLocationCollectionEngineServingConfigName', () => { + const result = + client.matchCollectionFromProjectLocationCollectionEngineServingConfigName( + fakePath + ); + assert.strictEqual(result, 'collectionValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionEngineServingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEngineFromProjectLocationCollectionEngineServingConfigName', () => { + const result = + client.matchEngineFromProjectLocationCollectionEngineServingConfigName( + fakePath + ); + assert.strictEqual(result, 'engineValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionEngineServingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchServingConfigFromProjectLocationCollectionEngineServingConfigName', () => { + const result = + client.matchServingConfigFromProjectLocationCollectionEngineServingConfigName( + fakePath + ); + assert.strictEqual(result, 'servingConfigValue'); + assert( + ( + client.pathTemplates + .projectLocationCollectionEngineServingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationDataStore', () => { + const fakePath = '/rendered/path/projectLocationDataStore'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_store: 'dataStoreValue', + }; + const client = new rankserviceModule.v1alpha.RankServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationDataStorePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationDataStorePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationDataStorePath', () => { + const result = client.projectLocationDataStorePath( + 'projectValue', + 'locationValue', + 'dataStoreValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationDataStorePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationDataStoreName', () => { + const result = + client.matchProjectFromProjectLocationDataStoreName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationDataStoreName', () => { + const result = + client.matchLocationFromProjectLocationDataStoreName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationDataStoreName', () => { + const result = + client.matchDataStoreFromProjectLocationDataStoreName(fakePath); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates.projectLocationDataStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationDataStoreBranchDocument', () => { + const fakePath = '/rendered/path/projectLocationDataStoreBranchDocument'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_store: 'dataStoreValue', + branch: 'branchValue', + document: 'documentValue', + }; + const client = new rankserviceModule.v1alpha.RankServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationDataStoreBranchDocumentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationDataStoreBranchDocumentPath', () => { + const result = client.projectLocationDataStoreBranchDocumentPath( + 'projectValue', + 'locationValue', + 'dataStoreValue', + 'branchValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationDataStoreBranchDocumentName', () => { + const result = + client.matchProjectFromProjectLocationDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationDataStoreBranchDocumentName', () => { + const result = + client.matchLocationFromProjectLocationDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationDataStoreBranchDocumentName', () => { + const result = + client.matchDataStoreFromProjectLocationDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBranchFromProjectLocationDataStoreBranchDocumentName', () => { + const result = + client.matchBranchFromProjectLocationDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'branchValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectLocationDataStoreBranchDocumentName', () => { + const result = + client.matchDocumentFromProjectLocationDataStoreBranchDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationDataStoreBranchDocumentChunk', () => { + const fakePath = + '/rendered/path/projectLocationDataStoreBranchDocumentChunk'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_store: 'dataStoreValue', + branch: 'branchValue', + document: 'documentValue', + chunk: 'chunkValue', + }; + const client = new rankserviceModule.v1alpha.RankServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationDataStoreBranchDocumentChunkPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationDataStoreBranchDocumentChunkPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationDataStoreBranchDocumentChunkPath', () => { + const result = client.projectLocationDataStoreBranchDocumentChunkPath( + 'projectValue', + 'locationValue', + 'dataStoreValue', + 'branchValue', + 'documentValue', + 'chunkValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentChunkPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationDataStoreBranchDocumentChunkName', () => { + const result = + client.matchProjectFromProjectLocationDataStoreBranchDocumentChunkName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentChunkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationDataStoreBranchDocumentChunkName', () => { + const result = + client.matchLocationFromProjectLocationDataStoreBranchDocumentChunkName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentChunkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationDataStoreBranchDocumentChunkName', () => { + const result = + client.matchDataStoreFromProjectLocationDataStoreBranchDocumentChunkName( + fakePath + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentChunkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBranchFromProjectLocationDataStoreBranchDocumentChunkName', () => { + const result = + client.matchBranchFromProjectLocationDataStoreBranchDocumentChunkName( + fakePath + ); + assert.strictEqual(result, 'branchValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentChunkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectLocationDataStoreBranchDocumentChunkName', () => { + const result = + client.matchDocumentFromProjectLocationDataStoreBranchDocumentChunkName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentChunkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchChunkFromProjectLocationDataStoreBranchDocumentChunkName', () => { + const result = + client.matchChunkFromProjectLocationDataStoreBranchDocumentChunkName( + fakePath + ); + assert.strictEqual(result, 'chunkValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreBranchDocumentChunkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationDataStoreConversation', () => { + const fakePath = '/rendered/path/projectLocationDataStoreConversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_store: 'dataStoreValue', + conversation: 'conversationValue', + }; + const client = new rankserviceModule.v1alpha.RankServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationDataStoreConversationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationDataStoreConversationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationDataStoreConversationPath', () => { + const result = client.projectLocationDataStoreConversationPath( + 'projectValue', + 'locationValue', + 'dataStoreValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationDataStoreConversationPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationDataStoreConversationName', () => { + const result = + client.matchProjectFromProjectLocationDataStoreConversationName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreConversationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationDataStoreConversationName', () => { + const result = + client.matchLocationFromProjectLocationDataStoreConversationName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreConversationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationDataStoreConversationName', () => { + const result = + client.matchDataStoreFromProjectLocationDataStoreConversationName( + fakePath + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreConversationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationDataStoreConversationName', () => { + const result = + client.matchConversationFromProjectLocationDataStoreConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreConversationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationDataStoreDocumentProcessingConfig', () => { + const fakePath = + '/rendered/path/projectLocationDataStoreDocumentProcessingConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_store: 'dataStoreValue', + }; + const client = new rankserviceModule.v1alpha.RankServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationDataStoreDocumentProcessingConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationDataStoreDocumentProcessingConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationDataStoreDocumentProcessingConfigPath', () => { + const result = + client.projectLocationDataStoreDocumentProcessingConfigPath( + 'projectValue', + 'locationValue', + 'dataStoreValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationDataStoreDocumentProcessingConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationDataStoreDocumentProcessingConfigName', () => { + const result = + client.matchProjectFromProjectLocationDataStoreDocumentProcessingConfigName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreDocumentProcessingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationDataStoreDocumentProcessingConfigName', () => { + const result = + client.matchLocationFromProjectLocationDataStoreDocumentProcessingConfigName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreDocumentProcessingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationDataStoreDocumentProcessingConfigName', () => { + const result = + client.matchDataStoreFromProjectLocationDataStoreDocumentProcessingConfigName( + fakePath + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreDocumentProcessingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationDataStoreSchema', () => { + const fakePath = '/rendered/path/projectLocationDataStoreSchema'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_store: 'dataStoreValue', + schema: 'schemaValue', + }; + const client = new rankserviceModule.v1alpha.RankServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationDataStoreSchemaPath', () => { + const result = client.projectLocationDataStoreSchemaPath( + 'projectValue', + 'locationValue', + 'dataStoreValue', + 'schemaValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationDataStoreSchemaName', () => { + const result = + client.matchProjectFromProjectLocationDataStoreSchemaName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationDataStoreSchemaName', () => { + const result = + client.matchLocationFromProjectLocationDataStoreSchemaName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationDataStoreSchemaName', () => { + const result = + client.matchDataStoreFromProjectLocationDataStoreSchemaName(fakePath); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSchemaFromProjectLocationDataStoreSchemaName', () => { + const result = + client.matchSchemaFromProjectLocationDataStoreSchemaName(fakePath); + assert.strictEqual(result, 'schemaValue'); + assert( + ( + client.pathTemplates.projectLocationDataStoreSchemaPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationDataStoreServingConfig', () => { + const fakePath = '/rendered/path/projectLocationDataStoreServingConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_store: 'dataStoreValue', + serving_config: 'servingConfigValue', + }; + const client = new rankserviceModule.v1alpha.RankServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationDataStoreServingConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationDataStoreServingConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationDataStoreServingConfigPath', () => { + const result = client.projectLocationDataStoreServingConfigPath( + 'projectValue', + 'locationValue', + 'dataStoreValue', + 'servingConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationDataStoreServingConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationDataStoreServingConfigName', () => { + const result = + client.matchProjectFromProjectLocationDataStoreServingConfigName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreServingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationDataStoreServingConfigName', () => { + const result = + client.matchLocationFromProjectLocationDataStoreServingConfigName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreServingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationDataStoreServingConfigName', () => { + const result = + client.matchDataStoreFromProjectLocationDataStoreServingConfigName( + fakePath + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreServingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchServingConfigFromProjectLocationDataStoreServingConfigName', () => { + const result = + client.matchServingConfigFromProjectLocationDataStoreServingConfigName( + fakePath + ); + assert.strictEqual(result, 'servingConfigValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreServingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationDataStoreSiteSearchEngine', () => { + const fakePath = + '/rendered/path/projectLocationDataStoreSiteSearchEngine'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_store: 'dataStoreValue', + }; + const client = new rankserviceModule.v1alpha.RankServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationDataStoreSiteSearchEnginePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationDataStoreSiteSearchEnginePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationDataStoreSiteSearchEnginePath', () => { + const result = client.projectLocationDataStoreSiteSearchEnginePath( + 'projectValue', + 'locationValue', + 'dataStoreValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationDataStoreSiteSearchEnginePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationDataStoreSiteSearchEngineName', () => { + const result = + client.matchProjectFromProjectLocationDataStoreSiteSearchEngineName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreSiteSearchEnginePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationDataStoreSiteSearchEngineName', () => { + const result = + client.matchLocationFromProjectLocationDataStoreSiteSearchEngineName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreSiteSearchEnginePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationDataStoreSiteSearchEngineName', () => { + const result = + client.matchDataStoreFromProjectLocationDataStoreSiteSearchEngineName( + fakePath + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreSiteSearchEnginePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationDataStoreSiteSearchEngineTargetSite', () => { + const fakePath = + '/rendered/path/projectLocationDataStoreSiteSearchEngineTargetSite'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_store: 'dataStoreValue', + target_site: 'targetSiteValue', + }; + const client = new rankserviceModule.v1alpha.RankServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationDataStoreSiteSearchEngineTargetSitePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationDataStoreSiteSearchEngineTargetSitePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationDataStoreSiteSearchEngineTargetSitePath', () => { + const result = + client.projectLocationDataStoreSiteSearchEngineTargetSitePath( + 'projectValue', + 'locationValue', + 'dataStoreValue', + 'targetSiteValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationDataStoreSiteSearchEngineTargetSitePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationDataStoreSiteSearchEngineTargetSiteName', () => { + const result = + client.matchProjectFromProjectLocationDataStoreSiteSearchEngineTargetSiteName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreSiteSearchEngineTargetSitePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationDataStoreSiteSearchEngineTargetSiteName', () => { + const result = + client.matchLocationFromProjectLocationDataStoreSiteSearchEngineTargetSiteName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreSiteSearchEngineTargetSitePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataStoreFromProjectLocationDataStoreSiteSearchEngineTargetSiteName', () => { + const result = + client.matchDataStoreFromProjectLocationDataStoreSiteSearchEngineTargetSiteName( + fakePath + ); + assert.strictEqual(result, 'dataStoreValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreSiteSearchEngineTargetSitePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTargetSiteFromProjectLocationDataStoreSiteSearchEngineTargetSiteName', () => { + const result = + client.matchTargetSiteFromProjectLocationDataStoreSiteSearchEngineTargetSiteName( + fakePath + ); + assert.strictEqual(result, 'targetSiteValue'); + assert( + ( + client.pathTemplates + .projectLocationDataStoreSiteSearchEngineTargetSitePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('rankingConfig', () => { + const fakePath = '/rendered/path/rankingConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + ranking_config: 'rankingConfigValue', + }; + const client = new rankserviceModule.v1alpha.RankServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.rankingConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.rankingConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('rankingConfigPath', () => { + const result = client.rankingConfigPath( + 'projectValue', + 'locationValue', + 'rankingConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.rankingConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRankingConfigName', () => { + const result = client.matchProjectFromRankingConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.rankingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRankingConfigName', () => { + const result = client.matchLocationFromRankingConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.rankingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRankingConfigFromRankingConfigName', () => { + const result = client.matchRankingConfigFromRankingConfigName(fakePath); + assert.strictEqual(result, 'rankingConfigValue'); + assert( + (client.pathTemplates.rankingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-discoveryengine/test/gapic_recommendation_service_v1alpha.ts b/packages/google-cloud-discoveryengine/test/gapic_recommendation_service_v1alpha.ts index 8176298783c..1804f852ced 100644 --- a/packages/google-cloud-discoveryengine/test/gapic_recommendation_service_v1alpha.ts +++ b/packages/google-cloud-discoveryengine/test/gapic_recommendation_service_v1alpha.ts @@ -104,7 +104,7 @@ describe('v1alpha.RecommendationServiceClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -144,6 +144,43 @@ describe('v1alpha.RecommendationServiceClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'discoveryengine.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new recommendationserviceModule.v1alpha.RecommendationServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'discoveryengine.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new recommendationserviceModule.v1alpha.RecommendationServiceClient( + {universeDomain: 'configured.example.com'} + ); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'discoveryengine.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new recommendationserviceModule.v1alpha.RecommendationServiceClient({ diff --git a/packages/google-cloud-discoveryengine/test/gapic_recommendation_service_v1beta.ts b/packages/google-cloud-discoveryengine/test/gapic_recommendation_service_v1beta.ts index 1b003218db0..09dcd88b926 100644 --- a/packages/google-cloud-discoveryengine/test/gapic_recommendation_service_v1beta.ts +++ b/packages/google-cloud-discoveryengine/test/gapic_recommendation_service_v1beta.ts @@ -104,7 +104,7 @@ describe('v1beta.RecommendationServiceClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -144,6 +144,43 @@ describe('v1beta.RecommendationServiceClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'discoveryengine.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new recommendationserviceModule.v1beta.RecommendationServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'discoveryengine.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new recommendationserviceModule.v1beta.RecommendationServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'discoveryengine.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new recommendationserviceModule.v1beta.RecommendationServiceClient({ diff --git a/packages/google-cloud-discoveryengine/test/gapic_schema_service_v1.ts b/packages/google-cloud-discoveryengine/test/gapic_schema_service_v1.ts index f111ebaaf6f..1825714b86b 100644 --- a/packages/google-cloud-discoveryengine/test/gapic_schema_service_v1.ts +++ b/packages/google-cloud-discoveryengine/test/gapic_schema_service_v1.ts @@ -179,7 +179,7 @@ describe('v1.SchemaServiceClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -215,6 +215,41 @@ describe('v1.SchemaServiceClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'discoveryengine.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new schemaserviceModule.v1.SchemaServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'discoveryengine.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new schemaserviceModule.v1.SchemaServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'discoveryengine.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new schemaserviceModule.v1.SchemaServiceClient({ diff --git a/packages/google-cloud-discoveryengine/test/gapic_schema_service_v1alpha.ts b/packages/google-cloud-discoveryengine/test/gapic_schema_service_v1alpha.ts index 111414152da..1fe34513e1a 100644 --- a/packages/google-cloud-discoveryengine/test/gapic_schema_service_v1alpha.ts +++ b/packages/google-cloud-discoveryengine/test/gapic_schema_service_v1alpha.ts @@ -179,7 +179,7 @@ describe('v1alpha.SchemaServiceClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -215,6 +215,41 @@ describe('v1alpha.SchemaServiceClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'discoveryengine.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new schemaserviceModule.v1alpha.SchemaServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'discoveryengine.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new schemaserviceModule.v1alpha.SchemaServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'discoveryengine.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new schemaserviceModule.v1alpha.SchemaServiceClient({ diff --git a/packages/google-cloud-discoveryengine/test/gapic_schema_service_v1beta.ts b/packages/google-cloud-discoveryengine/test/gapic_schema_service_v1beta.ts index 7cd21d573ce..c1e2dcd61ec 100644 --- a/packages/google-cloud-discoveryengine/test/gapic_schema_service_v1beta.ts +++ b/packages/google-cloud-discoveryengine/test/gapic_schema_service_v1beta.ts @@ -179,7 +179,7 @@ describe('v1beta.SchemaServiceClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -215,6 +215,41 @@ describe('v1beta.SchemaServiceClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'discoveryengine.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new schemaserviceModule.v1beta.SchemaServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'discoveryengine.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new schemaserviceModule.v1beta.SchemaServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'discoveryengine.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new schemaserviceModule.v1beta.SchemaServiceClient({ diff --git a/packages/google-cloud-discoveryengine/test/gapic_search_service_v1.ts b/packages/google-cloud-discoveryengine/test/gapic_search_service_v1.ts index 88e3b685144..5ac97f8e94e 100644 --- a/packages/google-cloud-discoveryengine/test/gapic_search_service_v1.ts +++ b/packages/google-cloud-discoveryengine/test/gapic_search_service_v1.ts @@ -142,7 +142,7 @@ describe('v1.SearchServiceClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -178,6 +178,41 @@ describe('v1.SearchServiceClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'discoveryengine.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new searchserviceModule.v1.SearchServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'discoveryengine.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new searchserviceModule.v1.SearchServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'discoveryengine.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new searchserviceModule.v1.SearchServiceClient({ diff --git a/packages/google-cloud-discoveryengine/test/gapic_search_service_v1alpha.ts b/packages/google-cloud-discoveryengine/test/gapic_search_service_v1alpha.ts index 3ad3eff0d61..f403af64015 100644 --- a/packages/google-cloud-discoveryengine/test/gapic_search_service_v1alpha.ts +++ b/packages/google-cloud-discoveryengine/test/gapic_search_service_v1alpha.ts @@ -142,7 +142,7 @@ describe('v1alpha.SearchServiceClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -178,6 +178,41 @@ describe('v1alpha.SearchServiceClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'discoveryengine.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new searchserviceModule.v1alpha.SearchServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'discoveryengine.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new searchserviceModule.v1alpha.SearchServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'discoveryengine.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new searchserviceModule.v1alpha.SearchServiceClient({ diff --git a/packages/google-cloud-discoveryengine/test/gapic_search_service_v1beta.ts b/packages/google-cloud-discoveryengine/test/gapic_search_service_v1beta.ts index 9b042c5f4fb..46cec524676 100644 --- a/packages/google-cloud-discoveryengine/test/gapic_search_service_v1beta.ts +++ b/packages/google-cloud-discoveryengine/test/gapic_search_service_v1beta.ts @@ -142,7 +142,7 @@ describe('v1beta.SearchServiceClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -178,6 +178,41 @@ describe('v1beta.SearchServiceClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'discoveryengine.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new searchserviceModule.v1beta.SearchServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'discoveryengine.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new searchserviceModule.v1beta.SearchServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'discoveryengine.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new searchserviceModule.v1beta.SearchServiceClient({ diff --git a/packages/google-cloud-discoveryengine/test/gapic_search_tuning_service_v1alpha.ts b/packages/google-cloud-discoveryengine/test/gapic_search_tuning_service_v1alpha.ts index 360ed1919eb..8bd3abf00c4 100644 --- a/packages/google-cloud-discoveryengine/test/gapic_search_tuning_service_v1alpha.ts +++ b/packages/google-cloud-discoveryengine/test/gapic_search_tuning_service_v1alpha.ts @@ -132,7 +132,7 @@ describe('v1alpha.SearchTuningServiceClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -172,6 +172,43 @@ describe('v1alpha.SearchTuningServiceClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'discoveryengine.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new searchtuningserviceModule.v1alpha.SearchTuningServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'discoveryengine.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new searchtuningserviceModule.v1alpha.SearchTuningServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'discoveryengine.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new searchtuningserviceModule.v1alpha.SearchTuningServiceClient({ diff --git a/packages/google-cloud-discoveryengine/test/gapic_search_tuning_service_v1beta.ts b/packages/google-cloud-discoveryengine/test/gapic_search_tuning_service_v1beta.ts index 02de61803c0..cf6f8ae13cf 100644 --- a/packages/google-cloud-discoveryengine/test/gapic_search_tuning_service_v1beta.ts +++ b/packages/google-cloud-discoveryengine/test/gapic_search_tuning_service_v1beta.ts @@ -132,7 +132,7 @@ describe('v1beta.SearchTuningServiceClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -172,6 +172,43 @@ describe('v1beta.SearchTuningServiceClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'discoveryengine.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new searchtuningserviceModule.v1beta.SearchTuningServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'discoveryengine.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new searchtuningserviceModule.v1beta.SearchTuningServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'discoveryengine.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new searchtuningserviceModule.v1beta.SearchTuningServiceClient({ diff --git a/packages/google-cloud-discoveryengine/test/gapic_serving_config_service_v1alpha.ts b/packages/google-cloud-discoveryengine/test/gapic_serving_config_service_v1alpha.ts index a15bd53c0cf..a1eeff7a214 100644 --- a/packages/google-cloud-discoveryengine/test/gapic_serving_config_service_v1alpha.ts +++ b/packages/google-cloud-discoveryengine/test/gapic_serving_config_service_v1alpha.ts @@ -144,7 +144,7 @@ describe('v1alpha.ServingConfigServiceClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -184,6 +184,43 @@ describe('v1alpha.ServingConfigServiceClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'discoveryengine.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new servingconfigserviceModule.v1alpha.ServingConfigServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'discoveryengine.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new servingconfigserviceModule.v1alpha.ServingConfigServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'discoveryengine.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new servingconfigserviceModule.v1alpha.ServingConfigServiceClient({ diff --git a/packages/google-cloud-discoveryengine/test/gapic_serving_config_service_v1beta.ts b/packages/google-cloud-discoveryengine/test/gapic_serving_config_service_v1beta.ts index b1e7eda4a53..71ace72a741 100644 --- a/packages/google-cloud-discoveryengine/test/gapic_serving_config_service_v1beta.ts +++ b/packages/google-cloud-discoveryengine/test/gapic_serving_config_service_v1beta.ts @@ -144,7 +144,7 @@ describe('v1beta.ServingConfigServiceClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -184,6 +184,43 @@ describe('v1beta.ServingConfigServiceClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'discoveryengine.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new servingconfigserviceModule.v1beta.ServingConfigServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'discoveryengine.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new servingconfigserviceModule.v1beta.ServingConfigServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'discoveryengine.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new servingconfigserviceModule.v1beta.ServingConfigServiceClient({ diff --git a/packages/google-cloud-discoveryengine/test/gapic_site_search_engine_service_v1.ts b/packages/google-cloud-discoveryengine/test/gapic_site_search_engine_service_v1.ts index 154fa5f4d2e..cfdb410f804 100644 --- a/packages/google-cloud-discoveryengine/test/gapic_site_search_engine_service_v1.ts +++ b/packages/google-cloud-discoveryengine/test/gapic_site_search_engine_service_v1.ts @@ -181,7 +181,7 @@ describe('v1.SiteSearchEngineServiceClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -221,6 +221,43 @@ describe('v1.SiteSearchEngineServiceClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'discoveryengine.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new sitesearchengineserviceModule.v1.SiteSearchEngineServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'discoveryengine.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new sitesearchengineserviceModule.v1.SiteSearchEngineServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'discoveryengine.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new sitesearchengineserviceModule.v1.SiteSearchEngineServiceClient({ diff --git a/packages/google-cloud-discoveryengine/test/gapic_site_search_engine_service_v1alpha.ts b/packages/google-cloud-discoveryengine/test/gapic_site_search_engine_service_v1alpha.ts index 79de5a87adc..e9fb85b8139 100644 --- a/packages/google-cloud-discoveryengine/test/gapic_site_search_engine_service_v1alpha.ts +++ b/packages/google-cloud-discoveryengine/test/gapic_site_search_engine_service_v1alpha.ts @@ -181,7 +181,7 @@ describe('v1alpha.SiteSearchEngineServiceClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -221,6 +221,43 @@ describe('v1alpha.SiteSearchEngineServiceClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'discoveryengine.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new sitesearchengineserviceModule.v1alpha.SiteSearchEngineServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'discoveryengine.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new sitesearchengineserviceModule.v1alpha.SiteSearchEngineServiceClient( + {universeDomain: 'configured.example.com'} + ); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'discoveryengine.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new sitesearchengineserviceModule.v1alpha.SiteSearchEngineServiceClient( diff --git a/packages/google-cloud-discoveryengine/test/gapic_site_search_engine_service_v1beta.ts b/packages/google-cloud-discoveryengine/test/gapic_site_search_engine_service_v1beta.ts index e129fd1e118..f21b63100a0 100644 --- a/packages/google-cloud-discoveryengine/test/gapic_site_search_engine_service_v1beta.ts +++ b/packages/google-cloud-discoveryengine/test/gapic_site_search_engine_service_v1beta.ts @@ -181,7 +181,7 @@ describe('v1beta.SiteSearchEngineServiceClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -221,6 +221,43 @@ describe('v1beta.SiteSearchEngineServiceClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'discoveryengine.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new sitesearchengineserviceModule.v1beta.SiteSearchEngineServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'discoveryengine.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new sitesearchengineserviceModule.v1beta.SiteSearchEngineServiceClient( + {universeDomain: 'configured.example.com'} + ); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'discoveryengine.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new sitesearchengineserviceModule.v1beta.SiteSearchEngineServiceClient({ diff --git a/packages/google-cloud-discoveryengine/test/gapic_user_event_service_v1.ts b/packages/google-cloud-discoveryengine/test/gapic_user_event_service_v1.ts index 2d8d33381c6..cb90b2af7ed 100644 --- a/packages/google-cloud-discoveryengine/test/gapic_user_event_service_v1.ts +++ b/packages/google-cloud-discoveryengine/test/gapic_user_event_service_v1.ts @@ -139,7 +139,7 @@ describe('v1.UserEventServiceClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -175,6 +175,41 @@ describe('v1.UserEventServiceClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'discoveryengine.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new usereventserviceModule.v1.UserEventServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'discoveryengine.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new usereventserviceModule.v1.UserEventServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'discoveryengine.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new usereventserviceModule.v1.UserEventServiceClient({ diff --git a/packages/google-cloud-discoveryengine/test/gapic_user_event_service_v1alpha.ts b/packages/google-cloud-discoveryengine/test/gapic_user_event_service_v1alpha.ts index 415aabf3e43..20d8ba8f64a 100644 --- a/packages/google-cloud-discoveryengine/test/gapic_user_event_service_v1alpha.ts +++ b/packages/google-cloud-discoveryengine/test/gapic_user_event_service_v1alpha.ts @@ -141,7 +141,7 @@ describe('v1alpha.UserEventServiceClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -177,6 +177,43 @@ describe('v1alpha.UserEventServiceClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'discoveryengine.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new usereventserviceModule.v1alpha.UserEventServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'discoveryengine.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new usereventserviceModule.v1alpha.UserEventServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'discoveryengine.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new usereventserviceModule.v1alpha.UserEventServiceClient({ diff --git a/packages/google-cloud-discoveryengine/test/gapic_user_event_service_v1beta.ts b/packages/google-cloud-discoveryengine/test/gapic_user_event_service_v1beta.ts index daa4673635e..5349634d691 100644 --- a/packages/google-cloud-discoveryengine/test/gapic_user_event_service_v1beta.ts +++ b/packages/google-cloud-discoveryengine/test/gapic_user_event_service_v1beta.ts @@ -139,7 +139,7 @@ describe('v1beta.UserEventServiceClient', () => { }); if ( - typeof process !== 'undefined' && + typeof process === 'object' && typeof process.emitWarning === 'function' ) { it('throws DeprecationWarning if static servicePath is used', () => { @@ -175,6 +175,43 @@ describe('v1beta.UserEventServiceClient', () => { const servicePath = client.apiEndpoint; assert.strictEqual(servicePath, 'discoveryengine.example.com'); }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new usereventserviceModule.v1beta.UserEventServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'discoveryengine.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new usereventserviceModule.v1beta.UserEventServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'discoveryengine.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } it('does not allow setting both universeDomain and universe_domain', () => { assert.throws(() => { new usereventserviceModule.v1beta.UserEventServiceClient({