diff --git a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/common.proto b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/common.proto index bb31bceb868..f8d4817cfcb 100644 --- a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/common.proto +++ b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/common.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -35,4 +35,7 @@ enum IntegratedSystem { // Cloud Pub/Sub. CLOUD_PUBSUB = 2; + + // Dataproc Metastore. + DATAPROC_METASTORE = 3; } diff --git a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/data_source.proto b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/data_source.proto new file mode 100644 index 00000000000..a4696a01956 --- /dev/null +++ b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/data_source.proto @@ -0,0 +1,50 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.datacatalog.v1; + +import "google/api/field_behavior.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.DataCatalog.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/datacatalog/v1;datacatalog"; +option java_multiple_files = true; +option java_outer_classname = "DataSourceProto"; +option java_package = "com.google.cloud.datacatalog.v1"; +option php_namespace = "Google\\Cloud\\DataCatalog\\V1"; +option ruby_package = "Google::Cloud::DataCatalog::V1"; + +// Describes the physical location of an entry. +message DataSource { + // Service name where the data is stored. + enum Service { + // Default unknown service. + SERVICE_UNSPECIFIED = 0; + + // Google Cloud Storage service. + CLOUD_STORAGE = 1; + + // BigQuery service. + BIGQUERY = 2; + } + + // Service in which the data is physically stored. + Service service = 1; + + // Full name of the resource as defined by the service, e.g. + // //bigquery.googleapis.com/projects/{project_id}/locations/{location}/datasets/{dataset_id}/tables/{table_id} + string resource = 2; +} diff --git a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/datacatalog.proto b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/datacatalog.proto index c5b700ddb8b..3f356587ebc 100644 --- a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/datacatalog.proto +++ b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/datacatalog.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/datacatalog/v1/common.proto"; +import "google/cloud/datacatalog/v1/data_source.proto"; import "google/cloud/datacatalog/v1/gcs_fileset_spec.proto"; import "google/cloud/datacatalog/v1/schema.proto"; import "google/cloud/datacatalog/v1/search.proto"; @@ -31,6 +32,7 @@ import "google/iam/v1/iam_policy.proto"; import "google/iam/v1/policy.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.DataCatalog.V1"; @@ -39,13 +41,16 @@ option java_multiple_files = true; option java_package = "com.google.cloud.datacatalog.v1"; option php_namespace = "Google\\Cloud\\DataCatalog\\V1"; option ruby_package = "Google::Cloud::DataCatalog::V1"; +option (google.api.resource_definition) = { + type: "datacatalog.googleapis.com/TagTemplateFieldEnumValue" + pattern: "projects/{project}/locations/{location}/tagTemplates/{tag_template}/fields/{tag_template_field_id}/enumValues/{enum_value_display_name}" +}; // Data Catalog API service allows clients to discover, understand, and manage // their data. service DataCatalog { option (google.api.default_host) = "datacatalog.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; // Searches Data Catalog for multiple resources like entries, tags that // match a query. @@ -53,7 +58,7 @@ service DataCatalog { // This is a custom method // (https://cloud.google.com/apis/design/custom_methods) and does not return // the complete resource, only the resource identifier and high level - // fields. Clients can subsequentally call `Get` methods. + // fields. Clients can subsequently call `Get` methods. // // Note that Data Catalog search queries do not guarantee full recall. Query // results that match your query may not be returned, even in subsequent @@ -126,8 +131,7 @@ service DataCatalog { // identified by the `name` parameter (see [Data Catalog Resource Project] // (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for // more information). - rpc DeleteEntryGroup(DeleteEntryGroupRequest) - returns (google.protobuf.Empty) { + rpc DeleteEntryGroup(DeleteEntryGroupRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1/{name=projects/*/locations/*/entryGroups/*}" }; @@ -135,16 +139,15 @@ service DataCatalog { } // Lists entry groups. - rpc ListEntryGroups(ListEntryGroupsRequest) - returns (ListEntryGroupsResponse) { + rpc ListEntryGroups(ListEntryGroupsRequest) returns (ListEntryGroupsResponse) { option (google.api.http) = { get: "/v1/{parent=projects/*/locations/*}/entryGroups" }; option (google.api.method_signature) = "parent"; } - // Creates an entry. Only entries of 'FILESET' type or user-specified type can - // be created. + // Creates an entry. Only entries of types 'FILESET', 'CLUSTER', 'DATA_STREAM' + // or with a user-specified type can be created. // // Users should enable the Data Catalog API in the project identified by // the `parent` parameter (see [Data Catalog Resource Project] @@ -223,8 +226,7 @@ service DataCatalog { post: "/v1/{parent=projects/*/locations/*}/tagTemplates" body: "tag_template" }; - option (google.api.method_signature) = - "parent,tag_template_id,tag_template"; + option (google.api.method_signature) = "parent,tag_template_id,tag_template"; } // Gets a tag template. @@ -256,8 +258,7 @@ service DataCatalog { // the `name` parameter (see [Data Catalog Resource Project] // (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for // more information). - rpc DeleteTagTemplate(DeleteTagTemplateRequest) - returns (google.protobuf.Empty) { + rpc DeleteTagTemplate(DeleteTagTemplateRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1/{name=projects/*/locations/*/tagTemplates/*}" }; @@ -269,14 +270,12 @@ service DataCatalog { // [Data Catalog Resource // Project](https://cloud.google.com/data-catalog/docs/concepts/resource-project) // for more information). - rpc CreateTagTemplateField(CreateTagTemplateFieldRequest) - returns (TagTemplateField) { + rpc CreateTagTemplateField(CreateTagTemplateFieldRequest) returns (TagTemplateField) { option (google.api.http) = { post: "/v1/{parent=projects/*/locations/*/tagTemplates/*}/fields" body: "tag_template_field" }; - option (google.api.method_signature) = - "parent,tag_template_field_id,tag_template_field"; + option (google.api.method_signature) = "parent,tag_template_field_id,tag_template_field"; } // Updates a field in a tag template. This method cannot be used to update the @@ -284,15 +283,13 @@ service DataCatalog { // identified by the `name` parameter (see [Data Catalog Resource Project] // (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for // more information). - rpc UpdateTagTemplateField(UpdateTagTemplateFieldRequest) - returns (TagTemplateField) { + rpc UpdateTagTemplateField(UpdateTagTemplateFieldRequest) returns (TagTemplateField) { option (google.api.http) = { patch: "/v1/{name=projects/*/locations/*/tagTemplates/*/fields/*}" body: "tag_template_field" }; option (google.api.method_signature) = "name,tag_template_field"; - option (google.api.method_signature) = - "name,tag_template_field,update_mask"; + option (google.api.method_signature) = "name,tag_template_field,update_mask"; } // Renames a field in a tag template. The user should enable the Data Catalog @@ -300,8 +297,7 @@ service DataCatalog { // Resource // Project](https://cloud.google.com/data-catalog/docs/concepts/resource-project) // for more information). - rpc RenameTagTemplateField(RenameTagTemplateFieldRequest) - returns (TagTemplateField) { + rpc RenameTagTemplateField(RenameTagTemplateFieldRequest) returns (TagTemplateField) { option (google.api.http) = { post: "/v1/{name=projects/*/locations/*/tagTemplates/*/fields/*}:rename" body: "*" @@ -309,13 +305,22 @@ service DataCatalog { option (google.api.method_signature) = "name,new_tag_template_field_id"; } + // Renames an enum value in a tag template. The enum values have to be unique + // within one enum field. + rpc RenameTagTemplateFieldEnumValue(RenameTagTemplateFieldEnumValueRequest) returns (TagTemplateField) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/tagTemplates/*/fields/*/enumValues/*}:rename" + body: "*" + }; + option (google.api.method_signature) = "name,new_enum_value_display_name"; + } + // Deletes a field in a tag template and all uses of that field. // Users should enable the Data Catalog API in the project identified by // the `name` parameter (see [Data Catalog Resource Project] // (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for // more information). - rpc DeleteTagTemplateField(DeleteTagTemplateFieldRequest) - returns (google.protobuf.Empty) { + rpc DeleteTagTemplateField(DeleteTagTemplateFieldRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1/{name=projects/*/locations/*/tagTemplates/*/fields/*}" }; @@ -391,8 +396,7 @@ service DataCatalog { // templates. // - `datacatalog.entries.setIamPolicy` to set policies on entries. // - `datacatalog.entryGroups.setIamPolicy` to set policies on entry groups. - rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) - returns (google.iam.v1.Policy) { + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { option (google.api.http) = { post: "/v1/{resource=projects/*/locations/*/tagTemplates/*}:setIamPolicy" body: "*" @@ -420,8 +424,7 @@ service DataCatalog { // templates. // - `datacatalog.entries.getIamPolicy` to get policies on entries. // - `datacatalog.entryGroups.getIamPolicy` to get policies on entry groups. - rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) - returns (google.iam.v1.Policy) { + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { option (google.api.http) = { post: "/v1/{resource=projects/*/locations/*/tagTemplates/*}:getIamPolicy" body: "*" @@ -450,8 +453,7 @@ service DataCatalog { // // A caller is not required to have Google IAM permission to make this // request. - rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) - returns (google.iam.v1.TestIamPermissionsResponse) { + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { option (google.api.http) = { post: "/v1/{resource=projects/*/locations/*/tagTemplates/*}:testIamPermissions" body: "*" @@ -490,41 +492,15 @@ message SearchCatalogRequest { // Optional. The list of locations to search within. // 1. If empty, search will be performed in all locations; - // 2. If any of the locations are NOT in the valid locations list, error - // will be returned; + // 2. If any of the locations are NOT [supported + // regions](https://cloud.google.com/data-catalog/docs/concepts/regions#supported_regions), + // error will be returned; // 3. Otherwise, search only the given locations for matching results. // Typical usage is to leave this field empty. When a location is // unreachable as returned in the `SearchCatalogResponse.unreachable` field, // users can repeat the search request with this parameter set to get // additional information on the error. - // - // Valid locations: - // * asia-east1 - // * asia-east2 - // * asia-northeast1 - // * asia-northeast2 - // * asia-northeast3 - // * asia-south1 - // * asia-southeast1 - // * australia-southeast1 - // * eu - // * europe-north1 - // * europe-west1 - // * europe-west2 - // * europe-west3 - // * europe-west4 - // * europe-west6 - // * global - // * northamerica-northeast1 - // * southamerica-east1 - // * us - // * us-central1 - // * us-east1 - // * us-east4 - // * us-west1 - // * us-west2 - repeated string restricted_locations = 16 - [(google.api.field_behavior) = OPTIONAL]; + repeated string restricted_locations = 16 [(google.api.field_behavior) = OPTIONAL]; } // Required. The scope of this search request. A `scope` that has empty @@ -533,8 +509,8 @@ message SearchCatalogRequest { // return an error in such a case. Scope scope = 6 [(google.api.field_behavior) = REQUIRED]; - // Required. The query string in search query syntax. The query must be - // non-empty. + // Optional. The query string in search query syntax. An empty query string will result + // in all data assets (in the specified scope) that the user has access to. // // Query strings can be simple as "x" or more qualified as: // @@ -546,15 +522,15 @@ message SearchCatalogRequest { // matching to work correctly. See [Data Catalog Search // Syntax](https://cloud.google.com/data-catalog/docs/how-to/search-reference) // for more information. - string query = 1 [(google.api.field_behavior) = REQUIRED]; + string query = 1 [(google.api.field_behavior) = OPTIONAL]; // Number of results in the search page. If <=0 then defaults to 10. Max limit // for page_size is 1000. Throws an invalid argument for page_size > 1000. int32 page_size = 2; // Optional. Pagination token returned in an earlier - // [SearchCatalogResponse.next_page_token][google.cloud.datacatalog.v1.SearchCatalogResponse.next_page_token], - // which indicates that this is a continuation of a prior + // [SearchCatalogResponse.next_page_token][google.cloud.datacatalog.v1.SearchCatalogResponse.next_page_token], which + // indicates that this is a continuation of a prior // [SearchCatalogRequest][google.cloud.datacatalog.v1.DataCatalog.SearchCatalog] // call, and that the system should return the next page of data. If empty, // the first page is returned. @@ -583,19 +559,19 @@ message SearchCatalogResponse { // Unreachable locations. Search result does not include data from those // locations. Users can get additional information on the error by repeating // the search request with a more restrictive parameter -- setting the value - // for `SearchDataCatalogRequest.scope.include_locations`. + // for `SearchDataCatalogRequest.scope.restricted_locations`. repeated string unreachable = 6; } // Request message for // [CreateEntryGroup][google.cloud.datacatalog.v1.DataCatalog.CreateEntryGroup]. message CreateEntryGroupRequest { - // Required. The name of the project this entry group is in. Example: + // Required. The name of the project this entry group belongs to. Example: // - // * projects/{project_id}/locations/{location} + // `projects/{project_id}/locations/{location}` // - // Note that this EntryGroup and its child resources may not actually be - // stored in the location in this name. + // Note: The entry group itself and its child resources might not be + // stored in the location specified in its name. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -603,9 +579,11 @@ message CreateEntryGroupRequest { } ]; - // Required. The id of the entry group to create. - // The id must begin with a letter or underscore, contain only English - // letters, numbers and underscores, and be at most 64 characters. + // Required. The ID of the entry group to create. + // + // The ID must contain only letters (a-z, A-Z), numbers (0-9), + // underscores (_), and must start with a letter or underscore. + // The maximum size is 64 bytes when encoded in UTF-8. string entry_group_id = 3 [(google.api.field_behavior) = REQUIRED]; // The entry group to create. Defaults to an empty entry group. @@ -618,8 +596,11 @@ message UpdateEntryGroupRequest { // Required. The updated entry group. "name" field must be set. EntryGroup entry_group = 1 [(google.api.field_behavior) = REQUIRED]; - // The fields to update on the entry group. If absent or empty, all modifiable - // fields are updated. + // Names of fields whose values to overwrite on an entry group. + // + // If this parameter is absent or empty, all modifiable fields + // are overwritten. If such fields are non-required and omitted in the + // request body, their values are emptied. google.protobuf.FieldMask update_mask = 2; } @@ -658,8 +639,8 @@ message DeleteEntryGroupRequest { // Request message for // [ListEntryGroups][google.cloud.datacatalog.v1.DataCatalog.ListEntryGroups]. message ListEntryGroupsRequest { - // Required. The name of the location that contains the entry groups, which - // can be provided in URL format. Example: + // Required. The name of the location that contains the entry groups, which can be + // provided in URL format. Example: // // * projects/{project_id}/locations/{location} string parent = 1 [ @@ -669,12 +650,12 @@ message ListEntryGroupsRequest { } ]; - // Optional. The maximum number of items to return. Default is 10. Max limit - // is 1000. Throws an invalid argument for `page_size > 1000`. + // Optional. The maximum number of items to return. Default is 10. Max limit is 1000. + // Throws an invalid argument for `page_size > 1000`. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Token that specifies which page is requested. If empty, the first - // page is returned. + // Optional. Token that specifies which page is requested. If empty, the first page is + // returned. string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; } @@ -692,12 +673,12 @@ message ListEntryGroupsResponse { // Request message for // [CreateEntry][google.cloud.datacatalog.v1.DataCatalog.CreateEntry]. message CreateEntryRequest { - // Required. The name of the entry group this entry is in. Example: + // Required. The name of the entry group this entry belongs to. Example: // - // * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id} + // `projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}` // - // Note that this Entry and its child resources may not actually be stored in - // the location in this name. + // Note: The entry itself and its child resources might not be stored in + // the location specified in its name. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -705,7 +686,11 @@ message CreateEntryRequest { } ]; - // Required. The id of the entry to create. + // Required. The ID of the entry to create. + // + // The ID must contain only letters (a-z, A-Z), numbers (0-9), + // and underscores (_). + // The maximum size is 64 bytes when encoded in UTF-8. string entry_id = 3 [(google.api.field_behavior) = REQUIRED]; // Required. The entry to create. @@ -718,26 +703,30 @@ message UpdateEntryRequest { // Required. The updated entry. The "name" field must be set. Entry entry = 1 [(google.api.field_behavior) = REQUIRED]; - // The fields to update on the entry. If absent or empty, all modifiable - // fields are updated. + // Names of fields whose values to overwrite on an entry. + // + // If this parameter is absent or empty, all modifiable fields + // are overwritten. If such fields are non-required and omitted in the + // request body, their values are emptied. // // The following fields are modifiable: + // // * For entries with type `DATA_STREAM`: // * `schema` - // * For entries with type `FILESET` + // * For entries with type `FILESET`: // * `schema` // * `display_name` // * `description` // * `gcs_fileset_spec` // * `gcs_fileset_spec.file_patterns` - // * For entries with `user_specified_type` + // * For entries with `user_specified_type`: // * `schema` // * `display_name` // * `description` - // * user_specified_type - // * user_specified_system - // * linked_resource - // * source_system_timestamps + // * `user_specified_type` + // * `user_specified_system` + // * `linked_resource` + // * `source_system_timestamps` google.protobuf.FieldMask update_mask = 2; } @@ -796,9 +785,26 @@ message LookupEntryRequest { // * `bigquery.dataset.project_id.dataset_id` // * `datacatalog.entry.project_id.location_id.entry_group_id.entry_id` // - // `*_id`s shoud satisfy the standard SQL rules for identifiers. + // `*_id`s should satisfy the standard SQL rules for identifiers. // https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical. string sql_resource = 3; + + // Fully qualified name (FQN) of the resource. + // + // FQNs take two forms: + // + // * For non-regionalized resources: + // + // `{SYSTEM}:{PROJECT}.{PATH_TO_RESOURCE_SEPARATED_WITH_DOTS}` + // + // * For regionalized resources: + // + // `{SYSTEM}:{PROJECT}.{LOCATION_ID}.{PATH_TO_RESOURCE_SEPARATED_WITH_DOTS}` + // + // Example for a DPMS table: + // + // `dataproc_metastore:project_id.location_id.instance_id.database_id.table_id` + string fully_qualified_name = 5; } } @@ -818,15 +824,19 @@ message Entry { pattern: "projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}" }; - // The Data Catalog resource name of the entry in URL format. Example: + // Output only. The resource name of an entry in URL format. + // Example: // - // * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id} + // `projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}` // - // Note that this Entry and its child resources may not actually be stored in - // the location in this name. - string name = 1 [(google.api.resource_reference) = { - type: "datacatalog.googleapis.com/EntryGroup" - }]; + // Note: The entry itself and its child resources might not be + // stored in the location specified in its name. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "datacatalog.googleapis.com/EntryGroup" + } + ]; // The resource this metadata entry refers to. // @@ -835,13 +845,39 @@ message Entry { // resource](https://cloud.google.com/apis/design/resource_names#full_resource_name). // For example, the `linked_resource` for a table resource from BigQuery is: // - // * //bigquery.googleapis.com/projects/projectId/datasets/datasetId/tables/tableId + // `//bigquery.googleapis.com/projects/{projectId}/datasets/{datasetId}/tables/{tableId}` // - // Output only when Entry is of type in the EntryType enum. For entries with - // user_specified_type, this field is optional and defaults to an empty - // string. + // Output only when entry is one of the types in the `EntryType` enum. + // + // For entries with a `user_specified_type`, this field is optional and + // defaults to an empty string. + // + // The resource string must contain only letters (a-z, A-Z), numbers (0-9), + // underscores (_), periods (.), colons (:), slashes (/), dashes (-), + // and hashes (#). + // The maximum size is 200 bytes when encoded in UTF-8. string linked_resource = 9; + // Fully qualified name (FQN) of the resource. Set automatically for entries + // representing resources from synced systems. Settable only during creation + // and read-only afterwards. Can be used for search and lookup of the entries. + // + // + // FQNs take two forms: + // + // * For non-regionalized resources: + // + // `{SYSTEM}:{PROJECT}.{PATH_TO_RESOURCE_SEPARATED_WITH_DOTS}` + // + // * For regionalized resources: + // + // `{SYSTEM}:{PROJECT}.{LOCATION_ID}.{PATH_TO_RESOURCE_SEPARATED_WITH_DOTS}` + // + // Example for a DPMS table: + // + // `dataproc_metastore:project_id.location_id.instance_id.database_id.table_id` + string fully_qualified_name = 29; + // Required. Entry type. oneof entry_type { // The type of the entry. @@ -863,10 +899,9 @@ message Entry { // The source system of the entry. oneof system { - // Output only. This field indicates the entry's source system that Data - // Catalog integrates with, such as BigQuery or Pub/Sub. - IntegratedSystem integrated_system = 17 - [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. This field indicates the entry's source system that Data Catalog + // integrates with, such as BigQuery or Pub/Sub. + IntegratedSystem integrated_system = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; // This field indicates the entry's source system that Data Catalog does not // integrate with. `user_specified_system` strings must begin with a letter @@ -892,13 +927,33 @@ message Entry { BigQueryDateShardedSpec bigquery_date_sharded_spec = 15; } - // Display information such as title and description. A short name to identify - // the entry, for example, "Analytics Data - Jan 2011". Default value is an - // empty string. + // Type- and system- specific information. Specifications for types contain + // fields common to all entries of a given type, and sub-specs with fields + // specific to a given source system. + // When extending the API with new types and systems please use this instead + // of legacy type_spec field. + oneof spec { + // Specification that applies to a table resource. Only valid + // for entries of `TABLE` type. + DatabaseTableSpec database_table_spec = 24; + } + + // Display name of an entry. + // + // The name must contain only Unicode letters, numbers (0-9), underscores (_), + // dashes (-), spaces ( ), and can't start or end with spaces. + // The maximum size is 200 bytes when encoded in UTF-8. + // Default value is an empty string. string display_name = 3; - // Entry description, which can consist of several sentences or paragraphs - // that describe entry contents. Default value is an empty string. + // Entry description that can consist of several sentences or paragraphs + // that describe entry contents. + // + // The description must not contain Unicode non-characters as well as C0 + // and C1 control codes except tabs (HT), new lines (LF), carriage returns + // (CR), and page breaks (FF). + // The maximum size is 2000 bytes when encoded in UTF-8. + // Default value is an empty string. string description = 4; // Schema of the entry. An entry might not have any schema attached to it. @@ -909,6 +964,28 @@ message Entry { // with user_specified_type, this field is optional and defaults to an empty // timestamp. SystemTimestamps source_system_timestamps = 7; + + // Output only. Physical location of the entry. + DataSource data_source = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Specification that applies to a table resource. Only valid +// for entries of `TABLE` type. +message DatabaseTableSpec { + // Type of the table. + enum TableType { + // Default unknown table type. + TABLE_TYPE_UNSPECIFIED = 0; + + // Native table. + NATIVE = 1; + + // External table. + EXTERNAL = 2; + } + + // Type of this table. + TableType type = 1; } // EntryGroup Metadata. @@ -922,10 +999,10 @@ message EntryGroup { // The resource name of the entry group in URL format. Example: // - // * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id} + // `projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}` // - // Note that this EntryGroup and its child resources may not actually be - // stored in the location in this name. + // Note: The entry group itself and its child resources might not be + // stored in the location specified in its name. string name = 1; // A short name to identify the entry group, for example, @@ -937,10 +1014,8 @@ message EntryGroup { // string. string description = 3; - // Output only. Timestamps about this EntryGroup. Default value is empty - // timestamps. - SystemTimestamps data_catalog_timestamps = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. Timestamps about this EntryGroup. Default value is empty timestamps. + SystemTimestamps data_catalog_timestamps = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Request message for @@ -959,7 +1034,11 @@ message CreateTagTemplateRequest { } ]; - // Required. The id of the tag template to create. + // Required. The ID of the tag template to create. + // + // The ID must contain only lowercase letters (a-z), numbers (0-9), + // or underscores (_), and must start with a letter or underscore. + // The maximum size is 64 bytes when encoded in UTF-8. string tag_template_id = 3 [(google.api.field_behavior) = REQUIRED]; // Required. The tag template to create. @@ -986,13 +1065,12 @@ message UpdateTagTemplateRequest { // Required. The template to update. The "name" field must be set. TagTemplate tag_template = 1 [(google.api.field_behavior) = REQUIRED]; - // The field mask specifies the parts of the template to overwrite. - // - // Allowed fields: - // - // * `display_name` + // Names of fields whose values to overwrite on a tag template. Currently, + // only `display_name` can be overwritten. // - // If absent or empty, all of the allowed fields above will be updated. + // In general, if this parameter is absent or empty, all modifiable fields + // are overwritten. If such fields are non-required and omitted in the + // request body, their values are emptied. google.protobuf.FieldMask update_mask = 2; } @@ -1018,16 +1096,18 @@ message DeleteTagTemplateRequest { // Request message for // [CreateTag][google.cloud.datacatalog.v1.DataCatalog.CreateTag]. message CreateTagRequest { - // Required. The name of the resource to attach this tag to. Tags can be - // attached to Entries. Example: + // Required. The name of the resource to attach this tag to. Tags can be attached to + // entries. An entry can have up to 1000 attached tags. Example: // - // * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id} + // `projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}` // - // Note that this Tag and its child resources may not actually be stored in - // the location in this name. + // Note: The tag and its child resources might not be stored in + // the location specified in its name. string parent = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "datacatalog.googleapis.com/Tag" } + (google.api.resource_reference) = { + type: "datacatalog.googleapis.com/Tag" + } ]; // Required. The tag to create. @@ -1040,8 +1120,12 @@ message UpdateTagRequest { // Required. The updated tag. The "name" field must be set. Tag tag = 1 [(google.api.field_behavior) = REQUIRED]; - // The fields to update on the Tag. If absent or empty, all modifiable fields - // are updated. Currently the only modifiable field is the field `fields`. + // Names of fields whose values to overwrite on a tag. Currently, a tag has + // the only modifiable field with the name `fields`. + // + // In general, if this parameter is absent or empty, all modifiable fields + // are overwritten. If such fields are non-required and omitted in the + // request body, their values are emptied. google.protobuf.FieldMask update_mask = 2; } @@ -1076,15 +1160,17 @@ message CreateTagTemplateFieldRequest { ]; // Required. The ID of the tag template field to create. - // Field ids can contain letters (both uppercase and lowercase), numbers + // + // Note: Adding a required field to an existing template is *not* allowed. + // + // Field IDs can contain letters (both uppercase and lowercase), numbers // (0-9), underscores (_) and dashes (-). Field IDs must be at least 1 // character long and at most 128 characters long. Field IDs must also be // unique within their template. string tag_template_field_id = 2 [(google.api.field_behavior) = REQUIRED]; // Required. The tag template field to create. - TagTemplateField tag_template_field = 3 - [(google.api.field_behavior) = REQUIRED]; + TagTemplateField tag_template_field = 3 [(google.api.field_behavior) = REQUIRED]; } // Request message for @@ -1101,25 +1187,25 @@ message UpdateTagTemplateFieldRequest { ]; // Required. The template to update. - TagTemplateField tag_template_field = 2 - [(google.api.field_behavior) = REQUIRED]; + TagTemplateField tag_template_field = 2 [(google.api.field_behavior) = REQUIRED]; - // Optional. The field mask specifies the parts of the template to be updated. - // Allowed fields: + // Optional. Names of fields whose values to overwrite on an individual field of a tag + // template. The following fields are modifiable: // // * `display_name` // * `type.enum_type` // * `is_required` // - // If `update_mask` is not set or empty, all of the allowed fields above will - // be updated. + // If this parameter is absent or empty, all modifiable fields + // are overwritten. If such fields are non-required and omitted in the request + // body, their values are emptied with one exception: when updating an enum + // type, the provided values are merged with the existing values. Therefore, + // enum values can only be added, existing enum values cannot be deleted or + // renamed. // - // When updating an enum type, the provided values will be merged with the - // existing values. Therefore, enum values can only be added, existing enum - // values cannot be deleted nor renamed. Updating a template field from - // optional to required is NOT allowed. - google.protobuf.FieldMask update_mask = 3 - [(google.api.field_behavior) = OPTIONAL]; + // Additionally, updating a template field from optional to required is + // *not* allowed. + google.protobuf.FieldMask update_mask = 3 [(google.api.field_behavior) = OPTIONAL]; } // Request message for @@ -1135,11 +1221,27 @@ message RenameTagTemplateFieldRequest { } ]; - // Required. The new ID of this tag template field. For example, - // `my_new_field`. + // Required. The new ID of this tag template field. For example, `my_new_field`. string new_tag_template_field_id = 2 [(google.api.field_behavior) = REQUIRED]; } +// Request message for +// [RenameTagTemplateFieldEnumValue][google.cloud.datacatalog.v1.DataCatalog.RenameTagTemplateFieldEnumValue]. +message RenameTagTemplateFieldEnumValueRequest { + // Required. The name of the enum field value. Example: + // + // * projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}/fields/{tag_template_field_id}/enumValues/{enum_value_display_name} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datacatalog.googleapis.com/TagTemplateFieldEnumValue" + } + ]; + + // Required. The new display name of the enum value. For example, `my_new_enum_value`. + string new_enum_value_display_name = 2 [(google.api.field_behavior) = REQUIRED]; +} + // Request message for // [DeleteTagTemplateField][google.cloud.datacatalog.v1.DataCatalog.DeleteTagTemplateField]. message DeleteTagTemplateFieldRequest { @@ -1162,8 +1264,8 @@ message DeleteTagTemplateFieldRequest { // Request message for // [ListTags][google.cloud.datacatalog.v1.DataCatalog.ListTags]. message ListTagsRequest { - // Required. The name of the Data Catalog resource to list the tags of. The - // resource could be an [Entry][google.cloud.datacatalog.v1.Entry] or an + // Required. The name of the Data Catalog resource to list the tags of. The resource + // could be an [Entry][google.cloud.datacatalog.v1.Entry] or an // [EntryGroup][google.cloud.datacatalog.v1.EntryGroup]. // // Examples: @@ -1251,11 +1353,17 @@ enum EntryType { // https://cloud.google.com/bigquery-ml/docs/bigqueryml-intro MODEL = 5; - // Output only. An entry type which is used for streaming entries. Example: + // An entry type which is used for streaming entries. Example: // Pub/Sub topic. DATA_STREAM = 3; // An entry type which is a set of files or objects. Example: // Cloud Storage fileset. FILESET = 4; + + // A database. + DATABASE = 7; + + // A service, for example, a Dataproc Metastore service. + SERVICE = 14; } diff --git a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/gcs_fileset_spec.proto b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/gcs_fileset_spec.proto index bcf0ead651a..014364292e6 100644 --- a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/gcs_fileset_spec.proto +++ b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/gcs_fileset_spec.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/policytagmanager.proto b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/policytagmanager.proto new file mode 100644 index 00000000000..0412acc987a --- /dev/null +++ b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/policytagmanager.proto @@ -0,0 +1,464 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.datacatalog.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/datacatalog/v1/timestamps.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.DataCatalog.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/datacatalog/v1;datacatalog"; +option java_multiple_files = true; +option java_outer_classname = "PolicyTagManagerProto"; +option java_package = "com.google.cloud.datacatalog.v1"; +option php_namespace = "Google\\Cloud\\DataCatalog\\V1"; +option ruby_package = "Google::Cloud::DataCatalog::V1"; + +// Policy Tag Manager API service allows clients to manage their policy tags and +// taxonomies. +// +// Policy tags are used to tag BigQuery columns and apply additional access +// control policies. A taxonomy is a hierarchical grouping of policy tags that +// classify data along a common axis. +service PolicyTagManager { + option (google.api.default_host) = "datacatalog.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a taxonomy in a specified project. The taxonomy is initially empty, + // i.e., does not contain policy tags. + rpc CreateTaxonomy(CreateTaxonomyRequest) returns (Taxonomy) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/taxonomies" + body: "taxonomy" + }; + option (google.api.method_signature) = "parent,taxonomy"; + } + + // Deletes a taxonomy. This method will also delete all policy tags in this + // taxonomy, their associated policies, and the policy tags references from + // BigQuery columns. + rpc DeleteTaxonomy(DeleteTaxonomyRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/taxonomies/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a taxonomy. This method can update the taxonomy's display name, + // description, and activated policy types. + rpc UpdateTaxonomy(UpdateTaxonomyRequest) returns (Taxonomy) { + option (google.api.http) = { + patch: "/v1/{taxonomy.name=projects/*/locations/*/taxonomies/*}" + body: "taxonomy" + }; + option (google.api.method_signature) = "taxonomy"; + } + + // Lists all taxonomies in a project in a particular location that the caller + // has permission to view. + rpc ListTaxonomies(ListTaxonomiesRequest) returns (ListTaxonomiesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/taxonomies" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a taxonomy. + rpc GetTaxonomy(GetTaxonomyRequest) returns (Taxonomy) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/taxonomies/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a policy tag in a taxonomy. + rpc CreatePolicyTag(CreatePolicyTagRequest) returns (PolicyTag) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/taxonomies/*}/policyTags" + body: "policy_tag" + }; + option (google.api.method_signature) = "parent,policy_tag"; + } + + // Deletes a policy tag. This method also deletes: + // + // * all of its descendant policy tags, if any + // * the policies associated with the policy tag and its descendants + // * references from BigQuery table schema of the policy tag and its + // descendants. + rpc DeletePolicyTag(DeletePolicyTagRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/taxonomies/*/policyTags/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a policy tag. This method can update the policy tag's display + // name, description, and parent policy tag. + rpc UpdatePolicyTag(UpdatePolicyTagRequest) returns (PolicyTag) { + option (google.api.http) = { + patch: "/v1/{policy_tag.name=projects/*/locations/*/taxonomies/*/policyTags/*}" + body: "policy_tag" + }; + option (google.api.method_signature) = "policy_tag"; + } + + // Lists all policy tags in a taxonomy. + rpc ListPolicyTags(ListPolicyTagsRequest) returns (ListPolicyTagsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/taxonomies/*}/policyTags" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a policy tag. + rpc GetPolicyTag(GetPolicyTagRequest) returns (PolicyTag) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/taxonomies/*/policyTags/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets the IAM policy for a policy tag or a taxonomy. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1/{resource=projects/*/locations/*/taxonomies/*}:getIamPolicy" + body: "*" + additional_bindings { + post: "/v1/{resource=projects/*/locations/*/taxonomies/*/policyTags/*}:getIamPolicy" + body: "*" + } + }; + } + + // Sets the IAM policy for a policy tag or a taxonomy. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1/{resource=projects/*/locations/*/taxonomies/*}:setIamPolicy" + body: "*" + additional_bindings { + post: "/v1/{resource=projects/*/locations/*/taxonomies/*/policyTags/*}:setIamPolicy" + body: "*" + } + }; + } + + // Returns the permissions that a caller has on a specified policy tag or + // taxonomy. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v1/{resource=projects/*/locations/*/taxonomies/*}:testIamPermissions" + body: "*" + additional_bindings { + post: "/v1/{resource=projects/*/locations/*/taxonomies/*/policyTags/*}:testIamPermissions" + body: "*" + } + }; + } +} + +// A taxonomy is a collection of hierarchical policy tags that classify data +// along a common axis. For instance a "data sensitivity" taxonomy could contain +// the following policy tags: +// +// ``` +// + PII +// + Account number +// + Age +// + SSN +// + Zipcode +// + Financials +// + Revenue +// ``` +// +// A "data origin" taxonomy could contain the following policy tags: +// +// ``` +// + User data +// + Employee data +// + Partner data +// + Public data +// ``` +message Taxonomy { + option (google.api.resource) = { + type: "datacatalog.googleapis.com/Taxonomy" + pattern: "projects/{project}/locations/{location}/taxonomies/{taxonomy}" + }; + + // Defines policy types where the policy tags can be used for. + enum PolicyType { + // Unspecified policy type. + POLICY_TYPE_UNSPECIFIED = 0; + + // Fine-grained access control policy, which enables access control on + // tagged sub-resources. + FINE_GRAINED_ACCESS_CONTROL = 1; + } + + // Output only. Resource name of this taxonomy in format: + // "projects/{project_number}/locations/{location_id}/taxonomies/{taxonomy_id}". + // Note that taxonomy_id's are unique and generated by Policy Tag Manager. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. User-defined name of this taxonomy. It must: contain only unicode letters, + // numbers, underscores, dashes and spaces; not start or end with spaces; and + // be at most 200 bytes long when encoded in UTF-8. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Description of this taxonomy. It must: contain only unicode characters, + // tabs, newlines, carriage returns and page breaks; and be at most 2000 bytes + // long when encoded in UTF-8. If not set, defaults to an empty description. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Number of policy tags contained in this taxonomy. + int32 policy_tag_count = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamps about this taxonomy. Only create_time and update_time are used. + SystemTimestamps taxonomy_timestamps = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. A list of policy types that are activated for this taxonomy. If not set, + // defaults to an empty list. + repeated PolicyType activated_policy_types = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Denotes one policy tag in a taxonomy (e.g. ssn). Policy tags can be defined +// in a hierarchy. For example, consider the following hierarchy: +// +// ``` +// + Geolocation +// + LatLong +// + City +// + ZipCode +// ``` +// +// Policy tag "Geolocation" contains 3 child policy tags: "LatLong", "City", and +// "ZipCode". +message PolicyTag { + option (google.api.resource) = { + type: "datacatalog.googleapis.com/PolicyTag" + pattern: "projects/{project}/locations/{location}/taxonomies/{taxonomy}/policyTags/{policy_tag}" + }; + + // Output only. Resource name of this policy tag in format: + // "projects/{project_number}/locations/{location_id}/taxonomies/{taxonomy_id}/policyTags/{policy_tag_id}". + // Both taxonomy_ids and policy_tag_ids are unique and generated by Policy Tag + // Manager. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. User-defined name of this policy tag. It must: be unique within the parent + // taxonomy; contain only unicode letters, numbers, underscores, dashes and + // spaces; not start or end with spaces; and be at most 200 bytes long when + // encoded in UTF-8. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Description of this policy tag. It must: contain only unicode characters, + // tabs, newlines, carriage returns and page breaks; and be at most 2000 bytes + // long when encoded in UTF-8. If not set, defaults to an empty description. + // If not set, defaults to an empty description. + string description = 3; + + // Resource name of this policy tag's parent policy tag (e.g. for the + // "LatLong" policy tag in the example above, this field contains the + // resource name of the "Geolocation" policy tag). If empty, it means this + // policy tag is a top level policy tag (e.g. this field is empty for the + // "Geolocation" policy tag in the example above). If not set, defaults to an + // empty string. + string parent_policy_tag = 4; + + // Output only. Resource names of child policy tags of this policy tag. + repeated string child_policy_tags = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for +// [CreateTaxonomy][google.cloud.datacatalog.v1.PolicyTagManager.CreateTaxonomy]. +message CreateTaxonomyRequest { + // Required. Resource name of the project that the taxonomy will belong to. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "datacatalog.googleapis.com/Taxonomy" + } + ]; + + // The taxonomy to be created. + Taxonomy taxonomy = 2; +} + +// Request message for +// [DeleteTaxonomy][google.cloud.datacatalog.v1.PolicyTagManager.DeleteTaxonomy]. +message DeleteTaxonomyRequest { + // Required. Resource name of the taxonomy to be deleted. All policy tags in + // this taxonomy will also be deleted. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datacatalog.googleapis.com/Taxonomy" + } + ]; +} + +// Request message for +// [UpdateTaxonomy][google.cloud.datacatalog.v1.PolicyTagManager.UpdateTaxonomy]. +message UpdateTaxonomyRequest { + // The taxonomy to update. Only description, display_name, and activated + // policy types can be updated. + Taxonomy taxonomy = 1; + + // The update mask applies to the resource. For the `FieldMask` definition, + // see + // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + // If not set, defaults to all of the fields that are allowed to update. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for +// [ListTaxonomies][google.cloud.datacatalog.v1.PolicyTagManager.ListTaxonomies]. +message ListTaxonomiesRequest { + // Required. Resource name of the project to list the taxonomies of. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "datacatalog.googleapis.com/Taxonomy" + } + ]; + + // The maximum number of items to return. Must be a value between 1 and 1000. + // If not set, defaults to 50. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request, if any. If + // not set, defaults to an empty string. + string page_token = 3; +} + +// Response message for +// [ListTaxonomies][google.cloud.datacatalog.v1.PolicyTagManager.ListTaxonomies]. +message ListTaxonomiesResponse { + // Taxonomies that the project contains. + repeated Taxonomy taxonomies = 1; + + // Token used to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// Request message for +// [GetTaxonomy][google.cloud.datacatalog.v1.PolicyTagManager.GetTaxonomy]. +message GetTaxonomyRequest { + // Required. Resource name of the requested taxonomy. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datacatalog.googleapis.com/Taxonomy" + } + ]; +} + +// Request message for +// [CreatePolicyTag][google.cloud.datacatalog.v1.PolicyTagManager.CreatePolicyTag]. +message CreatePolicyTagRequest { + // Required. Resource name of the taxonomy that the policy tag will belong to. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "datacatalog.googleapis.com/PolicyTag" + } + ]; + + // The policy tag to be created. + PolicyTag policy_tag = 2; +} + +// Request message for +// [DeletePolicyTag][google.cloud.datacatalog.v1.PolicyTagManager.DeletePolicyTag]. +message DeletePolicyTagRequest { + // Required. Resource name of the policy tag to be deleted. All of its descendant + // policy tags will also be deleted. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datacatalog.googleapis.com/PolicyTag" + } + ]; +} + +// Request message for +// [UpdatePolicyTag][google.cloud.datacatalog.v1.PolicyTagManager.UpdatePolicyTag]. +message UpdatePolicyTagRequest { + // The policy tag to update. Only the description, display_name, and + // parent_policy_tag fields can be updated. + PolicyTag policy_tag = 1; + + // The update mask applies to the resource. Only display_name, description and + // parent_policy_tag can be updated and thus can be listed in the mask. If + // update_mask is not provided, all allowed fields (i.e. display_name, + // description and parent) will be updated. For more information including the + // `FieldMask` definition, see + // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + // If not set, defaults to all of the fields that are allowed to update. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for +// [ListPolicyTags][google.cloud.datacatalog.v1.PolicyTagManager.ListPolicyTags]. +message ListPolicyTagsRequest { + // Required. Resource name of the taxonomy to list the policy tags of. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "datacatalog.googleapis.com/PolicyTag" + } + ]; + + // The maximum number of items to return. Must be a value between 1 and 1000. + // If not set, defaults to 50. + int32 page_size = 2; + + // The next_page_token value returned from a previous List request, if any. If + // not set, defaults to an empty string. + string page_token = 3; +} + +// Response message for +// [ListPolicyTags][google.cloud.datacatalog.v1.PolicyTagManager.ListPolicyTags]. +message ListPolicyTagsResponse { + // The policy tags that are in the requested taxonomy. + repeated PolicyTag policy_tags = 1; + + // Token used to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// Request message for +// [GetPolicyTag][google.cloud.datacatalog.v1.PolicyTagManager.GetPolicyTag]. +message GetPolicyTagRequest { + // Required. Resource name of the requested policy tag. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datacatalog.googleapis.com/PolicyTag" + } + ]; +} diff --git a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/policytagmanagerserialization.proto b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/policytagmanagerserialization.proto new file mode 100644 index 00000000000..29b1d3df7b9 --- /dev/null +++ b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/policytagmanagerserialization.proto @@ -0,0 +1,186 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.datacatalog.v1; + +import "google/api/annotations.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/datacatalog/v1/policytagmanager.proto"; +import "google/iam/v1/policy.proto"; +import "google/api/client.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.DataCatalog.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/datacatalog/v1;datacatalog"; +option java_multiple_files = true; +option java_outer_classname = "PolicyTagManagerSerializationProto"; +option java_package = "com.google.cloud.datacatalog.v1"; +option php_namespace = "Google\\Cloud\\DataCatalog\\V1"; +option ruby_package = "Google::Cloud::DataCatalog::V1"; + +// Policy Tag Manager serialization API service allows clients to manipulate +// their policy tags and taxonomies in serialized format, where taxonomy is a +// hierarchical group of policy tags. +service PolicyTagManagerSerialization { + option (google.api.default_host) = "datacatalog.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates new taxonomies (including their policy tags) by importing from + // inlined source or cross-regional source. New taxonomies will be created in + // a given parent project. + // + // If using the cross-regional source, a new taxonomy is created by copying + // from a source in another region. + // + // If using the inlined source, this method provides a way to bulk create + // taxonomies and policy tags using nested proto structure. + rpc ImportTaxonomies(ImportTaxonomiesRequest) returns (ImportTaxonomiesResponse) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/taxonomies:import" + body: "*" + }; + } + + // Exports taxonomies as the requested type and returns the taxonomies + // including their policy tags. The requested taxonomies must belong to one + // project. + // + // SerializedTaxonomy protos with nested policy tags that are generated by + // this method can be used as input for future ImportTaxonomies calls. + rpc ExportTaxonomies(ExportTaxonomiesRequest) returns (ExportTaxonomiesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/taxonomies:export" + }; + } +} + +// Message representing a taxonomy, including its policy tags in hierarchy, as a +// nested proto. Used for taxonomy replacement, import, and export. +message SerializedTaxonomy { + // Required. Display name of the taxonomy. At most 200 bytes when encoded in UTF-8. + string display_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Description of the serialized taxonomy. At most 2000 bytes when encoded in + // UTF-8. If not set, defaults to an empty description. + string description = 2; + + // Top level policy tags associated with the taxonomy, if any. + repeated SerializedPolicyTag policy_tags = 3; + + // A list of policy types that are activated per taxonomy. + repeated Taxonomy.PolicyType activated_policy_types = 4; +} + +// Message representing one policy tag, including all its descendant policy +// tags, as a nested proto. +message SerializedPolicyTag { + // Resource name of the policy tag. + // + // This field will be ignored when calling ImportTaxonomies. + string policy_tag = 1; + + // Required. Display name of the policy tag. At most 200 bytes when encoded in UTF-8. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Description of the serialized policy tag. The length of the description is + // limited to 2000 bytes when encoded in UTF-8. If not set, defaults to an + // empty description. + string description = 3; + + // Children of the policy tag, if any. + repeated SerializedPolicyTag child_policy_tags = 4; +} + +// Request message for +// [ImportTaxonomies][google.cloud.datacatalog.v1.PolicyTagManagerSerialization.ImportTaxonomies]. +message ImportTaxonomiesRequest { + // Required. Resource name of project that the imported taxonomies will belong to. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "datacatalog.googleapis.com/Taxonomy" + } + ]; + + // Source taxonomies to be imported. + oneof source { + // Inline source used for taxonomies import. + InlineSource inline_source = 2; + + // Cross-regional source taxonomy to be imported. + CrossRegionalSource cross_regional_source = 3; + } +} + +// Inline source containing taxonomies to import. +message InlineSource { + // Required. Taxonomies to be imported. + repeated SerializedTaxonomy taxonomies = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Cross-regional source used to import an existing taxonomy into a different +// region. +message CrossRegionalSource { + // Required. The resource name of the source taxonomy to be imported. + string taxonomy = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datacatalog.googleapis.com/Taxonomy" + } + ]; +} + +// Response message for +// [ImportTaxonomies][google.cloud.datacatalog.v1.PolicyTagManagerSerialization.ImportTaxonomies]. +message ImportTaxonomiesResponse { + // Taxonomies that were imported. + repeated Taxonomy taxonomies = 1; +} + +// Request message for +// [ExportTaxonomies][google.cloud.datacatalog.v1.PolicyTagManagerSerialization.ExportTaxonomies]. +message ExportTaxonomiesRequest { + // Required. Resource name of the project that the exported taxonomies belong to. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "datacatalog.googleapis.com/Taxonomy" + } + ]; + + // Required. Resource names of the taxonomies to be exported. + repeated string taxonomies = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datacatalog.googleapis.com/Taxonomy" + } + ]; + + // Required. Taxonomies export destination. + oneof destination { + // Export taxonomies as serialized taxonomies, which contain all the policy + // tags as nested protos. + bool serialized_taxonomies = 3; + } +} + +// Response message for +// [ExportTaxonomies][google.cloud.datacatalog.v1.PolicyTagManagerSerialization.ExportTaxonomies]. +message ExportTaxonomiesResponse { + // List of taxonomies and policy tags as nested protos. + repeated SerializedTaxonomy taxonomies = 1; +} diff --git a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/schema.proto b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/schema.proto index c34d99e2777..24f7fb8879c 100644 --- a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/schema.proto +++ b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/schema.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -28,25 +28,37 @@ option ruby_package = "Google::Cloud::DataCatalog::V1"; // Represents a schema (e.g. BigQuery, GoogleSQL, Avro schema). message Schema { - // Required. Schema of columns. A maximum of 10,000 columns and sub-columns can be - // specified. - repeated ColumnSchema columns = 2 [(google.api.field_behavior) = REQUIRED]; + // The unified GoogleSQL-like schema of columns. + // + // The overall maximum number of columns and nested columns is 10,000. + // The maximum nested depth is 15 levels. + repeated ColumnSchema columns = 2; } // Representation of a column within a schema. Columns could be nested inside // other columns. message ColumnSchema { // Required. Name of the column. + // + // Must be a UTF-8 string without dots (.). + // The maximum size is 64 bytes. string column = 6 [(google.api.field_behavior) = REQUIRED]; // Required. Type of the column. + // + // Must be a UTF-8 string with the maximum size of 128 bytes. string type = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. Description of the column. Default value is an empty string. + // + // The description must be a UTF-8 string with the maximum size of 2000 + // bytes. string description = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. A column's mode indicates whether the values in this column are required, - // nullable, etc. Only `NULLABLE`, `REQUIRED` and `REPEATED` are supported. + // Optional. A column's mode indicates if values in this column are required, + // nullable, or repeated. + // + // Only `NULLABLE`, `REQUIRED`, and `REPEATED` values are supported. // Default mode is `NULLABLE`. string mode = 3 [(google.api.field_behavior) = OPTIONAL]; diff --git a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/search.proto b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/search.proto index 37f6923b13a..09373923632 100644 --- a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/search.proto +++ b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/search.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -55,6 +55,9 @@ message SearchCatalogResult { // * `//bigquery.googleapis.com/projects/projectId/datasets/datasetId/tables/tableId` string linked_resource = 4; + // Last-modified timestamp of the entry from the managing system. + google.protobuf.Timestamp modify_time = 7; + // The source system of the entry. Only applicable when `search_result_type` // is ENTRY. oneof system { @@ -66,6 +69,17 @@ message SearchCatalogResult { // integrate with. string user_specified_system = 9; } + + // Fully Qualified Name of the resource. + // There are two main forms of FQNs: + // {system}:{project}.{dot-separated path to resource} + // for non-regionalized resources + // {system}:{project}.{location id}.{dot-separated path to resource} + // for regionalized resources + // Examples: + // * dataproc_metastore:projectId.locationId.instanceId.databaseId.tableId + // * bigquery:table.project_id.dataset_id.table_id + string fully_qualified_name = 10; } // The different types of resources that can be returned in search. diff --git a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/table_spec.proto b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/table_spec.proto index c87afc54c6d..43ce0df19cd 100644 --- a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/table_spec.proto +++ b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/table_spec.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -54,6 +54,9 @@ enum TableSourceType { // BigQuery native table. BIGQUERY_TABLE = 5; + + // BigQuery materialized view. + BIGQUERY_MATERIALIZED_VIEW = 7; } // Table view specification. diff --git a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/tags.proto b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/tags.proto index 4efefa522c9..9ef2e4528fe 100644 --- a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/tags.proto +++ b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/tags.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -42,15 +42,17 @@ message Tag { // The resource name of the tag in URL format. Example: // - // * projects/{project_id}/locations/{location}/entrygroups/{entry_group_id}/entries/{entry_id}/tags/{tag_id} + // `projects/{project_id}/locations/{location}/entrygroups/{entry_group_id}/entries/{entry_id}/tags/{tag_id}` // // where `tag_id` is a system-generated identifier. - // Note that this Tag may not actually be stored in the location in this name. + // + // Note: The tag itself might not be stored in the location specified in its + // name. string name = 1; // Required. The resource name of the tag template that this tag uses. Example: // - // * projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id} + // `projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}` // // This field cannot be modified after creation. string template = 2 [(google.api.field_behavior) = REQUIRED]; @@ -63,13 +65,11 @@ message Tag { // Deleting the scope from the parent resource will delete all tags attached // to that scope. These fields cannot be updated after creation. oneof scope { - // Resources like Entry can have schemas associated with them. This scope + // Resources like entry can have schemas associated with them. This scope // allows users to attach tags to an individual column based on that schema. // - // For attaching a tag to a nested column, use `.` to separate the column - // names. Example: - // - // * `outer_column.inner_column` + // To attach a tag to a nested column, separate column names with a dot + // (`.`). Example: `column.nested_column`. string column = 4; } @@ -97,6 +97,7 @@ message TagField { double double_value = 2; // Holds the value for a tag field with string type. + // The maximum length is 2000 UTF-8 characters. string string_value = 3; // Holds the value for a tag field with boolean type. @@ -134,13 +135,17 @@ message TagTemplate { // The resource name of the tag template in URL format. Example: // - // * projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id} + // `projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}` // - // Note that this TagTemplate and its child resources may not actually be - // stored in the location in this name. + // Note: The tag template itself and its child resources might not be + // stored in the location specified in its name. string name = 1; - // The display name for this template. Defaults to an empty string. + // Display name for this template. Defaults to an empty string. + // + // The name must contain only Unicode letters, numbers (0-9), underscores (_), + // dashes (-), spaces ( ), and can't start or end with spaces. + // The maximum length is 200 characters. string display_name = 2; // Required. Map of tag template field IDs to the settings for the field. @@ -163,13 +168,21 @@ message TagTemplateField { // Output only. The resource name of the tag template field in URL format. Example: // - // * projects/{project_id}/locations/{location}/tagTemplates/{tag_template}/fields/{field} + // `projects/{project_id}/locations/{location}/tagTemplates/{tag_template}/fields/{field}` + // + // Note: The `TagTemplateField` itself might not be stored in the location + // specified in its name. // - // Note that this TagTemplateField may not actually be stored in the location - // in this name. + // The name must contain only letters (a-z, A-Z), numbers (0-9), + // or underscores (_), and must start with a letter or underscore. + // The maximum length is 64 characters. string name = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; // The display name for this field. Defaults to an empty string. + // + // The name must contain only Unicode letters, numbers (0-9), underscores (_), + // dashes (-), spaces ( ), and can't start or end with spaces. + // The maximum length is 200 characters. string display_name = 1; // Required. The type of value this tag field can contain. @@ -178,6 +191,9 @@ message TagTemplateField { // Whether this is a required field. Defaults to false. bool is_required = 3; + // The description for this field. Defaults to an empty string. + string description = 4; + // The order of this field with respect to other fields in this tag // template. For example, a higher value can indicate a more important field. // The value can be negative. Multiple fields can have the same order, and @@ -189,15 +205,22 @@ message FieldType { message EnumType { message EnumValue { // Required. The display name of the enum value. Must not be an empty string. + // + // The name must contain only Unicode letters, numbers (0-9), underscores + // (_), dashes (-), spaces ( ), and can't start or end with spaces. The + // maximum length is 200 characters. string display_name = 1 [(google.api.field_behavior) = REQUIRED]; } - // Required on create; optional on update. The set of allowed values for - // this enum. This set must not be empty, the display names of the values in - // this set must not be empty and the display names of the values must be - // case-insensitively unique within this set. Currently, enum values can - // only be added to the list of allowed values. Deletion and renaming of - // enum values are not supported. Can have up to 500 allowed values. + // The set of allowed values for this enum. + // + // This set must not be empty and can include up to 100 allowed values. + // The display names of the values in this set must not be empty and must + // be case-insensitively unique within this set. + // + // The order of items in this set is preserved. This field can be used to + // create, remove and reorder enum values. To rename enum values, use the + // `RenameTagTemplateFieldEnumValue` method. repeated EnumValue allowed_values = 1; } diff --git a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/timestamps.proto b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/timestamps.proto index a4372ae3c77..6566ce688e9 100644 --- a/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/timestamps.proto +++ b/packages/google-cloud-datacatalog/protos/google/cloud/datacatalog/v1/timestamps.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-datacatalog/protos/protos.d.ts b/packages/google-cloud-datacatalog/protos/protos.d.ts index 457951df4c7..577138c1429 100644 --- a/packages/google-cloud-datacatalog/protos/protos.d.ts +++ b/packages/google-cloud-datacatalog/protos/protos.d.ts @@ -30,7 +30,114 @@ export namespace google { enum IntegratedSystem { INTEGRATED_SYSTEM_UNSPECIFIED = 0, BIGQUERY = 1, - CLOUD_PUBSUB = 2 + CLOUD_PUBSUB = 2, + DATAPROC_METASTORE = 3 + } + + /** Properties of a DataSource. */ + interface IDataSource { + + /** DataSource service */ + service?: (google.cloud.datacatalog.v1.DataSource.Service|keyof typeof google.cloud.datacatalog.v1.DataSource.Service|null); + + /** DataSource resource */ + resource?: (string|null); + } + + /** Represents a DataSource. */ + class DataSource implements IDataSource { + + /** + * Constructs a new DataSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datacatalog.v1.IDataSource); + + /** DataSource service. */ + public service: (google.cloud.datacatalog.v1.DataSource.Service|keyof typeof google.cloud.datacatalog.v1.DataSource.Service); + + /** DataSource resource. */ + public resource: string; + + /** + * Creates a new DataSource instance using the specified properties. + * @param [properties] Properties to set + * @returns DataSource instance + */ + public static create(properties?: google.cloud.datacatalog.v1.IDataSource): google.cloud.datacatalog.v1.DataSource; + + /** + * Encodes the specified DataSource message. Does not implicitly {@link google.cloud.datacatalog.v1.DataSource.verify|verify} messages. + * @param message DataSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datacatalog.v1.IDataSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataSource message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.DataSource.verify|verify} messages. + * @param message DataSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datacatalog.v1.IDataSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datacatalog.v1.DataSource; + + /** + * Decodes a DataSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datacatalog.v1.DataSource; + + /** + * Verifies a DataSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datacatalog.v1.DataSource; + + /** + * Creates a plain object from a DataSource message. Also converts values to other types if specified. + * @param message DataSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datacatalog.v1.DataSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace DataSource { + + /** Service enum. */ + enum Service { + SERVICE_UNSPECIFIED = 0, + CLOUD_STORAGE = 1, + BIGQUERY = 2 + } } /** Represents a DataCatalog */ @@ -319,6 +426,20 @@ export namespace google { */ public renameTagTemplateField(request: google.cloud.datacatalog.v1.IRenameTagTemplateFieldRequest): Promise; + /** + * Calls RenameTagTemplateFieldEnumValue. + * @param request RenameTagTemplateFieldEnumValueRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TagTemplateField + */ + public renameTagTemplateFieldEnumValue(request: google.cloud.datacatalog.v1.IRenameTagTemplateFieldEnumValueRequest, callback: google.cloud.datacatalog.v1.DataCatalog.RenameTagTemplateFieldEnumValueCallback): void; + + /** + * Calls RenameTagTemplateFieldEnumValue. + * @param request RenameTagTemplateFieldEnumValueRequest message or plain object + * @returns Promise + */ + public renameTagTemplateFieldEnumValue(request: google.cloud.datacatalog.v1.IRenameTagTemplateFieldEnumValueRequest): Promise; + /** * Calls DeleteTagTemplateField. * @param request DeleteTagTemplateFieldRequest message or plain object @@ -567,6 +688,13 @@ export namespace google { */ type RenameTagTemplateFieldCallback = (error: (Error|null), response?: google.cloud.datacatalog.v1.TagTemplateField) => void; + /** + * Callback as used by {@link google.cloud.datacatalog.v1.DataCatalog#renameTagTemplateFieldEnumValue}. + * @param error Error, if any + * @param [response] TagTemplateField + */ + type RenameTagTemplateFieldEnumValueCallback = (error: (Error|null), response?: google.cloud.datacatalog.v1.TagTemplateField) => void; + /** * Callback as used by {@link google.cloud.datacatalog.v1.DataCatalog#deleteTagTemplateField}. * @param error Error, if any @@ -1925,6 +2053,9 @@ export namespace google { /** LookupEntryRequest sqlResource */ sqlResource?: (string|null); + + /** LookupEntryRequest fullyQualifiedName */ + fullyQualifiedName?: (string|null); } /** Represents a LookupEntryRequest. */ @@ -1942,8 +2073,11 @@ export namespace google { /** LookupEntryRequest sqlResource. */ public sqlResource: string; + /** LookupEntryRequest fullyQualifiedName. */ + public fullyQualifiedName: string; + /** LookupEntryRequest targetName. */ - public targetName?: ("linkedResource"|"sqlResource"); + public targetName?: ("linkedResource"|"sqlResource"|"fullyQualifiedName"); /** * Creates a new LookupEntryRequest instance using the specified properties. @@ -2025,6 +2159,9 @@ export namespace google { /** Entry linkedResource */ linkedResource?: (string|null); + /** Entry fullyQualifiedName */ + fullyQualifiedName?: (string|null); + /** Entry type */ type?: (google.cloud.datacatalog.v1.EntryType|keyof typeof google.cloud.datacatalog.v1.EntryType|null); @@ -2046,6 +2183,9 @@ export namespace google { /** Entry bigqueryDateShardedSpec */ bigqueryDateShardedSpec?: (google.cloud.datacatalog.v1.IBigQueryDateShardedSpec|null); + /** Entry databaseTableSpec */ + databaseTableSpec?: (google.cloud.datacatalog.v1.IDatabaseTableSpec|null); + /** Entry displayName */ displayName?: (string|null); @@ -2057,6 +2197,9 @@ export namespace google { /** Entry sourceSystemTimestamps */ sourceSystemTimestamps?: (google.cloud.datacatalog.v1.ISystemTimestamps|null); + + /** Entry dataSource */ + dataSource?: (google.cloud.datacatalog.v1.IDataSource|null); } /** Represents an Entry. */ @@ -2074,6 +2217,9 @@ export namespace google { /** Entry linkedResource. */ public linkedResource: string; + /** Entry fullyQualifiedName. */ + public fullyQualifiedName: string; + /** Entry type. */ public type: (google.cloud.datacatalog.v1.EntryType|keyof typeof google.cloud.datacatalog.v1.EntryType); @@ -2095,6 +2241,9 @@ export namespace google { /** Entry bigqueryDateShardedSpec. */ public bigqueryDateShardedSpec?: (google.cloud.datacatalog.v1.IBigQueryDateShardedSpec|null); + /** Entry databaseTableSpec. */ + public databaseTableSpec?: (google.cloud.datacatalog.v1.IDatabaseTableSpec|null); + /** Entry displayName. */ public displayName: string; @@ -2107,6 +2256,9 @@ export namespace google { /** Entry sourceSystemTimestamps. */ public sourceSystemTimestamps?: (google.cloud.datacatalog.v1.ISystemTimestamps|null); + /** Entry dataSource. */ + public dataSource?: (google.cloud.datacatalog.v1.IDataSource|null); + /** Entry entryType. */ public entryType?: ("type"|"userSpecifiedType"); @@ -2116,6 +2268,9 @@ export namespace google { /** Entry typeSpec. */ public typeSpec?: ("gcsFilesetSpec"|"bigqueryTableSpec"|"bigqueryDateShardedSpec"); + /** Entry spec. */ + public spec?: "databaseTableSpec"; + /** * Creates a new Entry instance using the specified properties. * @param [properties] Properties to set @@ -2187,6 +2342,106 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a DatabaseTableSpec. */ + interface IDatabaseTableSpec { + + /** DatabaseTableSpec type */ + type?: (google.cloud.datacatalog.v1.DatabaseTableSpec.TableType|keyof typeof google.cloud.datacatalog.v1.DatabaseTableSpec.TableType|null); + } + + /** Represents a DatabaseTableSpec. */ + class DatabaseTableSpec implements IDatabaseTableSpec { + + /** + * Constructs a new DatabaseTableSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datacatalog.v1.IDatabaseTableSpec); + + /** DatabaseTableSpec type. */ + public type: (google.cloud.datacatalog.v1.DatabaseTableSpec.TableType|keyof typeof google.cloud.datacatalog.v1.DatabaseTableSpec.TableType); + + /** + * Creates a new DatabaseTableSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns DatabaseTableSpec instance + */ + public static create(properties?: google.cloud.datacatalog.v1.IDatabaseTableSpec): google.cloud.datacatalog.v1.DatabaseTableSpec; + + /** + * Encodes the specified DatabaseTableSpec message. Does not implicitly {@link google.cloud.datacatalog.v1.DatabaseTableSpec.verify|verify} messages. + * @param message DatabaseTableSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datacatalog.v1.IDatabaseTableSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DatabaseTableSpec message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.DatabaseTableSpec.verify|verify} messages. + * @param message DatabaseTableSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datacatalog.v1.IDatabaseTableSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DatabaseTableSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DatabaseTableSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datacatalog.v1.DatabaseTableSpec; + + /** + * Decodes a DatabaseTableSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DatabaseTableSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datacatalog.v1.DatabaseTableSpec; + + /** + * Verifies a DatabaseTableSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DatabaseTableSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DatabaseTableSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datacatalog.v1.DatabaseTableSpec; + + /** + * Creates a plain object from a DatabaseTableSpec message. Also converts values to other types if specified. + * @param message DatabaseTableSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datacatalog.v1.DatabaseTableSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DatabaseTableSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace DatabaseTableSpec { + + /** TableType enum. */ + enum TableType { + TABLE_TYPE_UNSPECIFIED = 0, + NATIVE = 1, + EXTERNAL = 2 + } + } + /** Properties of an EntryGroup. */ interface IEntryGroup { @@ -3261,6 +3516,102 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a RenameTagTemplateFieldEnumValueRequest. */ + interface IRenameTagTemplateFieldEnumValueRequest { + + /** RenameTagTemplateFieldEnumValueRequest name */ + name?: (string|null); + + /** RenameTagTemplateFieldEnumValueRequest newEnumValueDisplayName */ + newEnumValueDisplayName?: (string|null); + } + + /** Represents a RenameTagTemplateFieldEnumValueRequest. */ + class RenameTagTemplateFieldEnumValueRequest implements IRenameTagTemplateFieldEnumValueRequest { + + /** + * Constructs a new RenameTagTemplateFieldEnumValueRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datacatalog.v1.IRenameTagTemplateFieldEnumValueRequest); + + /** RenameTagTemplateFieldEnumValueRequest name. */ + public name: string; + + /** RenameTagTemplateFieldEnumValueRequest newEnumValueDisplayName. */ + public newEnumValueDisplayName: string; + + /** + * Creates a new RenameTagTemplateFieldEnumValueRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RenameTagTemplateFieldEnumValueRequest instance + */ + public static create(properties?: google.cloud.datacatalog.v1.IRenameTagTemplateFieldEnumValueRequest): google.cloud.datacatalog.v1.RenameTagTemplateFieldEnumValueRequest; + + /** + * Encodes the specified RenameTagTemplateFieldEnumValueRequest message. Does not implicitly {@link google.cloud.datacatalog.v1.RenameTagTemplateFieldEnumValueRequest.verify|verify} messages. + * @param message RenameTagTemplateFieldEnumValueRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datacatalog.v1.IRenameTagTemplateFieldEnumValueRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RenameTagTemplateFieldEnumValueRequest message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.RenameTagTemplateFieldEnumValueRequest.verify|verify} messages. + * @param message RenameTagTemplateFieldEnumValueRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datacatalog.v1.IRenameTagTemplateFieldEnumValueRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RenameTagTemplateFieldEnumValueRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RenameTagTemplateFieldEnumValueRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datacatalog.v1.RenameTagTemplateFieldEnumValueRequest; + + /** + * Decodes a RenameTagTemplateFieldEnumValueRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RenameTagTemplateFieldEnumValueRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datacatalog.v1.RenameTagTemplateFieldEnumValueRequest; + + /** + * Verifies a RenameTagTemplateFieldEnumValueRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RenameTagTemplateFieldEnumValueRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RenameTagTemplateFieldEnumValueRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datacatalog.v1.RenameTagTemplateFieldEnumValueRequest; + + /** + * Creates a plain object from a RenameTagTemplateFieldEnumValueRequest message. Also converts values to other types if specified. + * @param message RenameTagTemplateFieldEnumValueRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datacatalog.v1.RenameTagTemplateFieldEnumValueRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RenameTagTemplateFieldEnumValueRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a DeleteTagTemplateFieldRequest. */ interface IDeleteTagTemplateFieldRequest { @@ -3765,7 +4116,9 @@ export namespace google { TABLE = 2, MODEL = 5, DATA_STREAM = 3, - FILESET = 4 + FILESET = 4, + DATABASE = 7, + SERVICE = 14 } /** Properties of a GcsFilesetSpec. */ @@ -4287,11 +4640,17 @@ export namespace google { /** SearchCatalogResult linkedResource */ linkedResource?: (string|null); + /** SearchCatalogResult modifyTime */ + modifyTime?: (google.protobuf.ITimestamp|null); + /** SearchCatalogResult integratedSystem */ integratedSystem?: (google.cloud.datacatalog.v1.IntegratedSystem|keyof typeof google.cloud.datacatalog.v1.IntegratedSystem|null); /** SearchCatalogResult userSpecifiedSystem */ userSpecifiedSystem?: (string|null); + + /** SearchCatalogResult fullyQualifiedName */ + fullyQualifiedName?: (string|null); } /** Represents a SearchCatalogResult. */ @@ -4315,12 +4674,18 @@ export namespace google { /** SearchCatalogResult linkedResource. */ public linkedResource: string; + /** SearchCatalogResult modifyTime. */ + public modifyTime?: (google.protobuf.ITimestamp|null); + /** SearchCatalogResult integratedSystem. */ public integratedSystem: (google.cloud.datacatalog.v1.IntegratedSystem|keyof typeof google.cloud.datacatalog.v1.IntegratedSystem); /** SearchCatalogResult userSpecifiedSystem. */ public userSpecifiedSystem: string; + /** SearchCatalogResult fullyQualifiedName. */ + public fullyQualifiedName: string; + /** SearchCatalogResult system. */ public system?: ("integratedSystem"|"userSpecifiedSystem"); @@ -4512,7 +4877,8 @@ export namespace google { enum TableSourceType { TABLE_SOURCE_TYPE_UNSPECIFIED = 0, BIGQUERY_VIEW = 2, - BIGQUERY_TABLE = 5 + BIGQUERY_TABLE = 5, + BIGQUERY_MATERIALIZED_VIEW = 7 } /** Properties of a ViewSpec. */ @@ -5253,6 +5619,9 @@ export namespace google { /** TagTemplateField isRequired */ isRequired?: (boolean|null); + /** TagTemplateField description */ + description?: (string|null); + /** TagTemplateField order */ order?: (number|null); } @@ -5278,6 +5647,9 @@ export namespace google { /** TagTemplateField isRequired. */ public isRequired: boolean; + /** TagTemplateField description. */ + public description: string; + /** TagTemplateField order. */ public order: number; @@ -5381,270 +5753,2802 @@ export namespace google { public typeDecl?: ("primitiveType"|"enumType"); /** - * Creates a new FieldType instance using the specified properties. + * Creates a new FieldType instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldType instance + */ + public static create(properties?: google.cloud.datacatalog.v1.IFieldType): google.cloud.datacatalog.v1.FieldType; + + /** + * Encodes the specified FieldType message. Does not implicitly {@link google.cloud.datacatalog.v1.FieldType.verify|verify} messages. + * @param message FieldType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datacatalog.v1.IFieldType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldType message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.FieldType.verify|verify} messages. + * @param message FieldType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datacatalog.v1.IFieldType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datacatalog.v1.FieldType; + + /** + * Decodes a FieldType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datacatalog.v1.FieldType; + + /** + * Verifies a FieldType message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldType + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datacatalog.v1.FieldType; + + /** + * Creates a plain object from a FieldType message. Also converts values to other types if specified. + * @param message FieldType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datacatalog.v1.FieldType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FieldType { + + /** Properties of an EnumType. */ + interface IEnumType { + + /** EnumType allowedValues */ + allowedValues?: (google.cloud.datacatalog.v1.FieldType.EnumType.IEnumValue[]|null); + } + + /** Represents an EnumType. */ + class EnumType implements IEnumType { + + /** + * Constructs a new EnumType. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datacatalog.v1.FieldType.IEnumType); + + /** EnumType allowedValues. */ + public allowedValues: google.cloud.datacatalog.v1.FieldType.EnumType.IEnumValue[]; + + /** + * Creates a new EnumType instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumType instance + */ + public static create(properties?: google.cloud.datacatalog.v1.FieldType.IEnumType): google.cloud.datacatalog.v1.FieldType.EnumType; + + /** + * Encodes the specified EnumType message. Does not implicitly {@link google.cloud.datacatalog.v1.FieldType.EnumType.verify|verify} messages. + * @param message EnumType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datacatalog.v1.FieldType.IEnumType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumType message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.FieldType.EnumType.verify|verify} messages. + * @param message EnumType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datacatalog.v1.FieldType.IEnumType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datacatalog.v1.FieldType.EnumType; + + /** + * Decodes an EnumType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datacatalog.v1.FieldType.EnumType; + + /** + * Verifies an EnumType message. + * @param message Plain 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 EnumType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumType + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datacatalog.v1.FieldType.EnumType; + + /** + * Creates a plain object from an EnumType message. Also converts values to other types if specified. + * @param message EnumType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datacatalog.v1.FieldType.EnumType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace EnumType { + + /** Properties of an EnumValue. */ + interface IEnumValue { + + /** EnumValue displayName */ + displayName?: (string|null); + } + + /** Represents an EnumValue. */ + class EnumValue implements IEnumValue { + + /** + * Constructs a new EnumValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datacatalog.v1.FieldType.EnumType.IEnumValue); + + /** EnumValue displayName. */ + public displayName: string; + + /** + * Creates a new EnumValue instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValue instance + */ + public static create(properties?: google.cloud.datacatalog.v1.FieldType.EnumType.IEnumValue): google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue; + + /** + * Encodes the specified EnumValue message. Does not implicitly {@link google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue.verify|verify} messages. + * @param message EnumValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datacatalog.v1.FieldType.EnumType.IEnumValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValue message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue.verify|verify} messages. + * @param message EnumValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datacatalog.v1.FieldType.EnumType.IEnumValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue; + + /** + * Decodes an EnumValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue; + + /** + * Verifies an EnumValue message. + * @param message Plain 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 EnumValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue; + + /** + * Creates a plain object from an EnumValue message. Also converts values to other types if specified. + * @param message EnumValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** PrimitiveType enum. */ + enum PrimitiveType { + PRIMITIVE_TYPE_UNSPECIFIED = 0, + DOUBLE = 1, + STRING = 2, + BOOL = 3, + TIMESTAMP = 4 + } + } + + /** Represents a PolicyTagManager */ + class PolicyTagManager extends $protobuf.rpc.Service { + + /** + * Constructs a new PolicyTagManager 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 PolicyTagManager 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): PolicyTagManager; + + /** + * Calls CreateTaxonomy. + * @param request CreateTaxonomyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Taxonomy + */ + public createTaxonomy(request: google.cloud.datacatalog.v1.ICreateTaxonomyRequest, callback: google.cloud.datacatalog.v1.PolicyTagManager.CreateTaxonomyCallback): void; + + /** + * Calls CreateTaxonomy. + * @param request CreateTaxonomyRequest message or plain object + * @returns Promise + */ + public createTaxonomy(request: google.cloud.datacatalog.v1.ICreateTaxonomyRequest): Promise; + + /** + * Calls DeleteTaxonomy. + * @param request DeleteTaxonomyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteTaxonomy(request: google.cloud.datacatalog.v1.IDeleteTaxonomyRequest, callback: google.cloud.datacatalog.v1.PolicyTagManager.DeleteTaxonomyCallback): void; + + /** + * Calls DeleteTaxonomy. + * @param request DeleteTaxonomyRequest message or plain object + * @returns Promise + */ + public deleteTaxonomy(request: google.cloud.datacatalog.v1.IDeleteTaxonomyRequest): Promise; + + /** + * Calls UpdateTaxonomy. + * @param request UpdateTaxonomyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Taxonomy + */ + public updateTaxonomy(request: google.cloud.datacatalog.v1.IUpdateTaxonomyRequest, callback: google.cloud.datacatalog.v1.PolicyTagManager.UpdateTaxonomyCallback): void; + + /** + * Calls UpdateTaxonomy. + * @param request UpdateTaxonomyRequest message or plain object + * @returns Promise + */ + public updateTaxonomy(request: google.cloud.datacatalog.v1.IUpdateTaxonomyRequest): Promise; + + /** + * Calls ListTaxonomies. + * @param request ListTaxonomiesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTaxonomiesResponse + */ + public listTaxonomies(request: google.cloud.datacatalog.v1.IListTaxonomiesRequest, callback: google.cloud.datacatalog.v1.PolicyTagManager.ListTaxonomiesCallback): void; + + /** + * Calls ListTaxonomies. + * @param request ListTaxonomiesRequest message or plain object + * @returns Promise + */ + public listTaxonomies(request: google.cloud.datacatalog.v1.IListTaxonomiesRequest): Promise; + + /** + * Calls GetTaxonomy. + * @param request GetTaxonomyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Taxonomy + */ + public getTaxonomy(request: google.cloud.datacatalog.v1.IGetTaxonomyRequest, callback: google.cloud.datacatalog.v1.PolicyTagManager.GetTaxonomyCallback): void; + + /** + * Calls GetTaxonomy. + * @param request GetTaxonomyRequest message or plain object + * @returns Promise + */ + public getTaxonomy(request: google.cloud.datacatalog.v1.IGetTaxonomyRequest): Promise; + + /** + * Calls CreatePolicyTag. + * @param request CreatePolicyTagRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PolicyTag + */ + public createPolicyTag(request: google.cloud.datacatalog.v1.ICreatePolicyTagRequest, callback: google.cloud.datacatalog.v1.PolicyTagManager.CreatePolicyTagCallback): void; + + /** + * Calls CreatePolicyTag. + * @param request CreatePolicyTagRequest message or plain object + * @returns Promise + */ + public createPolicyTag(request: google.cloud.datacatalog.v1.ICreatePolicyTagRequest): Promise; + + /** + * Calls DeletePolicyTag. + * @param request DeletePolicyTagRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deletePolicyTag(request: google.cloud.datacatalog.v1.IDeletePolicyTagRequest, callback: google.cloud.datacatalog.v1.PolicyTagManager.DeletePolicyTagCallback): void; + + /** + * Calls DeletePolicyTag. + * @param request DeletePolicyTagRequest message or plain object + * @returns Promise + */ + public deletePolicyTag(request: google.cloud.datacatalog.v1.IDeletePolicyTagRequest): Promise; + + /** + * Calls UpdatePolicyTag. + * @param request UpdatePolicyTagRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PolicyTag + */ + public updatePolicyTag(request: google.cloud.datacatalog.v1.IUpdatePolicyTagRequest, callback: google.cloud.datacatalog.v1.PolicyTagManager.UpdatePolicyTagCallback): void; + + /** + * Calls UpdatePolicyTag. + * @param request UpdatePolicyTagRequest message or plain object + * @returns Promise + */ + public updatePolicyTag(request: google.cloud.datacatalog.v1.IUpdatePolicyTagRequest): Promise; + + /** + * Calls ListPolicyTags. + * @param request ListPolicyTagsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListPolicyTagsResponse + */ + public listPolicyTags(request: google.cloud.datacatalog.v1.IListPolicyTagsRequest, callback: google.cloud.datacatalog.v1.PolicyTagManager.ListPolicyTagsCallback): void; + + /** + * Calls ListPolicyTags. + * @param request ListPolicyTagsRequest message or plain object + * @returns Promise + */ + public listPolicyTags(request: google.cloud.datacatalog.v1.IListPolicyTagsRequest): Promise; + + /** + * Calls GetPolicyTag. + * @param request GetPolicyTagRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PolicyTag + */ + public getPolicyTag(request: google.cloud.datacatalog.v1.IGetPolicyTagRequest, callback: google.cloud.datacatalog.v1.PolicyTagManager.GetPolicyTagCallback): void; + + /** + * Calls GetPolicyTag. + * @param request GetPolicyTagRequest message or plain object + * @returns Promise + */ + public getPolicyTag(request: google.cloud.datacatalog.v1.IGetPolicyTagRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.cloud.datacatalog.v1.PolicyTagManager.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.cloud.datacatalog.v1.PolicyTagManager.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.cloud.datacatalog.v1.PolicyTagManager.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + } + + namespace PolicyTagManager { + + /** + * Callback as used by {@link google.cloud.datacatalog.v1.PolicyTagManager#createTaxonomy}. + * @param error Error, if any + * @param [response] Taxonomy + */ + type CreateTaxonomyCallback = (error: (Error|null), response?: google.cloud.datacatalog.v1.Taxonomy) => void; + + /** + * Callback as used by {@link google.cloud.datacatalog.v1.PolicyTagManager#deleteTaxonomy}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteTaxonomyCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.datacatalog.v1.PolicyTagManager#updateTaxonomy}. + * @param error Error, if any + * @param [response] Taxonomy + */ + type UpdateTaxonomyCallback = (error: (Error|null), response?: google.cloud.datacatalog.v1.Taxonomy) => void; + + /** + * Callback as used by {@link google.cloud.datacatalog.v1.PolicyTagManager#listTaxonomies}. + * @param error Error, if any + * @param [response] ListTaxonomiesResponse + */ + type ListTaxonomiesCallback = (error: (Error|null), response?: google.cloud.datacatalog.v1.ListTaxonomiesResponse) => void; + + /** + * Callback as used by {@link google.cloud.datacatalog.v1.PolicyTagManager#getTaxonomy}. + * @param error Error, if any + * @param [response] Taxonomy + */ + type GetTaxonomyCallback = (error: (Error|null), response?: google.cloud.datacatalog.v1.Taxonomy) => void; + + /** + * Callback as used by {@link google.cloud.datacatalog.v1.PolicyTagManager#createPolicyTag}. + * @param error Error, if any + * @param [response] PolicyTag + */ + type CreatePolicyTagCallback = (error: (Error|null), response?: google.cloud.datacatalog.v1.PolicyTag) => void; + + /** + * Callback as used by {@link google.cloud.datacatalog.v1.PolicyTagManager#deletePolicyTag}. + * @param error Error, if any + * @param [response] Empty + */ + type DeletePolicyTagCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.datacatalog.v1.PolicyTagManager#updatePolicyTag}. + * @param error Error, if any + * @param [response] PolicyTag + */ + type UpdatePolicyTagCallback = (error: (Error|null), response?: google.cloud.datacatalog.v1.PolicyTag) => void; + + /** + * Callback as used by {@link google.cloud.datacatalog.v1.PolicyTagManager#listPolicyTags}. + * @param error Error, if any + * @param [response] ListPolicyTagsResponse + */ + type ListPolicyTagsCallback = (error: (Error|null), response?: google.cloud.datacatalog.v1.ListPolicyTagsResponse) => void; + + /** + * Callback as used by {@link google.cloud.datacatalog.v1.PolicyTagManager#getPolicyTag}. + * @param error Error, if any + * @param [response] PolicyTag + */ + type GetPolicyTagCallback = (error: (Error|null), response?: google.cloud.datacatalog.v1.PolicyTag) => void; + + /** + * Callback as used by {@link google.cloud.datacatalog.v1.PolicyTagManager#getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.datacatalog.v1.PolicyTagManager#setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.datacatalog.v1.PolicyTagManager#testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + } + + /** Properties of a Taxonomy. */ + interface ITaxonomy { + + /** Taxonomy name */ + name?: (string|null); + + /** Taxonomy displayName */ + displayName?: (string|null); + + /** Taxonomy description */ + description?: (string|null); + + /** Taxonomy policyTagCount */ + policyTagCount?: (number|null); + + /** Taxonomy taxonomyTimestamps */ + taxonomyTimestamps?: (google.cloud.datacatalog.v1.ISystemTimestamps|null); + + /** Taxonomy activatedPolicyTypes */ + activatedPolicyTypes?: (google.cloud.datacatalog.v1.Taxonomy.PolicyType[]|null); + } + + /** Represents a Taxonomy. */ + class Taxonomy implements ITaxonomy { + + /** + * Constructs a new Taxonomy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datacatalog.v1.ITaxonomy); + + /** Taxonomy name. */ + public name: string; + + /** Taxonomy displayName. */ + public displayName: string; + + /** Taxonomy description. */ + public description: string; + + /** Taxonomy policyTagCount. */ + public policyTagCount: number; + + /** Taxonomy taxonomyTimestamps. */ + public taxonomyTimestamps?: (google.cloud.datacatalog.v1.ISystemTimestamps|null); + + /** Taxonomy activatedPolicyTypes. */ + public activatedPolicyTypes: google.cloud.datacatalog.v1.Taxonomy.PolicyType[]; + + /** + * Creates a new Taxonomy instance using the specified properties. + * @param [properties] Properties to set + * @returns Taxonomy instance + */ + public static create(properties?: google.cloud.datacatalog.v1.ITaxonomy): google.cloud.datacatalog.v1.Taxonomy; + + /** + * Encodes the specified Taxonomy message. Does not implicitly {@link google.cloud.datacatalog.v1.Taxonomy.verify|verify} messages. + * @param message Taxonomy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datacatalog.v1.ITaxonomy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Taxonomy message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.Taxonomy.verify|verify} messages. + * @param message Taxonomy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datacatalog.v1.ITaxonomy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Taxonomy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Taxonomy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datacatalog.v1.Taxonomy; + + /** + * Decodes a Taxonomy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Taxonomy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datacatalog.v1.Taxonomy; + + /** + * Verifies a Taxonomy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Taxonomy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Taxonomy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datacatalog.v1.Taxonomy; + + /** + * Creates a plain object from a Taxonomy message. Also converts values to other types if specified. + * @param message Taxonomy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datacatalog.v1.Taxonomy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Taxonomy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Taxonomy { + + /** PolicyType enum. */ + enum PolicyType { + POLICY_TYPE_UNSPECIFIED = 0, + FINE_GRAINED_ACCESS_CONTROL = 1 + } + } + + /** Properties of a PolicyTag. */ + interface IPolicyTag { + + /** PolicyTag name */ + name?: (string|null); + + /** PolicyTag displayName */ + displayName?: (string|null); + + /** PolicyTag description */ + description?: (string|null); + + /** PolicyTag parentPolicyTag */ + parentPolicyTag?: (string|null); + + /** PolicyTag childPolicyTags */ + childPolicyTags?: (string[]|null); + } + + /** Represents a PolicyTag. */ + class PolicyTag implements IPolicyTag { + + /** + * Constructs a new PolicyTag. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datacatalog.v1.IPolicyTag); + + /** PolicyTag name. */ + public name: string; + + /** PolicyTag displayName. */ + public displayName: string; + + /** PolicyTag description. */ + public description: string; + + /** PolicyTag parentPolicyTag. */ + public parentPolicyTag: string; + + /** PolicyTag childPolicyTags. */ + public childPolicyTags: string[]; + + /** + * Creates a new PolicyTag instance using the specified properties. + * @param [properties] Properties to set + * @returns PolicyTag instance + */ + public static create(properties?: google.cloud.datacatalog.v1.IPolicyTag): google.cloud.datacatalog.v1.PolicyTag; + + /** + * Encodes the specified PolicyTag message. Does not implicitly {@link google.cloud.datacatalog.v1.PolicyTag.verify|verify} messages. + * @param message PolicyTag message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datacatalog.v1.IPolicyTag, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PolicyTag message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.PolicyTag.verify|verify} messages. + * @param message PolicyTag message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datacatalog.v1.IPolicyTag, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PolicyTag message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PolicyTag + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datacatalog.v1.PolicyTag; + + /** + * Decodes a PolicyTag message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PolicyTag + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datacatalog.v1.PolicyTag; + + /** + * Verifies a PolicyTag message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PolicyTag message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PolicyTag + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datacatalog.v1.PolicyTag; + + /** + * Creates a plain object from a PolicyTag message. Also converts values to other types if specified. + * @param message PolicyTag + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datacatalog.v1.PolicyTag, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PolicyTag to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateTaxonomyRequest. */ + interface ICreateTaxonomyRequest { + + /** CreateTaxonomyRequest parent */ + parent?: (string|null); + + /** CreateTaxonomyRequest taxonomy */ + taxonomy?: (google.cloud.datacatalog.v1.ITaxonomy|null); + } + + /** Represents a CreateTaxonomyRequest. */ + class CreateTaxonomyRequest implements ICreateTaxonomyRequest { + + /** + * Constructs a new CreateTaxonomyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datacatalog.v1.ICreateTaxonomyRequest); + + /** CreateTaxonomyRequest parent. */ + public parent: string; + + /** CreateTaxonomyRequest taxonomy. */ + public taxonomy?: (google.cloud.datacatalog.v1.ITaxonomy|null); + + /** + * Creates a new CreateTaxonomyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTaxonomyRequest instance + */ + public static create(properties?: google.cloud.datacatalog.v1.ICreateTaxonomyRequest): google.cloud.datacatalog.v1.CreateTaxonomyRequest; + + /** + * Encodes the specified CreateTaxonomyRequest message. Does not implicitly {@link google.cloud.datacatalog.v1.CreateTaxonomyRequest.verify|verify} messages. + * @param message CreateTaxonomyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datacatalog.v1.ICreateTaxonomyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateTaxonomyRequest message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.CreateTaxonomyRequest.verify|verify} messages. + * @param message CreateTaxonomyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datacatalog.v1.ICreateTaxonomyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateTaxonomyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateTaxonomyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datacatalog.v1.CreateTaxonomyRequest; + + /** + * Decodes a CreateTaxonomyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateTaxonomyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datacatalog.v1.CreateTaxonomyRequest; + + /** + * Verifies a CreateTaxonomyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateTaxonomyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTaxonomyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datacatalog.v1.CreateTaxonomyRequest; + + /** + * Creates a plain object from a CreateTaxonomyRequest message. Also converts values to other types if specified. + * @param message CreateTaxonomyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datacatalog.v1.CreateTaxonomyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateTaxonomyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteTaxonomyRequest. */ + interface IDeleteTaxonomyRequest { + + /** DeleteTaxonomyRequest name */ + name?: (string|null); + } + + /** Represents a DeleteTaxonomyRequest. */ + class DeleteTaxonomyRequest implements IDeleteTaxonomyRequest { + + /** + * Constructs a new DeleteTaxonomyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datacatalog.v1.IDeleteTaxonomyRequest); + + /** DeleteTaxonomyRequest name. */ + public name: string; + + /** + * Creates a new DeleteTaxonomyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTaxonomyRequest instance + */ + public static create(properties?: google.cloud.datacatalog.v1.IDeleteTaxonomyRequest): google.cloud.datacatalog.v1.DeleteTaxonomyRequest; + + /** + * Encodes the specified DeleteTaxonomyRequest message. Does not implicitly {@link google.cloud.datacatalog.v1.DeleteTaxonomyRequest.verify|verify} messages. + * @param message DeleteTaxonomyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datacatalog.v1.IDeleteTaxonomyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteTaxonomyRequest message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.DeleteTaxonomyRequest.verify|verify} messages. + * @param message DeleteTaxonomyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datacatalog.v1.IDeleteTaxonomyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteTaxonomyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTaxonomyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datacatalog.v1.DeleteTaxonomyRequest; + + /** + * Decodes a DeleteTaxonomyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTaxonomyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datacatalog.v1.DeleteTaxonomyRequest; + + /** + * Verifies a DeleteTaxonomyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteTaxonomyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTaxonomyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datacatalog.v1.DeleteTaxonomyRequest; + + /** + * Creates a plain object from a DeleteTaxonomyRequest message. Also converts values to other types if specified. + * @param message DeleteTaxonomyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datacatalog.v1.DeleteTaxonomyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteTaxonomyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateTaxonomyRequest. */ + interface IUpdateTaxonomyRequest { + + /** UpdateTaxonomyRequest taxonomy */ + taxonomy?: (google.cloud.datacatalog.v1.ITaxonomy|null); + + /** UpdateTaxonomyRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateTaxonomyRequest. */ + class UpdateTaxonomyRequest implements IUpdateTaxonomyRequest { + + /** + * Constructs a new UpdateTaxonomyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datacatalog.v1.IUpdateTaxonomyRequest); + + /** UpdateTaxonomyRequest taxonomy. */ + public taxonomy?: (google.cloud.datacatalog.v1.ITaxonomy|null); + + /** UpdateTaxonomyRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateTaxonomyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateTaxonomyRequest instance + */ + public static create(properties?: google.cloud.datacatalog.v1.IUpdateTaxonomyRequest): google.cloud.datacatalog.v1.UpdateTaxonomyRequest; + + /** + * Encodes the specified UpdateTaxonomyRequest message. Does not implicitly {@link google.cloud.datacatalog.v1.UpdateTaxonomyRequest.verify|verify} messages. + * @param message UpdateTaxonomyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datacatalog.v1.IUpdateTaxonomyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateTaxonomyRequest message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.UpdateTaxonomyRequest.verify|verify} messages. + * @param message UpdateTaxonomyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datacatalog.v1.IUpdateTaxonomyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateTaxonomyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateTaxonomyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datacatalog.v1.UpdateTaxonomyRequest; + + /** + * Decodes an UpdateTaxonomyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateTaxonomyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datacatalog.v1.UpdateTaxonomyRequest; + + /** + * Verifies an UpdateTaxonomyRequest message. + * @param message Plain 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 UpdateTaxonomyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateTaxonomyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datacatalog.v1.UpdateTaxonomyRequest; + + /** + * Creates a plain object from an UpdateTaxonomyRequest message. Also converts values to other types if specified. + * @param message UpdateTaxonomyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datacatalog.v1.UpdateTaxonomyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateTaxonomyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListTaxonomiesRequest. */ + interface IListTaxonomiesRequest { + + /** ListTaxonomiesRequest parent */ + parent?: (string|null); + + /** ListTaxonomiesRequest pageSize */ + pageSize?: (number|null); + + /** ListTaxonomiesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListTaxonomiesRequest. */ + class ListTaxonomiesRequest implements IListTaxonomiesRequest { + + /** + * Constructs a new ListTaxonomiesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datacatalog.v1.IListTaxonomiesRequest); + + /** ListTaxonomiesRequest parent. */ + public parent: string; + + /** ListTaxonomiesRequest pageSize. */ + public pageSize: number; + + /** ListTaxonomiesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListTaxonomiesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTaxonomiesRequest instance + */ + public static create(properties?: google.cloud.datacatalog.v1.IListTaxonomiesRequest): google.cloud.datacatalog.v1.ListTaxonomiesRequest; + + /** + * Encodes the specified ListTaxonomiesRequest message. Does not implicitly {@link google.cloud.datacatalog.v1.ListTaxonomiesRequest.verify|verify} messages. + * @param message ListTaxonomiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datacatalog.v1.IListTaxonomiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTaxonomiesRequest message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.ListTaxonomiesRequest.verify|verify} messages. + * @param message ListTaxonomiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datacatalog.v1.IListTaxonomiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTaxonomiesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTaxonomiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datacatalog.v1.ListTaxonomiesRequest; + + /** + * Decodes a ListTaxonomiesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTaxonomiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datacatalog.v1.ListTaxonomiesRequest; + + /** + * Verifies a ListTaxonomiesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTaxonomiesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTaxonomiesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datacatalog.v1.ListTaxonomiesRequest; + + /** + * Creates a plain object from a ListTaxonomiesRequest message. Also converts values to other types if specified. + * @param message ListTaxonomiesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datacatalog.v1.ListTaxonomiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTaxonomiesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListTaxonomiesResponse. */ + interface IListTaxonomiesResponse { + + /** ListTaxonomiesResponse taxonomies */ + taxonomies?: (google.cloud.datacatalog.v1.ITaxonomy[]|null); + + /** ListTaxonomiesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListTaxonomiesResponse. */ + class ListTaxonomiesResponse implements IListTaxonomiesResponse { + + /** + * Constructs a new ListTaxonomiesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datacatalog.v1.IListTaxonomiesResponse); + + /** ListTaxonomiesResponse taxonomies. */ + public taxonomies: google.cloud.datacatalog.v1.ITaxonomy[]; + + /** ListTaxonomiesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListTaxonomiesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTaxonomiesResponse instance + */ + public static create(properties?: google.cloud.datacatalog.v1.IListTaxonomiesResponse): google.cloud.datacatalog.v1.ListTaxonomiesResponse; + + /** + * Encodes the specified ListTaxonomiesResponse message. Does not implicitly {@link google.cloud.datacatalog.v1.ListTaxonomiesResponse.verify|verify} messages. + * @param message ListTaxonomiesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datacatalog.v1.IListTaxonomiesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTaxonomiesResponse message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.ListTaxonomiesResponse.verify|verify} messages. + * @param message ListTaxonomiesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datacatalog.v1.IListTaxonomiesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTaxonomiesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTaxonomiesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datacatalog.v1.ListTaxonomiesResponse; + + /** + * Decodes a ListTaxonomiesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTaxonomiesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datacatalog.v1.ListTaxonomiesResponse; + + /** + * Verifies a ListTaxonomiesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTaxonomiesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTaxonomiesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datacatalog.v1.ListTaxonomiesResponse; + + /** + * Creates a plain object from a ListTaxonomiesResponse message. Also converts values to other types if specified. + * @param message ListTaxonomiesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datacatalog.v1.ListTaxonomiesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTaxonomiesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetTaxonomyRequest. */ + interface IGetTaxonomyRequest { + + /** GetTaxonomyRequest name */ + name?: (string|null); + } + + /** Represents a GetTaxonomyRequest. */ + class GetTaxonomyRequest implements IGetTaxonomyRequest { + + /** + * Constructs a new GetTaxonomyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datacatalog.v1.IGetTaxonomyRequest); + + /** GetTaxonomyRequest name. */ + public name: string; + + /** + * Creates a new GetTaxonomyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTaxonomyRequest instance + */ + public static create(properties?: google.cloud.datacatalog.v1.IGetTaxonomyRequest): google.cloud.datacatalog.v1.GetTaxonomyRequest; + + /** + * Encodes the specified GetTaxonomyRequest message. Does not implicitly {@link google.cloud.datacatalog.v1.GetTaxonomyRequest.verify|verify} messages. + * @param message GetTaxonomyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datacatalog.v1.IGetTaxonomyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTaxonomyRequest message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.GetTaxonomyRequest.verify|verify} messages. + * @param message GetTaxonomyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datacatalog.v1.IGetTaxonomyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTaxonomyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTaxonomyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datacatalog.v1.GetTaxonomyRequest; + + /** + * Decodes a GetTaxonomyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTaxonomyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datacatalog.v1.GetTaxonomyRequest; + + /** + * Verifies a GetTaxonomyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTaxonomyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTaxonomyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datacatalog.v1.GetTaxonomyRequest; + + /** + * Creates a plain object from a GetTaxonomyRequest message. Also converts values to other types if specified. + * @param message GetTaxonomyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datacatalog.v1.GetTaxonomyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTaxonomyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreatePolicyTagRequest. */ + interface ICreatePolicyTagRequest { + + /** CreatePolicyTagRequest parent */ + parent?: (string|null); + + /** CreatePolicyTagRequest policyTag */ + policyTag?: (google.cloud.datacatalog.v1.IPolicyTag|null); + } + + /** Represents a CreatePolicyTagRequest. */ + class CreatePolicyTagRequest implements ICreatePolicyTagRequest { + + /** + * Constructs a new CreatePolicyTagRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datacatalog.v1.ICreatePolicyTagRequest); + + /** CreatePolicyTagRequest parent. */ + public parent: string; + + /** CreatePolicyTagRequest policyTag. */ + public policyTag?: (google.cloud.datacatalog.v1.IPolicyTag|null); + + /** + * Creates a new CreatePolicyTagRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreatePolicyTagRequest instance + */ + public static create(properties?: google.cloud.datacatalog.v1.ICreatePolicyTagRequest): google.cloud.datacatalog.v1.CreatePolicyTagRequest; + + /** + * Encodes the specified CreatePolicyTagRequest message. Does not implicitly {@link google.cloud.datacatalog.v1.CreatePolicyTagRequest.verify|verify} messages. + * @param message CreatePolicyTagRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datacatalog.v1.ICreatePolicyTagRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreatePolicyTagRequest message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.CreatePolicyTagRequest.verify|verify} messages. + * @param message CreatePolicyTagRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datacatalog.v1.ICreatePolicyTagRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreatePolicyTagRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreatePolicyTagRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datacatalog.v1.CreatePolicyTagRequest; + + /** + * Decodes a CreatePolicyTagRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreatePolicyTagRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datacatalog.v1.CreatePolicyTagRequest; + + /** + * Verifies a CreatePolicyTagRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreatePolicyTagRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreatePolicyTagRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datacatalog.v1.CreatePolicyTagRequest; + + /** + * Creates a plain object from a CreatePolicyTagRequest message. Also converts values to other types if specified. + * @param message CreatePolicyTagRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datacatalog.v1.CreatePolicyTagRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreatePolicyTagRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeletePolicyTagRequest. */ + interface IDeletePolicyTagRequest { + + /** DeletePolicyTagRequest name */ + name?: (string|null); + } + + /** Represents a DeletePolicyTagRequest. */ + class DeletePolicyTagRequest implements IDeletePolicyTagRequest { + + /** + * Constructs a new DeletePolicyTagRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datacatalog.v1.IDeletePolicyTagRequest); + + /** DeletePolicyTagRequest name. */ + public name: string; + + /** + * Creates a new DeletePolicyTagRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeletePolicyTagRequest instance + */ + public static create(properties?: google.cloud.datacatalog.v1.IDeletePolicyTagRequest): google.cloud.datacatalog.v1.DeletePolicyTagRequest; + + /** + * Encodes the specified DeletePolicyTagRequest message. Does not implicitly {@link google.cloud.datacatalog.v1.DeletePolicyTagRequest.verify|verify} messages. + * @param message DeletePolicyTagRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datacatalog.v1.IDeletePolicyTagRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeletePolicyTagRequest message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.DeletePolicyTagRequest.verify|verify} messages. + * @param message DeletePolicyTagRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datacatalog.v1.IDeletePolicyTagRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeletePolicyTagRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeletePolicyTagRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datacatalog.v1.DeletePolicyTagRequest; + + /** + * Decodes a DeletePolicyTagRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeletePolicyTagRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datacatalog.v1.DeletePolicyTagRequest; + + /** + * Verifies a DeletePolicyTagRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeletePolicyTagRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeletePolicyTagRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datacatalog.v1.DeletePolicyTagRequest; + + /** + * Creates a plain object from a DeletePolicyTagRequest message. Also converts values to other types if specified. + * @param message DeletePolicyTagRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datacatalog.v1.DeletePolicyTagRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeletePolicyTagRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdatePolicyTagRequest. */ + interface IUpdatePolicyTagRequest { + + /** UpdatePolicyTagRequest policyTag */ + policyTag?: (google.cloud.datacatalog.v1.IPolicyTag|null); + + /** UpdatePolicyTagRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdatePolicyTagRequest. */ + class UpdatePolicyTagRequest implements IUpdatePolicyTagRequest { + + /** + * Constructs a new UpdatePolicyTagRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datacatalog.v1.IUpdatePolicyTagRequest); + + /** UpdatePolicyTagRequest policyTag. */ + public policyTag?: (google.cloud.datacatalog.v1.IPolicyTag|null); + + /** UpdatePolicyTagRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdatePolicyTagRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdatePolicyTagRequest instance + */ + public static create(properties?: google.cloud.datacatalog.v1.IUpdatePolicyTagRequest): google.cloud.datacatalog.v1.UpdatePolicyTagRequest; + + /** + * Encodes the specified UpdatePolicyTagRequest message. Does not implicitly {@link google.cloud.datacatalog.v1.UpdatePolicyTagRequest.verify|verify} messages. + * @param message UpdatePolicyTagRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datacatalog.v1.IUpdatePolicyTagRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdatePolicyTagRequest message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.UpdatePolicyTagRequest.verify|verify} messages. + * @param message UpdatePolicyTagRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datacatalog.v1.IUpdatePolicyTagRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdatePolicyTagRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdatePolicyTagRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datacatalog.v1.UpdatePolicyTagRequest; + + /** + * Decodes an UpdatePolicyTagRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdatePolicyTagRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datacatalog.v1.UpdatePolicyTagRequest; + + /** + * Verifies an UpdatePolicyTagRequest message. + * @param message Plain 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 UpdatePolicyTagRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdatePolicyTagRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datacatalog.v1.UpdatePolicyTagRequest; + + /** + * Creates a plain object from an UpdatePolicyTagRequest message. Also converts values to other types if specified. + * @param message UpdatePolicyTagRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datacatalog.v1.UpdatePolicyTagRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdatePolicyTagRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListPolicyTagsRequest. */ + interface IListPolicyTagsRequest { + + /** ListPolicyTagsRequest parent */ + parent?: (string|null); + + /** ListPolicyTagsRequest pageSize */ + pageSize?: (number|null); + + /** ListPolicyTagsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListPolicyTagsRequest. */ + class ListPolicyTagsRequest implements IListPolicyTagsRequest { + + /** + * Constructs a new ListPolicyTagsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datacatalog.v1.IListPolicyTagsRequest); + + /** ListPolicyTagsRequest parent. */ + public parent: string; + + /** ListPolicyTagsRequest pageSize. */ + public pageSize: number; + + /** ListPolicyTagsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListPolicyTagsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPolicyTagsRequest instance + */ + public static create(properties?: google.cloud.datacatalog.v1.IListPolicyTagsRequest): google.cloud.datacatalog.v1.ListPolicyTagsRequest; + + /** + * Encodes the specified ListPolicyTagsRequest message. Does not implicitly {@link google.cloud.datacatalog.v1.ListPolicyTagsRequest.verify|verify} messages. + * @param message ListPolicyTagsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datacatalog.v1.IListPolicyTagsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPolicyTagsRequest message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.ListPolicyTagsRequest.verify|verify} messages. + * @param message ListPolicyTagsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datacatalog.v1.IListPolicyTagsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPolicyTagsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPolicyTagsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datacatalog.v1.ListPolicyTagsRequest; + + /** + * Decodes a ListPolicyTagsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPolicyTagsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datacatalog.v1.ListPolicyTagsRequest; + + /** + * Verifies a ListPolicyTagsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPolicyTagsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPolicyTagsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datacatalog.v1.ListPolicyTagsRequest; + + /** + * Creates a plain object from a ListPolicyTagsRequest message. Also converts values to other types if specified. + * @param message ListPolicyTagsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datacatalog.v1.ListPolicyTagsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPolicyTagsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListPolicyTagsResponse. */ + interface IListPolicyTagsResponse { + + /** ListPolicyTagsResponse policyTags */ + policyTags?: (google.cloud.datacatalog.v1.IPolicyTag[]|null); + + /** ListPolicyTagsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListPolicyTagsResponse. */ + class ListPolicyTagsResponse implements IListPolicyTagsResponse { + + /** + * Constructs a new ListPolicyTagsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datacatalog.v1.IListPolicyTagsResponse); + + /** ListPolicyTagsResponse policyTags. */ + public policyTags: google.cloud.datacatalog.v1.IPolicyTag[]; + + /** ListPolicyTagsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListPolicyTagsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPolicyTagsResponse instance + */ + public static create(properties?: google.cloud.datacatalog.v1.IListPolicyTagsResponse): google.cloud.datacatalog.v1.ListPolicyTagsResponse; + + /** + * Encodes the specified ListPolicyTagsResponse message. Does not implicitly {@link google.cloud.datacatalog.v1.ListPolicyTagsResponse.verify|verify} messages. + * @param message ListPolicyTagsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datacatalog.v1.IListPolicyTagsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPolicyTagsResponse message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.ListPolicyTagsResponse.verify|verify} messages. + * @param message ListPolicyTagsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datacatalog.v1.IListPolicyTagsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPolicyTagsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPolicyTagsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datacatalog.v1.ListPolicyTagsResponse; + + /** + * Decodes a ListPolicyTagsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPolicyTagsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datacatalog.v1.ListPolicyTagsResponse; + + /** + * Verifies a ListPolicyTagsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPolicyTagsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPolicyTagsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datacatalog.v1.ListPolicyTagsResponse; + + /** + * Creates a plain object from a ListPolicyTagsResponse message. Also converts values to other types if specified. + * @param message ListPolicyTagsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datacatalog.v1.ListPolicyTagsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPolicyTagsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetPolicyTagRequest. */ + interface IGetPolicyTagRequest { + + /** GetPolicyTagRequest name */ + name?: (string|null); + } + + /** Represents a GetPolicyTagRequest. */ + class GetPolicyTagRequest implements IGetPolicyTagRequest { + + /** + * Constructs a new GetPolicyTagRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datacatalog.v1.IGetPolicyTagRequest); + + /** GetPolicyTagRequest name. */ + public name: string; + + /** + * Creates a new GetPolicyTagRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPolicyTagRequest instance + */ + public static create(properties?: google.cloud.datacatalog.v1.IGetPolicyTagRequest): google.cloud.datacatalog.v1.GetPolicyTagRequest; + + /** + * Encodes the specified GetPolicyTagRequest message. Does not implicitly {@link google.cloud.datacatalog.v1.GetPolicyTagRequest.verify|verify} messages. + * @param message GetPolicyTagRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datacatalog.v1.IGetPolicyTagRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetPolicyTagRequest message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.GetPolicyTagRequest.verify|verify} messages. + * @param message GetPolicyTagRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datacatalog.v1.IGetPolicyTagRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetPolicyTagRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPolicyTagRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datacatalog.v1.GetPolicyTagRequest; + + /** + * Decodes a GetPolicyTagRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPolicyTagRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datacatalog.v1.GetPolicyTagRequest; + + /** + * Verifies a GetPolicyTagRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetPolicyTagRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPolicyTagRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datacatalog.v1.GetPolicyTagRequest; + + /** + * Creates a plain object from a GetPolicyTagRequest message. Also converts values to other types if specified. + * @param message GetPolicyTagRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datacatalog.v1.GetPolicyTagRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetPolicyTagRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Represents a PolicyTagManagerSerialization */ + class PolicyTagManagerSerialization extends $protobuf.rpc.Service { + + /** + * Constructs a new PolicyTagManagerSerialization 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 PolicyTagManagerSerialization 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): PolicyTagManagerSerialization; + + /** + * Calls ImportTaxonomies. + * @param request ImportTaxonomiesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ImportTaxonomiesResponse + */ + public importTaxonomies(request: google.cloud.datacatalog.v1.IImportTaxonomiesRequest, callback: google.cloud.datacatalog.v1.PolicyTagManagerSerialization.ImportTaxonomiesCallback): void; + + /** + * Calls ImportTaxonomies. + * @param request ImportTaxonomiesRequest message or plain object + * @returns Promise + */ + public importTaxonomies(request: google.cloud.datacatalog.v1.IImportTaxonomiesRequest): Promise; + + /** + * Calls ExportTaxonomies. + * @param request ExportTaxonomiesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ExportTaxonomiesResponse + */ + public exportTaxonomies(request: google.cloud.datacatalog.v1.IExportTaxonomiesRequest, callback: google.cloud.datacatalog.v1.PolicyTagManagerSerialization.ExportTaxonomiesCallback): void; + + /** + * Calls ExportTaxonomies. + * @param request ExportTaxonomiesRequest message or plain object + * @returns Promise + */ + public exportTaxonomies(request: google.cloud.datacatalog.v1.IExportTaxonomiesRequest): Promise; + } + + namespace PolicyTagManagerSerialization { + + /** + * Callback as used by {@link google.cloud.datacatalog.v1.PolicyTagManagerSerialization#importTaxonomies}. + * @param error Error, if any + * @param [response] ImportTaxonomiesResponse + */ + type ImportTaxonomiesCallback = (error: (Error|null), response?: google.cloud.datacatalog.v1.ImportTaxonomiesResponse) => void; + + /** + * Callback as used by {@link google.cloud.datacatalog.v1.PolicyTagManagerSerialization#exportTaxonomies}. + * @param error Error, if any + * @param [response] ExportTaxonomiesResponse + */ + type ExportTaxonomiesCallback = (error: (Error|null), response?: google.cloud.datacatalog.v1.ExportTaxonomiesResponse) => void; + } + + /** Properties of a SerializedTaxonomy. */ + interface ISerializedTaxonomy { + + /** SerializedTaxonomy displayName */ + displayName?: (string|null); + + /** SerializedTaxonomy description */ + description?: (string|null); + + /** SerializedTaxonomy policyTags */ + policyTags?: (google.cloud.datacatalog.v1.ISerializedPolicyTag[]|null); + + /** SerializedTaxonomy activatedPolicyTypes */ + activatedPolicyTypes?: (google.cloud.datacatalog.v1.Taxonomy.PolicyType[]|null); + } + + /** Represents a SerializedTaxonomy. */ + class SerializedTaxonomy implements ISerializedTaxonomy { + + /** + * Constructs a new SerializedTaxonomy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datacatalog.v1.ISerializedTaxonomy); + + /** SerializedTaxonomy displayName. */ + public displayName: string; + + /** SerializedTaxonomy description. */ + public description: string; + + /** SerializedTaxonomy policyTags. */ + public policyTags: google.cloud.datacatalog.v1.ISerializedPolicyTag[]; + + /** SerializedTaxonomy activatedPolicyTypes. */ + public activatedPolicyTypes: google.cloud.datacatalog.v1.Taxonomy.PolicyType[]; + + /** + * Creates a new SerializedTaxonomy instance using the specified properties. + * @param [properties] Properties to set + * @returns SerializedTaxonomy instance + */ + public static create(properties?: google.cloud.datacatalog.v1.ISerializedTaxonomy): google.cloud.datacatalog.v1.SerializedTaxonomy; + + /** + * Encodes the specified SerializedTaxonomy message. Does not implicitly {@link google.cloud.datacatalog.v1.SerializedTaxonomy.verify|verify} messages. + * @param message SerializedTaxonomy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datacatalog.v1.ISerializedTaxonomy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SerializedTaxonomy message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.SerializedTaxonomy.verify|verify} messages. + * @param message SerializedTaxonomy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datacatalog.v1.ISerializedTaxonomy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SerializedTaxonomy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SerializedTaxonomy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datacatalog.v1.SerializedTaxonomy; + + /** + * Decodes a SerializedTaxonomy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SerializedTaxonomy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datacatalog.v1.SerializedTaxonomy; + + /** + * Verifies a SerializedTaxonomy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SerializedTaxonomy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SerializedTaxonomy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datacatalog.v1.SerializedTaxonomy; + + /** + * Creates a plain object from a SerializedTaxonomy message. Also converts values to other types if specified. + * @param message SerializedTaxonomy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datacatalog.v1.SerializedTaxonomy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SerializedTaxonomy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SerializedPolicyTag. */ + interface ISerializedPolicyTag { + + /** SerializedPolicyTag policyTag */ + policyTag?: (string|null); + + /** SerializedPolicyTag displayName */ + displayName?: (string|null); + + /** SerializedPolicyTag description */ + description?: (string|null); + + /** SerializedPolicyTag childPolicyTags */ + childPolicyTags?: (google.cloud.datacatalog.v1.ISerializedPolicyTag[]|null); + } + + /** Represents a SerializedPolicyTag. */ + class SerializedPolicyTag implements ISerializedPolicyTag { + + /** + * Constructs a new SerializedPolicyTag. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datacatalog.v1.ISerializedPolicyTag); + + /** SerializedPolicyTag policyTag. */ + public policyTag: string; + + /** SerializedPolicyTag displayName. */ + public displayName: string; + + /** SerializedPolicyTag description. */ + public description: string; + + /** SerializedPolicyTag childPolicyTags. */ + public childPolicyTags: google.cloud.datacatalog.v1.ISerializedPolicyTag[]; + + /** + * Creates a new SerializedPolicyTag instance using the specified properties. + * @param [properties] Properties to set + * @returns SerializedPolicyTag instance + */ + public static create(properties?: google.cloud.datacatalog.v1.ISerializedPolicyTag): google.cloud.datacatalog.v1.SerializedPolicyTag; + + /** + * Encodes the specified SerializedPolicyTag message. Does not implicitly {@link google.cloud.datacatalog.v1.SerializedPolicyTag.verify|verify} messages. + * @param message SerializedPolicyTag message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datacatalog.v1.ISerializedPolicyTag, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SerializedPolicyTag message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.SerializedPolicyTag.verify|verify} messages. + * @param message SerializedPolicyTag message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datacatalog.v1.ISerializedPolicyTag, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SerializedPolicyTag message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SerializedPolicyTag + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datacatalog.v1.SerializedPolicyTag; + + /** + * Decodes a SerializedPolicyTag message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SerializedPolicyTag + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datacatalog.v1.SerializedPolicyTag; + + /** + * Verifies a SerializedPolicyTag message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SerializedPolicyTag message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SerializedPolicyTag + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datacatalog.v1.SerializedPolicyTag; + + /** + * Creates a plain object from a SerializedPolicyTag message. Also converts values to other types if specified. + * @param message SerializedPolicyTag + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datacatalog.v1.SerializedPolicyTag, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SerializedPolicyTag to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImportTaxonomiesRequest. */ + interface IImportTaxonomiesRequest { + + /** ImportTaxonomiesRequest parent */ + parent?: (string|null); + + /** ImportTaxonomiesRequest inlineSource */ + inlineSource?: (google.cloud.datacatalog.v1.IInlineSource|null); + + /** ImportTaxonomiesRequest crossRegionalSource */ + crossRegionalSource?: (google.cloud.datacatalog.v1.ICrossRegionalSource|null); + } + + /** Represents an ImportTaxonomiesRequest. */ + class ImportTaxonomiesRequest implements IImportTaxonomiesRequest { + + /** + * Constructs a new ImportTaxonomiesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datacatalog.v1.IImportTaxonomiesRequest); + + /** ImportTaxonomiesRequest parent. */ + public parent: string; + + /** ImportTaxonomiesRequest inlineSource. */ + public inlineSource?: (google.cloud.datacatalog.v1.IInlineSource|null); + + /** ImportTaxonomiesRequest crossRegionalSource. */ + public crossRegionalSource?: (google.cloud.datacatalog.v1.ICrossRegionalSource|null); + + /** ImportTaxonomiesRequest source. */ + public source?: ("inlineSource"|"crossRegionalSource"); + + /** + * Creates a new ImportTaxonomiesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportTaxonomiesRequest instance + */ + public static create(properties?: google.cloud.datacatalog.v1.IImportTaxonomiesRequest): google.cloud.datacatalog.v1.ImportTaxonomiesRequest; + + /** + * Encodes the specified ImportTaxonomiesRequest message. Does not implicitly {@link google.cloud.datacatalog.v1.ImportTaxonomiesRequest.verify|verify} messages. + * @param message ImportTaxonomiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datacatalog.v1.IImportTaxonomiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportTaxonomiesRequest message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.ImportTaxonomiesRequest.verify|verify} messages. + * @param message ImportTaxonomiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datacatalog.v1.IImportTaxonomiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportTaxonomiesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportTaxonomiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datacatalog.v1.ImportTaxonomiesRequest; + + /** + * Decodes an ImportTaxonomiesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportTaxonomiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datacatalog.v1.ImportTaxonomiesRequest; + + /** + * Verifies an ImportTaxonomiesRequest message. + * @param message Plain 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 ImportTaxonomiesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportTaxonomiesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datacatalog.v1.ImportTaxonomiesRequest; + + /** + * Creates a plain object from an ImportTaxonomiesRequest message. Also converts values to other types if specified. + * @param message ImportTaxonomiesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datacatalog.v1.ImportTaxonomiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportTaxonomiesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InlineSource. */ + interface IInlineSource { + + /** InlineSource taxonomies */ + taxonomies?: (google.cloud.datacatalog.v1.ISerializedTaxonomy[]|null); + } + + /** Represents an InlineSource. */ + class InlineSource implements IInlineSource { + + /** + * Constructs a new InlineSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datacatalog.v1.IInlineSource); + + /** InlineSource taxonomies. */ + public taxonomies: google.cloud.datacatalog.v1.ISerializedTaxonomy[]; + + /** + * Creates a new InlineSource instance using the specified properties. + * @param [properties] Properties to set + * @returns InlineSource instance + */ + public static create(properties?: google.cloud.datacatalog.v1.IInlineSource): google.cloud.datacatalog.v1.InlineSource; + + /** + * Encodes the specified InlineSource message. Does not implicitly {@link google.cloud.datacatalog.v1.InlineSource.verify|verify} messages. + * @param message InlineSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datacatalog.v1.IInlineSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InlineSource message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.InlineSource.verify|verify} messages. + * @param message InlineSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datacatalog.v1.IInlineSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InlineSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InlineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datacatalog.v1.InlineSource; + + /** + * Decodes an InlineSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InlineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datacatalog.v1.InlineSource; + + /** + * Verifies an InlineSource message. + * @param message Plain 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 InlineSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InlineSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datacatalog.v1.InlineSource; + + /** + * Creates a plain object from an InlineSource message. Also converts values to other types if specified. + * @param message InlineSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datacatalog.v1.InlineSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InlineSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CrossRegionalSource. */ + interface ICrossRegionalSource { + + /** CrossRegionalSource taxonomy */ + taxonomy?: (string|null); + } + + /** Represents a CrossRegionalSource. */ + class CrossRegionalSource implements ICrossRegionalSource { + + /** + * Constructs a new CrossRegionalSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datacatalog.v1.ICrossRegionalSource); + + /** CrossRegionalSource taxonomy. */ + public taxonomy: string; + + /** + * Creates a new CrossRegionalSource instance using the specified properties. + * @param [properties] Properties to set + * @returns CrossRegionalSource instance + */ + public static create(properties?: google.cloud.datacatalog.v1.ICrossRegionalSource): google.cloud.datacatalog.v1.CrossRegionalSource; + + /** + * Encodes the specified CrossRegionalSource message. Does not implicitly {@link google.cloud.datacatalog.v1.CrossRegionalSource.verify|verify} messages. + * @param message CrossRegionalSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datacatalog.v1.ICrossRegionalSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CrossRegionalSource message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.CrossRegionalSource.verify|verify} messages. + * @param message CrossRegionalSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datacatalog.v1.ICrossRegionalSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CrossRegionalSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CrossRegionalSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datacatalog.v1.CrossRegionalSource; + + /** + * Decodes a CrossRegionalSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CrossRegionalSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datacatalog.v1.CrossRegionalSource; + + /** + * Verifies a CrossRegionalSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CrossRegionalSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CrossRegionalSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datacatalog.v1.CrossRegionalSource; + + /** + * Creates a plain object from a CrossRegionalSource message. Also converts values to other types if specified. + * @param message CrossRegionalSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datacatalog.v1.CrossRegionalSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CrossRegionalSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImportTaxonomiesResponse. */ + interface IImportTaxonomiesResponse { + + /** ImportTaxonomiesResponse taxonomies */ + taxonomies?: (google.cloud.datacatalog.v1.ITaxonomy[]|null); + } + + /** Represents an ImportTaxonomiesResponse. */ + class ImportTaxonomiesResponse implements IImportTaxonomiesResponse { + + /** + * Constructs a new ImportTaxonomiesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datacatalog.v1.IImportTaxonomiesResponse); + + /** ImportTaxonomiesResponse taxonomies. */ + public taxonomies: google.cloud.datacatalog.v1.ITaxonomy[]; + + /** + * Creates a new ImportTaxonomiesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportTaxonomiesResponse instance + */ + public static create(properties?: google.cloud.datacatalog.v1.IImportTaxonomiesResponse): google.cloud.datacatalog.v1.ImportTaxonomiesResponse; + + /** + * Encodes the specified ImportTaxonomiesResponse message. Does not implicitly {@link google.cloud.datacatalog.v1.ImportTaxonomiesResponse.verify|verify} messages. + * @param message ImportTaxonomiesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datacatalog.v1.IImportTaxonomiesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportTaxonomiesResponse message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.ImportTaxonomiesResponse.verify|verify} messages. + * @param message ImportTaxonomiesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datacatalog.v1.IImportTaxonomiesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportTaxonomiesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportTaxonomiesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datacatalog.v1.ImportTaxonomiesResponse; + + /** + * Decodes an ImportTaxonomiesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportTaxonomiesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datacatalog.v1.ImportTaxonomiesResponse; + + /** + * Verifies an ImportTaxonomiesResponse message. + * @param message Plain 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 ImportTaxonomiesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportTaxonomiesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datacatalog.v1.ImportTaxonomiesResponse; + + /** + * Creates a plain object from an ImportTaxonomiesResponse message. Also converts values to other types if specified. + * @param message ImportTaxonomiesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datacatalog.v1.ImportTaxonomiesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportTaxonomiesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ExportTaxonomiesRequest. */ + interface IExportTaxonomiesRequest { + + /** ExportTaxonomiesRequest parent */ + parent?: (string|null); + + /** ExportTaxonomiesRequest taxonomies */ + taxonomies?: (string[]|null); + + /** ExportTaxonomiesRequest serializedTaxonomies */ + serializedTaxonomies?: (boolean|null); + } + + /** Represents an ExportTaxonomiesRequest. */ + class ExportTaxonomiesRequest implements IExportTaxonomiesRequest { + + /** + * Constructs a new ExportTaxonomiesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datacatalog.v1.IExportTaxonomiesRequest); + + /** ExportTaxonomiesRequest parent. */ + public parent: string; + + /** ExportTaxonomiesRequest taxonomies. */ + public taxonomies: string[]; + + /** ExportTaxonomiesRequest serializedTaxonomies. */ + public serializedTaxonomies: boolean; + + /** ExportTaxonomiesRequest destination. */ + public destination?: "serializedTaxonomies"; + + /** + * Creates a new ExportTaxonomiesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportTaxonomiesRequest instance + */ + public static create(properties?: google.cloud.datacatalog.v1.IExportTaxonomiesRequest): google.cloud.datacatalog.v1.ExportTaxonomiesRequest; + + /** + * Encodes the specified ExportTaxonomiesRequest message. Does not implicitly {@link google.cloud.datacatalog.v1.ExportTaxonomiesRequest.verify|verify} messages. + * @param message ExportTaxonomiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datacatalog.v1.IExportTaxonomiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportTaxonomiesRequest message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.ExportTaxonomiesRequest.verify|verify} messages. + * @param message ExportTaxonomiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datacatalog.v1.IExportTaxonomiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportTaxonomiesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportTaxonomiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datacatalog.v1.ExportTaxonomiesRequest; + + /** + * Decodes an ExportTaxonomiesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportTaxonomiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datacatalog.v1.ExportTaxonomiesRequest; + + /** + * Verifies an ExportTaxonomiesRequest message. + * @param message Plain 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 ExportTaxonomiesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportTaxonomiesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datacatalog.v1.ExportTaxonomiesRequest; + + /** + * Creates a plain object from an ExportTaxonomiesRequest message. Also converts values to other types if specified. + * @param message ExportTaxonomiesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datacatalog.v1.ExportTaxonomiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportTaxonomiesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ExportTaxonomiesResponse. */ + interface IExportTaxonomiesResponse { + + /** ExportTaxonomiesResponse taxonomies */ + taxonomies?: (google.cloud.datacatalog.v1.ISerializedTaxonomy[]|null); + } + + /** Represents an ExportTaxonomiesResponse. */ + class ExportTaxonomiesResponse implements IExportTaxonomiesResponse { + + /** + * Constructs a new ExportTaxonomiesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datacatalog.v1.IExportTaxonomiesResponse); + + /** ExportTaxonomiesResponse taxonomies. */ + public taxonomies: google.cloud.datacatalog.v1.ISerializedTaxonomy[]; + + /** + * Creates a new ExportTaxonomiesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns FieldType instance + * @returns ExportTaxonomiesResponse instance */ - public static create(properties?: google.cloud.datacatalog.v1.IFieldType): google.cloud.datacatalog.v1.FieldType; + public static create(properties?: google.cloud.datacatalog.v1.IExportTaxonomiesResponse): google.cloud.datacatalog.v1.ExportTaxonomiesResponse; /** - * Encodes the specified FieldType message. Does not implicitly {@link google.cloud.datacatalog.v1.FieldType.verify|verify} messages. - * @param message FieldType message or plain object to encode + * Encodes the specified ExportTaxonomiesResponse message. Does not implicitly {@link google.cloud.datacatalog.v1.ExportTaxonomiesResponse.verify|verify} messages. + * @param message ExportTaxonomiesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.datacatalog.v1.IFieldType, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.datacatalog.v1.IExportTaxonomiesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified FieldType message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.FieldType.verify|verify} messages. - * @param message FieldType message or plain object to encode + * Encodes the specified ExportTaxonomiesResponse message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.ExportTaxonomiesResponse.verify|verify} messages. + * @param message ExportTaxonomiesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.datacatalog.v1.IFieldType, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.datacatalog.v1.IExportTaxonomiesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FieldType message from the specified reader or buffer. + * Decodes an ExportTaxonomiesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns FieldType + * @returns ExportTaxonomiesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datacatalog.v1.FieldType; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datacatalog.v1.ExportTaxonomiesResponse; /** - * Decodes a FieldType message from the specified reader or buffer, length delimited. + * Decodes an ExportTaxonomiesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FieldType + * @returns ExportTaxonomiesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datacatalog.v1.FieldType; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datacatalog.v1.ExportTaxonomiesResponse; /** - * Verifies a FieldType message. + * Verifies an ExportTaxonomiesResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a FieldType message from a plain object. Also converts values to their respective internal types. + * Creates an ExportTaxonomiesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FieldType + * @returns ExportTaxonomiesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.datacatalog.v1.FieldType; + public static fromObject(object: { [k: string]: any }): google.cloud.datacatalog.v1.ExportTaxonomiesResponse; /** - * Creates a plain object from a FieldType message. Also converts values to other types if specified. - * @param message FieldType + * Creates a plain object from an ExportTaxonomiesResponse message. Also converts values to other types if specified. + * @param message ExportTaxonomiesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.datacatalog.v1.FieldType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.datacatalog.v1.ExportTaxonomiesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FieldType to JSON. + * Converts this ExportTaxonomiesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - - namespace FieldType { - - /** Properties of an EnumType. */ - interface IEnumType { - - /** EnumType allowedValues */ - allowedValues?: (google.cloud.datacatalog.v1.FieldType.EnumType.IEnumValue[]|null); - } - - /** Represents an EnumType. */ - class EnumType implements IEnumType { - - /** - * Constructs a new EnumType. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.datacatalog.v1.FieldType.IEnumType); - - /** EnumType allowedValues. */ - public allowedValues: google.cloud.datacatalog.v1.FieldType.EnumType.IEnumValue[]; - - /** - * Creates a new EnumType instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumType instance - */ - public static create(properties?: google.cloud.datacatalog.v1.FieldType.IEnumType): google.cloud.datacatalog.v1.FieldType.EnumType; - - /** - * Encodes the specified EnumType message. Does not implicitly {@link google.cloud.datacatalog.v1.FieldType.EnumType.verify|verify} messages. - * @param message EnumType message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.datacatalog.v1.FieldType.IEnumType, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumType message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.FieldType.EnumType.verify|verify} messages. - * @param message EnumType message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.datacatalog.v1.FieldType.IEnumType, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumType message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datacatalog.v1.FieldType.EnumType; - - /** - * Decodes an EnumType message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datacatalog.v1.FieldType.EnumType; - - /** - * Verifies an EnumType message. - * @param message Plain 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 EnumType message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumType - */ - public static fromObject(object: { [k: string]: any }): google.cloud.datacatalog.v1.FieldType.EnumType; - - /** - * Creates a plain object from an EnumType message. Also converts values to other types if specified. - * @param message EnumType - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.datacatalog.v1.FieldType.EnumType, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumType to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace EnumType { - - /** Properties of an EnumValue. */ - interface IEnumValue { - - /** EnumValue displayName */ - displayName?: (string|null); - } - - /** Represents an EnumValue. */ - class EnumValue implements IEnumValue { - - /** - * Constructs a new EnumValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.datacatalog.v1.FieldType.EnumType.IEnumValue); - - /** EnumValue displayName. */ - public displayName: string; - - /** - * Creates a new EnumValue instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValue instance - */ - public static create(properties?: google.cloud.datacatalog.v1.FieldType.EnumType.IEnumValue): google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue; - - /** - * Encodes the specified EnumValue message. Does not implicitly {@link google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue.verify|verify} messages. - * @param message EnumValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.datacatalog.v1.FieldType.EnumType.IEnumValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValue message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue.verify|verify} messages. - * @param message EnumValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.datacatalog.v1.FieldType.EnumType.IEnumValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue; - - /** - * Decodes an EnumValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue; - - /** - * Verifies an EnumValue message. - * @param message Plain 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 EnumValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValue - */ - public static fromObject(object: { [k: string]: any }): google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue; - - /** - * Creates a plain object from an EnumValue message. Also converts values to other types if specified. - * @param message EnumValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** PrimitiveType enum. */ - enum PrimitiveType { - PRIMITIVE_TYPE_UNSPECIFIED = 0, - DOUBLE = 1, - STRING = 2, - BOOL = 3, - TIMESTAMP = 4 - } - } } /** Namespace v1beta1. */ @@ -13661,6 +16565,17 @@ export namespace google { /** Namespace api. */ namespace api { + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6 + } + /** Properties of a Http. */ interface IHttp { @@ -14000,17 +16915,6 @@ export namespace google { public toJSON(): { [k: string]: any }; } - /** FieldBehavior enum. */ - enum FieldBehavior { - FIELD_BEHAVIOR_UNSPECIFIED = 0, - OPTIONAL = 1, - REQUIRED = 2, - OUTPUT_ONLY = 3, - INPUT_ONLY = 4, - IMMUTABLE = 5, - UNORDERED_LIST = 6 - } - /** Properties of a ResourceDescriptor. */ interface IResourceDescriptor { diff --git a/packages/google-cloud-datacatalog/protos/protos.js b/packages/google-cloud-datacatalog/protos/protos.js index c712d2744c0..e08c343d579 100644 --- a/packages/google-cloud-datacatalog/protos/protos.js +++ b/packages/google-cloud-datacatalog/protos/protos.js @@ -73,15 +73,261 @@ * @property {number} INTEGRATED_SYSTEM_UNSPECIFIED=0 INTEGRATED_SYSTEM_UNSPECIFIED value * @property {number} BIGQUERY=1 BIGQUERY value * @property {number} CLOUD_PUBSUB=2 CLOUD_PUBSUB value + * @property {number} DATAPROC_METASTORE=3 DATAPROC_METASTORE value */ v1.IntegratedSystem = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "INTEGRATED_SYSTEM_UNSPECIFIED"] = 0; values[valuesById[1] = "BIGQUERY"] = 1; values[valuesById[2] = "CLOUD_PUBSUB"] = 2; + values[valuesById[3] = "DATAPROC_METASTORE"] = 3; return values; })(); + v1.DataSource = (function() { + + /** + * Properties of a DataSource. + * @memberof google.cloud.datacatalog.v1 + * @interface IDataSource + * @property {google.cloud.datacatalog.v1.DataSource.Service|null} [service] DataSource service + * @property {string|null} [resource] DataSource resource + */ + + /** + * Constructs a new DataSource. + * @memberof google.cloud.datacatalog.v1 + * @classdesc Represents a DataSource. + * @implements IDataSource + * @constructor + * @param {google.cloud.datacatalog.v1.IDataSource=} [properties] Properties to set + */ + function DataSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataSource service. + * @member {google.cloud.datacatalog.v1.DataSource.Service} service + * @memberof google.cloud.datacatalog.v1.DataSource + * @instance + */ + DataSource.prototype.service = 0; + + /** + * DataSource resource. + * @member {string} resource + * @memberof google.cloud.datacatalog.v1.DataSource + * @instance + */ + DataSource.prototype.resource = ""; + + /** + * Creates a new DataSource instance using the specified properties. + * @function create + * @memberof google.cloud.datacatalog.v1.DataSource + * @static + * @param {google.cloud.datacatalog.v1.IDataSource=} [properties] Properties to set + * @returns {google.cloud.datacatalog.v1.DataSource} DataSource instance + */ + DataSource.create = function create(properties) { + return new DataSource(properties); + }; + + /** + * Encodes the specified DataSource message. Does not implicitly {@link google.cloud.datacatalog.v1.DataSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.datacatalog.v1.DataSource + * @static + * @param {google.cloud.datacatalog.v1.IDataSource} message DataSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.service); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resource); + return writer; + }; + + /** + * Encodes the specified DataSource message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.DataSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datacatalog.v1.DataSource + * @static + * @param {google.cloud.datacatalog.v1.IDataSource} message DataSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datacatalog.v1.DataSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datacatalog.v1.DataSource} DataSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datacatalog.v1.DataSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.service = reader.int32(); + break; + case 2: + message.resource = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datacatalog.v1.DataSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datacatalog.v1.DataSource} DataSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataSource message. + * @function verify + * @memberof google.cloud.datacatalog.v1.DataSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.service != null && message.hasOwnProperty("service")) + switch (message.service) { + default: + return "service: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + return null; + }; + + /** + * Creates a DataSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datacatalog.v1.DataSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datacatalog.v1.DataSource} DataSource + */ + DataSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datacatalog.v1.DataSource) + return object; + var message = new $root.google.cloud.datacatalog.v1.DataSource(); + switch (object.service) { + case "SERVICE_UNSPECIFIED": + case 0: + message.service = 0; + break; + case "CLOUD_STORAGE": + case 1: + message.service = 1; + break; + case "BIGQUERY": + case 2: + message.service = 2; + break; + } + if (object.resource != null) + message.resource = String(object.resource); + return message; + }; + + /** + * Creates a plain object from a DataSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datacatalog.v1.DataSource + * @static + * @param {google.cloud.datacatalog.v1.DataSource} message DataSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.service = options.enums === String ? "SERVICE_UNSPECIFIED" : 0; + object.resource = ""; + } + if (message.service != null && message.hasOwnProperty("service")) + object.service = options.enums === String ? $root.google.cloud.datacatalog.v1.DataSource.Service[message.service] : message.service; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + return object; + }; + + /** + * Converts this DataSource to JSON. + * @function toJSON + * @memberof google.cloud.datacatalog.v1.DataSource + * @instance + * @returns {Object.} JSON object + */ + DataSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Service enum. + * @name google.cloud.datacatalog.v1.DataSource.Service + * @enum {number} + * @property {number} SERVICE_UNSPECIFIED=0 SERVICE_UNSPECIFIED value + * @property {number} CLOUD_STORAGE=1 CLOUD_STORAGE value + * @property {number} BIGQUERY=2 BIGQUERY value + */ + DataSource.Service = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SERVICE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD_STORAGE"] = 1; + values[valuesById[2] = "BIGQUERY"] = 2; + return values; + })(); + + return DataSource; + })(); + v1.DataCatalog = (function() { /** @@ -741,6 +987,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.datacatalog.v1.DataCatalog#renameTagTemplateFieldEnumValue}. + * @memberof google.cloud.datacatalog.v1.DataCatalog + * @typedef RenameTagTemplateFieldEnumValueCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datacatalog.v1.TagTemplateField} [response] TagTemplateField + */ + + /** + * Calls RenameTagTemplateFieldEnumValue. + * @function renameTagTemplateFieldEnumValue + * @memberof google.cloud.datacatalog.v1.DataCatalog + * @instance + * @param {google.cloud.datacatalog.v1.IRenameTagTemplateFieldEnumValueRequest} request RenameTagTemplateFieldEnumValueRequest message or plain object + * @param {google.cloud.datacatalog.v1.DataCatalog.RenameTagTemplateFieldEnumValueCallback} callback Node-style callback called with the error, if any, and TagTemplateField + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataCatalog.prototype.renameTagTemplateFieldEnumValue = function renameTagTemplateFieldEnumValue(request, callback) { + return this.rpcCall(renameTagTemplateFieldEnumValue, $root.google.cloud.datacatalog.v1.RenameTagTemplateFieldEnumValueRequest, $root.google.cloud.datacatalog.v1.TagTemplateField, request, callback); + }, "name", { value: "RenameTagTemplateFieldEnumValue" }); + + /** + * Calls RenameTagTemplateFieldEnumValue. + * @function renameTagTemplateFieldEnumValue + * @memberof google.cloud.datacatalog.v1.DataCatalog + * @instance + * @param {google.cloud.datacatalog.v1.IRenameTagTemplateFieldEnumValueRequest} request RenameTagTemplateFieldEnumValueRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.datacatalog.v1.DataCatalog#deleteTagTemplateField}. * @memberof google.cloud.datacatalog.v1.DataCatalog @@ -4046,6 +4325,7 @@ * @interface ILookupEntryRequest * @property {string|null} [linkedResource] LookupEntryRequest linkedResource * @property {string|null} [sqlResource] LookupEntryRequest sqlResource + * @property {string|null} [fullyQualifiedName] LookupEntryRequest fullyQualifiedName */ /** @@ -4079,17 +4359,25 @@ */ LookupEntryRequest.prototype.sqlResource = ""; + /** + * LookupEntryRequest fullyQualifiedName. + * @member {string} fullyQualifiedName + * @memberof google.cloud.datacatalog.v1.LookupEntryRequest + * @instance + */ + LookupEntryRequest.prototype.fullyQualifiedName = ""; + // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * LookupEntryRequest targetName. - * @member {"linkedResource"|"sqlResource"|undefined} targetName + * @member {"linkedResource"|"sqlResource"|"fullyQualifiedName"|undefined} targetName * @memberof google.cloud.datacatalog.v1.LookupEntryRequest * @instance */ Object.defineProperty(LookupEntryRequest.prototype, "targetName", { - get: $util.oneOfGetter($oneOfFields = ["linkedResource", "sqlResource"]), + get: $util.oneOfGetter($oneOfFields = ["linkedResource", "sqlResource", "fullyQualifiedName"]), set: $util.oneOfSetter($oneOfFields) }); @@ -4121,6 +4409,8 @@ writer.uint32(/* id 1, wireType 2 =*/10).string(message.linkedResource); if (message.sqlResource != null && Object.hasOwnProperty.call(message, "sqlResource")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.sqlResource); + if (message.fullyQualifiedName != null && Object.hasOwnProperty.call(message, "fullyQualifiedName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.fullyQualifiedName); return writer; }; @@ -4161,6 +4451,9 @@ case 3: message.sqlResource = reader.string(); break; + case 5: + message.fullyQualifiedName = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -4209,6 +4502,13 @@ if (!$util.isString(message.sqlResource)) return "sqlResource: string expected"; } + if (message.fullyQualifiedName != null && message.hasOwnProperty("fullyQualifiedName")) { + if (properties.targetName === 1) + return "targetName: multiple values"; + properties.targetName = 1; + if (!$util.isString(message.fullyQualifiedName)) + return "fullyQualifiedName: string expected"; + } return null; }; @@ -4228,6 +4528,8 @@ message.linkedResource = String(object.linkedResource); if (object.sqlResource != null) message.sqlResource = String(object.sqlResource); + if (object.fullyQualifiedName != null) + message.fullyQualifiedName = String(object.fullyQualifiedName); return message; }; @@ -4254,6 +4556,11 @@ if (options.oneofs) object.targetName = "sqlResource"; } + if (message.fullyQualifiedName != null && message.hasOwnProperty("fullyQualifiedName")) { + object.fullyQualifiedName = message.fullyQualifiedName; + if (options.oneofs) + object.targetName = "fullyQualifiedName"; + } return object; }; @@ -4279,6 +4586,7 @@ * @interface IEntry * @property {string|null} [name] Entry name * @property {string|null} [linkedResource] Entry linkedResource + * @property {string|null} [fullyQualifiedName] Entry fullyQualifiedName * @property {google.cloud.datacatalog.v1.EntryType|null} [type] Entry type * @property {string|null} [userSpecifiedType] Entry userSpecifiedType * @property {google.cloud.datacatalog.v1.IntegratedSystem|null} [integratedSystem] Entry integratedSystem @@ -4286,10 +4594,12 @@ * @property {google.cloud.datacatalog.v1.IGcsFilesetSpec|null} [gcsFilesetSpec] Entry gcsFilesetSpec * @property {google.cloud.datacatalog.v1.IBigQueryTableSpec|null} [bigqueryTableSpec] Entry bigqueryTableSpec * @property {google.cloud.datacatalog.v1.IBigQueryDateShardedSpec|null} [bigqueryDateShardedSpec] Entry bigqueryDateShardedSpec + * @property {google.cloud.datacatalog.v1.IDatabaseTableSpec|null} [databaseTableSpec] Entry databaseTableSpec * @property {string|null} [displayName] Entry displayName * @property {string|null} [description] Entry description * @property {google.cloud.datacatalog.v1.ISchema|null} [schema] Entry schema * @property {google.cloud.datacatalog.v1.ISystemTimestamps|null} [sourceSystemTimestamps] Entry sourceSystemTimestamps + * @property {google.cloud.datacatalog.v1.IDataSource|null} [dataSource] Entry dataSource */ /** @@ -4323,6 +4633,14 @@ */ Entry.prototype.linkedResource = ""; + /** + * Entry fullyQualifiedName. + * @member {string} fullyQualifiedName + * @memberof google.cloud.datacatalog.v1.Entry + * @instance + */ + Entry.prototype.fullyQualifiedName = ""; + /** * Entry type. * @member {google.cloud.datacatalog.v1.EntryType} type @@ -4379,6 +4697,14 @@ */ Entry.prototype.bigqueryDateShardedSpec = null; + /** + * Entry databaseTableSpec. + * @member {google.cloud.datacatalog.v1.IDatabaseTableSpec|null|undefined} databaseTableSpec + * @memberof google.cloud.datacatalog.v1.Entry + * @instance + */ + Entry.prototype.databaseTableSpec = null; + /** * Entry displayName. * @member {string} displayName @@ -4411,6 +4737,14 @@ */ Entry.prototype.sourceSystemTimestamps = null; + /** + * Entry dataSource. + * @member {google.cloud.datacatalog.v1.IDataSource|null|undefined} dataSource + * @memberof google.cloud.datacatalog.v1.Entry + * @instance + */ + Entry.prototype.dataSource = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -4447,6 +4781,17 @@ set: $util.oneOfSetter($oneOfFields) }); + /** + * Entry spec. + * @member {"databaseTableSpec"|undefined} spec + * @memberof google.cloud.datacatalog.v1.Entry + * @instance + */ + Object.defineProperty(Entry.prototype, "spec", { + get: $util.oneOfGetter($oneOfFields = ["databaseTableSpec"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new Entry instance using the specified properties. * @function create @@ -4497,6 +4842,12 @@ writer.uint32(/* id 17, wireType 0 =*/136).int32(message.integratedSystem); if (message.userSpecifiedSystem != null && Object.hasOwnProperty.call(message, "userSpecifiedSystem")) writer.uint32(/* id 18, wireType 2 =*/146).string(message.userSpecifiedSystem); + if (message.dataSource != null && Object.hasOwnProperty.call(message, "dataSource")) + $root.google.cloud.datacatalog.v1.DataSource.encode(message.dataSource, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.databaseTableSpec != null && Object.hasOwnProperty.call(message, "databaseTableSpec")) + $root.google.cloud.datacatalog.v1.DatabaseTableSpec.encode(message.databaseTableSpec, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.fullyQualifiedName != null && Object.hasOwnProperty.call(message, "fullyQualifiedName")) + writer.uint32(/* id 29, wireType 2 =*/234).string(message.fullyQualifiedName); return writer; }; @@ -4537,6 +4888,9 @@ case 9: message.linkedResource = reader.string(); break; + case 29: + message.fullyQualifiedName = reader.string(); + break; case 2: message.type = reader.int32(); break; @@ -4558,6 +4912,9 @@ case 15: message.bigqueryDateShardedSpec = $root.google.cloud.datacatalog.v1.BigQueryDateShardedSpec.decode(reader, reader.uint32()); break; + case 24: + message.databaseTableSpec = $root.google.cloud.datacatalog.v1.DatabaseTableSpec.decode(reader, reader.uint32()); + break; case 3: message.displayName = reader.string(); break; @@ -4570,6 +4927,9 @@ case 7: message.sourceSystemTimestamps = $root.google.cloud.datacatalog.v1.SystemTimestamps.decode(reader, reader.uint32()); break; + case 20: + message.dataSource = $root.google.cloud.datacatalog.v1.DataSource.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -4612,6 +4972,9 @@ if (message.linkedResource != null && message.hasOwnProperty("linkedResource")) if (!$util.isString(message.linkedResource)) return "linkedResource: string expected"; + if (message.fullyQualifiedName != null && message.hasOwnProperty("fullyQualifiedName")) + if (!$util.isString(message.fullyQualifiedName)) + return "fullyQualifiedName: string expected"; if (message.type != null && message.hasOwnProperty("type")) { properties.entryType = 1; switch (message.type) { @@ -4622,6 +4985,8 @@ case 5: case 3: case 4: + case 7: + case 14: break; } } @@ -4640,6 +5005,7 @@ case 0: case 1: case 2: + case 3: break; } } @@ -4678,6 +5044,14 @@ return "bigqueryDateShardedSpec." + error; } } + if (message.databaseTableSpec != null && message.hasOwnProperty("databaseTableSpec")) { + properties.spec = 1; + { + var error = $root.google.cloud.datacatalog.v1.DatabaseTableSpec.verify(message.databaseTableSpec); + if (error) + return "databaseTableSpec." + error; + } + } if (message.displayName != null && message.hasOwnProperty("displayName")) if (!$util.isString(message.displayName)) return "displayName: string expected"; @@ -4694,6 +5068,11 @@ if (error) return "sourceSystemTimestamps." + error; } + if (message.dataSource != null && message.hasOwnProperty("dataSource")) { + var error = $root.google.cloud.datacatalog.v1.DataSource.verify(message.dataSource); + if (error) + return "dataSource." + error; + } return null; }; @@ -4713,6 +5092,8 @@ message.name = String(object.name); if (object.linkedResource != null) message.linkedResource = String(object.linkedResource); + if (object.fullyQualifiedName != null) + message.fullyQualifiedName = String(object.fullyQualifiedName); switch (object.type) { case "ENTRY_TYPE_UNSPECIFIED": case 0: @@ -4734,6 +5115,14 @@ case 4: message.type = 4; break; + case "DATABASE": + case 7: + message.type = 7; + break; + case "SERVICE": + case 14: + message.type = 14; + break; } if (object.userSpecifiedType != null) message.userSpecifiedType = String(object.userSpecifiedType); @@ -4750,6 +5139,10 @@ case 2: message.integratedSystem = 2; break; + case "DATAPROC_METASTORE": + case 3: + message.integratedSystem = 3; + break; } if (object.userSpecifiedSystem != null) message.userSpecifiedSystem = String(object.userSpecifiedSystem); @@ -4768,6 +5161,11 @@ throw TypeError(".google.cloud.datacatalog.v1.Entry.bigqueryDateShardedSpec: object expected"); message.bigqueryDateShardedSpec = $root.google.cloud.datacatalog.v1.BigQueryDateShardedSpec.fromObject(object.bigqueryDateShardedSpec); } + if (object.databaseTableSpec != null) { + if (typeof object.databaseTableSpec !== "object") + throw TypeError(".google.cloud.datacatalog.v1.Entry.databaseTableSpec: object expected"); + message.databaseTableSpec = $root.google.cloud.datacatalog.v1.DatabaseTableSpec.fromObject(object.databaseTableSpec); + } if (object.displayName != null) message.displayName = String(object.displayName); if (object.description != null) @@ -4782,6 +5180,11 @@ throw TypeError(".google.cloud.datacatalog.v1.Entry.sourceSystemTimestamps: object expected"); message.sourceSystemTimestamps = $root.google.cloud.datacatalog.v1.SystemTimestamps.fromObject(object.sourceSystemTimestamps); } + if (object.dataSource != null) { + if (typeof object.dataSource !== "object") + throw TypeError(".google.cloud.datacatalog.v1.Entry.dataSource: object expected"); + message.dataSource = $root.google.cloud.datacatalog.v1.DataSource.fromObject(object.dataSource); + } return message; }; @@ -4805,6 +5208,8 @@ object.schema = null; object.sourceSystemTimestamps = null; object.linkedResource = ""; + object.dataSource = null; + object.fullyQualifiedName = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -4853,6 +5258,15 @@ if (options.oneofs) object.system = "userSpecifiedSystem"; } + if (message.dataSource != null && message.hasOwnProperty("dataSource")) + object.dataSource = $root.google.cloud.datacatalog.v1.DataSource.toObject(message.dataSource, options); + if (message.databaseTableSpec != null && message.hasOwnProperty("databaseTableSpec")) { + object.databaseTableSpec = $root.google.cloud.datacatalog.v1.DatabaseTableSpec.toObject(message.databaseTableSpec, options); + if (options.oneofs) + object.spec = "databaseTableSpec"; + } + if (message.fullyQualifiedName != null && message.hasOwnProperty("fullyQualifiedName")) + object.fullyQualifiedName = message.fullyQualifiedName; return object; }; @@ -4870,6 +5284,227 @@ return Entry; })(); + v1.DatabaseTableSpec = (function() { + + /** + * Properties of a DatabaseTableSpec. + * @memberof google.cloud.datacatalog.v1 + * @interface IDatabaseTableSpec + * @property {google.cloud.datacatalog.v1.DatabaseTableSpec.TableType|null} [type] DatabaseTableSpec type + */ + + /** + * Constructs a new DatabaseTableSpec. + * @memberof google.cloud.datacatalog.v1 + * @classdesc Represents a DatabaseTableSpec. + * @implements IDatabaseTableSpec + * @constructor + * @param {google.cloud.datacatalog.v1.IDatabaseTableSpec=} [properties] Properties to set + */ + function DatabaseTableSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DatabaseTableSpec type. + * @member {google.cloud.datacatalog.v1.DatabaseTableSpec.TableType} type + * @memberof google.cloud.datacatalog.v1.DatabaseTableSpec + * @instance + */ + DatabaseTableSpec.prototype.type = 0; + + /** + * Creates a new DatabaseTableSpec instance using the specified properties. + * @function create + * @memberof google.cloud.datacatalog.v1.DatabaseTableSpec + * @static + * @param {google.cloud.datacatalog.v1.IDatabaseTableSpec=} [properties] Properties to set + * @returns {google.cloud.datacatalog.v1.DatabaseTableSpec} DatabaseTableSpec instance + */ + DatabaseTableSpec.create = function create(properties) { + return new DatabaseTableSpec(properties); + }; + + /** + * Encodes the specified DatabaseTableSpec message. Does not implicitly {@link google.cloud.datacatalog.v1.DatabaseTableSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.datacatalog.v1.DatabaseTableSpec + * @static + * @param {google.cloud.datacatalog.v1.IDatabaseTableSpec} message DatabaseTableSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatabaseTableSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + return writer; + }; + + /** + * Encodes the specified DatabaseTableSpec message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.DatabaseTableSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datacatalog.v1.DatabaseTableSpec + * @static + * @param {google.cloud.datacatalog.v1.IDatabaseTableSpec} message DatabaseTableSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatabaseTableSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DatabaseTableSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datacatalog.v1.DatabaseTableSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datacatalog.v1.DatabaseTableSpec} DatabaseTableSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatabaseTableSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datacatalog.v1.DatabaseTableSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DatabaseTableSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datacatalog.v1.DatabaseTableSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datacatalog.v1.DatabaseTableSpec} DatabaseTableSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatabaseTableSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DatabaseTableSpec message. + * @function verify + * @memberof google.cloud.datacatalog.v1.DatabaseTableSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DatabaseTableSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a DatabaseTableSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datacatalog.v1.DatabaseTableSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datacatalog.v1.DatabaseTableSpec} DatabaseTableSpec + */ + DatabaseTableSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datacatalog.v1.DatabaseTableSpec) + return object; + var message = new $root.google.cloud.datacatalog.v1.DatabaseTableSpec(); + switch (object.type) { + case "TABLE_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "NATIVE": + case 1: + message.type = 1; + break; + case "EXTERNAL": + case 2: + message.type = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a DatabaseTableSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datacatalog.v1.DatabaseTableSpec + * @static + * @param {google.cloud.datacatalog.v1.DatabaseTableSpec} message DatabaseTableSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DatabaseTableSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.type = options.enums === String ? "TABLE_TYPE_UNSPECIFIED" : 0; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.datacatalog.v1.DatabaseTableSpec.TableType[message.type] : message.type; + return object; + }; + + /** + * Converts this DatabaseTableSpec to JSON. + * @function toJSON + * @memberof google.cloud.datacatalog.v1.DatabaseTableSpec + * @instance + * @returns {Object.} JSON object + */ + DatabaseTableSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * TableType enum. + * @name google.cloud.datacatalog.v1.DatabaseTableSpec.TableType + * @enum {number} + * @property {number} TABLE_TYPE_UNSPECIFIED=0 TABLE_TYPE_UNSPECIFIED value + * @property {number} NATIVE=1 NATIVE value + * @property {number} EXTERNAL=2 EXTERNAL value + */ + DatabaseTableSpec.TableType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TABLE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NATIVE"] = 1; + values[valuesById[2] = "EXTERNAL"] = 2; + return values; + })(); + + return DatabaseTableSpec; + })(); + v1.EntryGroup = (function() { /** @@ -7294,6 +7929,216 @@ return RenameTagTemplateFieldRequest; })(); + v1.RenameTagTemplateFieldEnumValueRequest = (function() { + + /** + * Properties of a RenameTagTemplateFieldEnumValueRequest. + * @memberof google.cloud.datacatalog.v1 + * @interface IRenameTagTemplateFieldEnumValueRequest + * @property {string|null} [name] RenameTagTemplateFieldEnumValueRequest name + * @property {string|null} [newEnumValueDisplayName] RenameTagTemplateFieldEnumValueRequest newEnumValueDisplayName + */ + + /** + * Constructs a new RenameTagTemplateFieldEnumValueRequest. + * @memberof google.cloud.datacatalog.v1 + * @classdesc Represents a RenameTagTemplateFieldEnumValueRequest. + * @implements IRenameTagTemplateFieldEnumValueRequest + * @constructor + * @param {google.cloud.datacatalog.v1.IRenameTagTemplateFieldEnumValueRequest=} [properties] Properties to set + */ + function RenameTagTemplateFieldEnumValueRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RenameTagTemplateFieldEnumValueRequest name. + * @member {string} name + * @memberof google.cloud.datacatalog.v1.RenameTagTemplateFieldEnumValueRequest + * @instance + */ + RenameTagTemplateFieldEnumValueRequest.prototype.name = ""; + + /** + * RenameTagTemplateFieldEnumValueRequest newEnumValueDisplayName. + * @member {string} newEnumValueDisplayName + * @memberof google.cloud.datacatalog.v1.RenameTagTemplateFieldEnumValueRequest + * @instance + */ + RenameTagTemplateFieldEnumValueRequest.prototype.newEnumValueDisplayName = ""; + + /** + * Creates a new RenameTagTemplateFieldEnumValueRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datacatalog.v1.RenameTagTemplateFieldEnumValueRequest + * @static + * @param {google.cloud.datacatalog.v1.IRenameTagTemplateFieldEnumValueRequest=} [properties] Properties to set + * @returns {google.cloud.datacatalog.v1.RenameTagTemplateFieldEnumValueRequest} RenameTagTemplateFieldEnumValueRequest instance + */ + RenameTagTemplateFieldEnumValueRequest.create = function create(properties) { + return new RenameTagTemplateFieldEnumValueRequest(properties); + }; + + /** + * Encodes the specified RenameTagTemplateFieldEnumValueRequest message. Does not implicitly {@link google.cloud.datacatalog.v1.RenameTagTemplateFieldEnumValueRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datacatalog.v1.RenameTagTemplateFieldEnumValueRequest + * @static + * @param {google.cloud.datacatalog.v1.IRenameTagTemplateFieldEnumValueRequest} message RenameTagTemplateFieldEnumValueRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RenameTagTemplateFieldEnumValueRequest.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.newEnumValueDisplayName != null && Object.hasOwnProperty.call(message, "newEnumValueDisplayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.newEnumValueDisplayName); + return writer; + }; + + /** + * Encodes the specified RenameTagTemplateFieldEnumValueRequest message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.RenameTagTemplateFieldEnumValueRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datacatalog.v1.RenameTagTemplateFieldEnumValueRequest + * @static + * @param {google.cloud.datacatalog.v1.IRenameTagTemplateFieldEnumValueRequest} message RenameTagTemplateFieldEnumValueRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RenameTagTemplateFieldEnumValueRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RenameTagTemplateFieldEnumValueRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datacatalog.v1.RenameTagTemplateFieldEnumValueRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datacatalog.v1.RenameTagTemplateFieldEnumValueRequest} RenameTagTemplateFieldEnumValueRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RenameTagTemplateFieldEnumValueRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datacatalog.v1.RenameTagTemplateFieldEnumValueRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.newEnumValueDisplayName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RenameTagTemplateFieldEnumValueRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datacatalog.v1.RenameTagTemplateFieldEnumValueRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datacatalog.v1.RenameTagTemplateFieldEnumValueRequest} RenameTagTemplateFieldEnumValueRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RenameTagTemplateFieldEnumValueRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RenameTagTemplateFieldEnumValueRequest message. + * @function verify + * @memberof google.cloud.datacatalog.v1.RenameTagTemplateFieldEnumValueRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RenameTagTemplateFieldEnumValueRequest.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.newEnumValueDisplayName != null && message.hasOwnProperty("newEnumValueDisplayName")) + if (!$util.isString(message.newEnumValueDisplayName)) + return "newEnumValueDisplayName: string expected"; + return null; + }; + + /** + * Creates a RenameTagTemplateFieldEnumValueRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datacatalog.v1.RenameTagTemplateFieldEnumValueRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datacatalog.v1.RenameTagTemplateFieldEnumValueRequest} RenameTagTemplateFieldEnumValueRequest + */ + RenameTagTemplateFieldEnumValueRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datacatalog.v1.RenameTagTemplateFieldEnumValueRequest) + return object; + var message = new $root.google.cloud.datacatalog.v1.RenameTagTemplateFieldEnumValueRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.newEnumValueDisplayName != null) + message.newEnumValueDisplayName = String(object.newEnumValueDisplayName); + return message; + }; + + /** + * Creates a plain object from a RenameTagTemplateFieldEnumValueRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datacatalog.v1.RenameTagTemplateFieldEnumValueRequest + * @static + * @param {google.cloud.datacatalog.v1.RenameTagTemplateFieldEnumValueRequest} message RenameTagTemplateFieldEnumValueRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RenameTagTemplateFieldEnumValueRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.newEnumValueDisplayName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.newEnumValueDisplayName != null && message.hasOwnProperty("newEnumValueDisplayName")) + object.newEnumValueDisplayName = message.newEnumValueDisplayName; + return object; + }; + + /** + * Converts this RenameTagTemplateFieldEnumValueRequest to JSON. + * @function toJSON + * @memberof google.cloud.datacatalog.v1.RenameTagTemplateFieldEnumValueRequest + * @instance + * @returns {Object.} JSON object + */ + RenameTagTemplateFieldEnumValueRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RenameTagTemplateFieldEnumValueRequest; + })(); + v1.DeleteTagTemplateFieldRequest = (function() { /** @@ -8466,6 +9311,8 @@ * @property {number} MODEL=5 MODEL value * @property {number} DATA_STREAM=3 DATA_STREAM value * @property {number} FILESET=4 FILESET value + * @property {number} DATABASE=7 DATABASE value + * @property {number} SERVICE=14 SERVICE value */ v1.EntryType = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -8474,6 +9321,8 @@ values[valuesById[5] = "MODEL"] = 5; values[valuesById[3] = "DATA_STREAM"] = 3; values[valuesById[4] = "FILESET"] = 4; + values[valuesById[7] = "DATABASE"] = 7; + values[valuesById[14] = "SERVICE"] = 14; return values; })(); @@ -9738,8 +10587,10 @@ * @property {string|null} [searchResultSubtype] SearchCatalogResult searchResultSubtype * @property {string|null} [relativeResourceName] SearchCatalogResult relativeResourceName * @property {string|null} [linkedResource] SearchCatalogResult linkedResource + * @property {google.protobuf.ITimestamp|null} [modifyTime] SearchCatalogResult modifyTime * @property {google.cloud.datacatalog.v1.IntegratedSystem|null} [integratedSystem] SearchCatalogResult integratedSystem * @property {string|null} [userSpecifiedSystem] SearchCatalogResult userSpecifiedSystem + * @property {string|null} [fullyQualifiedName] SearchCatalogResult fullyQualifiedName */ /** @@ -9789,6 +10640,14 @@ */ SearchCatalogResult.prototype.linkedResource = ""; + /** + * SearchCatalogResult modifyTime. + * @member {google.protobuf.ITimestamp|null|undefined} modifyTime + * @memberof google.cloud.datacatalog.v1.SearchCatalogResult + * @instance + */ + SearchCatalogResult.prototype.modifyTime = null; + /** * SearchCatalogResult integratedSystem. * @member {google.cloud.datacatalog.v1.IntegratedSystem} integratedSystem @@ -9805,6 +10664,14 @@ */ SearchCatalogResult.prototype.userSpecifiedSystem = ""; + /** + * SearchCatalogResult fullyQualifiedName. + * @member {string} fullyQualifiedName + * @memberof google.cloud.datacatalog.v1.SearchCatalogResult + * @instance + */ + SearchCatalogResult.prototype.fullyQualifiedName = ""; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -9851,10 +10718,14 @@ writer.uint32(/* id 3, wireType 2 =*/26).string(message.relativeResourceName); if (message.linkedResource != null && Object.hasOwnProperty.call(message, "linkedResource")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.linkedResource); + if (message.modifyTime != null && Object.hasOwnProperty.call(message, "modifyTime")) + $root.google.protobuf.Timestamp.encode(message.modifyTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.integratedSystem != null && Object.hasOwnProperty.call(message, "integratedSystem")) writer.uint32(/* id 8, wireType 0 =*/64).int32(message.integratedSystem); if (message.userSpecifiedSystem != null && Object.hasOwnProperty.call(message, "userSpecifiedSystem")) writer.uint32(/* id 9, wireType 2 =*/74).string(message.userSpecifiedSystem); + if (message.fullyQualifiedName != null && Object.hasOwnProperty.call(message, "fullyQualifiedName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.fullyQualifiedName); return writer; }; @@ -9901,12 +10772,18 @@ case 4: message.linkedResource = reader.string(); break; + case 7: + message.modifyTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; case 8: message.integratedSystem = reader.int32(); break; case 9: message.userSpecifiedSystem = reader.string(); break; + case 10: + message.fullyQualifiedName = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -9962,6 +10839,11 @@ if (message.linkedResource != null && message.hasOwnProperty("linkedResource")) if (!$util.isString(message.linkedResource)) return "linkedResource: string expected"; + if (message.modifyTime != null && message.hasOwnProperty("modifyTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.modifyTime); + if (error) + return "modifyTime." + error; + } if (message.integratedSystem != null && message.hasOwnProperty("integratedSystem")) { properties.system = 1; switch (message.integratedSystem) { @@ -9970,6 +10852,7 @@ case 0: case 1: case 2: + case 3: break; } } @@ -9980,6 +10863,9 @@ if (!$util.isString(message.userSpecifiedSystem)) return "userSpecifiedSystem: string expected"; } + if (message.fullyQualifiedName != null && message.hasOwnProperty("fullyQualifiedName")) + if (!$util.isString(message.fullyQualifiedName)) + return "fullyQualifiedName: string expected"; return null; }; @@ -10019,6 +10905,11 @@ message.relativeResourceName = String(object.relativeResourceName); if (object.linkedResource != null) message.linkedResource = String(object.linkedResource); + if (object.modifyTime != null) { + if (typeof object.modifyTime !== "object") + throw TypeError(".google.cloud.datacatalog.v1.SearchCatalogResult.modifyTime: object expected"); + message.modifyTime = $root.google.protobuf.Timestamp.fromObject(object.modifyTime); + } switch (object.integratedSystem) { case "INTEGRATED_SYSTEM_UNSPECIFIED": case 0: @@ -10032,9 +10923,15 @@ case 2: message.integratedSystem = 2; break; + case "DATAPROC_METASTORE": + case 3: + message.integratedSystem = 3; + break; } if (object.userSpecifiedSystem != null) message.userSpecifiedSystem = String(object.userSpecifiedSystem); + if (object.fullyQualifiedName != null) + message.fullyQualifiedName = String(object.fullyQualifiedName); return message; }; @@ -10056,6 +10953,8 @@ object.searchResultSubtype = ""; object.relativeResourceName = ""; object.linkedResource = ""; + object.modifyTime = null; + object.fullyQualifiedName = ""; } if (message.searchResultType != null && message.hasOwnProperty("searchResultType")) object.searchResultType = options.enums === String ? $root.google.cloud.datacatalog.v1.SearchResultType[message.searchResultType] : message.searchResultType; @@ -10065,6 +10964,8 @@ object.relativeResourceName = message.relativeResourceName; if (message.linkedResource != null && message.hasOwnProperty("linkedResource")) object.linkedResource = message.linkedResource; + if (message.modifyTime != null && message.hasOwnProperty("modifyTime")) + object.modifyTime = $root.google.protobuf.Timestamp.toObject(message.modifyTime, options); if (message.integratedSystem != null && message.hasOwnProperty("integratedSystem")) { object.integratedSystem = options.enums === String ? $root.google.cloud.datacatalog.v1.IntegratedSystem[message.integratedSystem] : message.integratedSystem; if (options.oneofs) @@ -10075,6 +10976,8 @@ if (options.oneofs) object.system = "userSpecifiedSystem"; } + if (message.fullyQualifiedName != null && message.hasOwnProperty("fullyQualifiedName")) + object.fullyQualifiedName = message.fullyQualifiedName; return object; }; @@ -10290,6 +11193,7 @@ case 0: case 2: case 5: + case 7: break; } if (message.viewSpec != null && message.hasOwnProperty("viewSpec")) { @@ -10338,6 +11242,10 @@ case 5: message.tableSourceType = 5; break; + case "BIGQUERY_MATERIALIZED_VIEW": + case 7: + message.tableSourceType = 7; + break; } if (object.viewSpec != null) { if (typeof object.viewSpec !== "object") @@ -10403,12 +11311,14 @@ * @property {number} TABLE_SOURCE_TYPE_UNSPECIFIED=0 TABLE_SOURCE_TYPE_UNSPECIFIED value * @property {number} BIGQUERY_VIEW=2 BIGQUERY_VIEW value * @property {number} BIGQUERY_TABLE=5 BIGQUERY_TABLE value + * @property {number} BIGQUERY_MATERIALIZED_VIEW=7 BIGQUERY_MATERIALIZED_VIEW value */ v1.TableSourceType = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "TABLE_SOURCE_TYPE_UNSPECIFIED"] = 0; values[valuesById[2] = "BIGQUERY_VIEW"] = 2; values[valuesById[5] = "BIGQUERY_TABLE"] = 5; + values[valuesById[7] = "BIGQUERY_MATERIALIZED_VIEW"] = 7; return values; })(); @@ -12217,6 +13127,7 @@ * @property {string|null} [displayName] TagTemplateField displayName * @property {google.cloud.datacatalog.v1.IFieldType|null} [type] TagTemplateField type * @property {boolean|null} [isRequired] TagTemplateField isRequired + * @property {string|null} [description] TagTemplateField description * @property {number|null} [order] TagTemplateField order */ @@ -12267,6 +13178,14 @@ */ TagTemplateField.prototype.isRequired = false; + /** + * TagTemplateField description. + * @member {string} description + * @memberof google.cloud.datacatalog.v1.TagTemplateField + * @instance + */ + TagTemplateField.prototype.description = ""; + /** * TagTemplateField order. * @member {number} order @@ -12305,6 +13224,8 @@ $root.google.cloud.datacatalog.v1.FieldType.encode(message.type, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.isRequired != null && Object.hasOwnProperty.call(message, "isRequired")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isRequired); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.description); if (message.order != null && Object.hasOwnProperty.call(message, "order")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.order); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -12355,6 +13276,9 @@ case 3: message.isRequired = reader.bool(); break; + case 4: + message.description = reader.string(); + break; case 5: message.order = reader.int32(); break; @@ -12407,6 +13331,9 @@ if (message.isRequired != null && message.hasOwnProperty("isRequired")) if (typeof message.isRequired !== "boolean") return "isRequired: boolean expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; if (message.order != null && message.hasOwnProperty("order")) if (!$util.isInteger(message.order)) return "order: integer expected"; @@ -12436,6 +13363,8 @@ } if (object.isRequired != null) message.isRequired = Boolean(object.isRequired); + if (object.description != null) + message.description = String(object.description); if (object.order != null) message.order = object.order | 0; return message; @@ -12458,6 +13387,7 @@ object.displayName = ""; object.type = null; object.isRequired = false; + object.description = ""; object.order = 0; object.name = ""; } @@ -12467,6 +13397,8 @@ object.type = $root.google.cloud.datacatalog.v1.FieldType.toObject(message.type, options); if (message.isRequired != null && message.hasOwnProperty("isRequired")) object.isRequired = message.isRequired; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; if (message.order != null && message.hasOwnProperty("order")) object.order = message.order; if (message.name != null && message.hasOwnProperty("name")) @@ -12707,467 +13639,6164 @@ message.primitiveType = 4; break; } - if (object.enumType != null) { - if (typeof object.enumType !== "object") - throw TypeError(".google.cloud.datacatalog.v1.FieldType.enumType: object expected"); - message.enumType = $root.google.cloud.datacatalog.v1.FieldType.EnumType.fromObject(object.enumType); + if (object.enumType != null) { + if (typeof object.enumType !== "object") + throw TypeError(".google.cloud.datacatalog.v1.FieldType.enumType: object expected"); + message.enumType = $root.google.cloud.datacatalog.v1.FieldType.EnumType.fromObject(object.enumType); + } + return message; + }; + + /** + * Creates a plain object from a FieldType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datacatalog.v1.FieldType + * @static + * @param {google.cloud.datacatalog.v1.FieldType} message FieldType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.primitiveType != null && message.hasOwnProperty("primitiveType")) { + object.primitiveType = options.enums === String ? $root.google.cloud.datacatalog.v1.FieldType.PrimitiveType[message.primitiveType] : message.primitiveType; + if (options.oneofs) + object.typeDecl = "primitiveType"; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + object.enumType = $root.google.cloud.datacatalog.v1.FieldType.EnumType.toObject(message.enumType, options); + if (options.oneofs) + object.typeDecl = "enumType"; + } + return object; + }; + + /** + * Converts this FieldType to JSON. + * @function toJSON + * @memberof google.cloud.datacatalog.v1.FieldType + * @instance + * @returns {Object.} JSON object + */ + FieldType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + FieldType.EnumType = (function() { + + /** + * Properties of an EnumType. + * @memberof google.cloud.datacatalog.v1.FieldType + * @interface IEnumType + * @property {Array.|null} [allowedValues] EnumType allowedValues + */ + + /** + * Constructs a new EnumType. + * @memberof google.cloud.datacatalog.v1.FieldType + * @classdesc Represents an EnumType. + * @implements IEnumType + * @constructor + * @param {google.cloud.datacatalog.v1.FieldType.IEnumType=} [properties] Properties to set + */ + function EnumType(properties) { + this.allowedValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumType allowedValues. + * @member {Array.} allowedValues + * @memberof google.cloud.datacatalog.v1.FieldType.EnumType + * @instance + */ + EnumType.prototype.allowedValues = $util.emptyArray; + + /** + * Creates a new EnumType instance using the specified properties. + * @function create + * @memberof google.cloud.datacatalog.v1.FieldType.EnumType + * @static + * @param {google.cloud.datacatalog.v1.FieldType.IEnumType=} [properties] Properties to set + * @returns {google.cloud.datacatalog.v1.FieldType.EnumType} EnumType instance + */ + EnumType.create = function create(properties) { + return new EnumType(properties); + }; + + /** + * Encodes the specified EnumType message. Does not implicitly {@link google.cloud.datacatalog.v1.FieldType.EnumType.verify|verify} messages. + * @function encode + * @memberof google.cloud.datacatalog.v1.FieldType.EnumType + * @static + * @param {google.cloud.datacatalog.v1.FieldType.IEnumType} message EnumType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumType.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedValues != null && message.allowedValues.length) + for (var i = 0; i < message.allowedValues.length; ++i) + $root.google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue.encode(message.allowedValues[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumType message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.FieldType.EnumType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datacatalog.v1.FieldType.EnumType + * @static + * @param {google.cloud.datacatalog.v1.FieldType.IEnumType} message EnumType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumType message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datacatalog.v1.FieldType.EnumType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datacatalog.v1.FieldType.EnumType} EnumType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumType.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datacatalog.v1.FieldType.EnumType(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.allowedValues && message.allowedValues.length)) + message.allowedValues = []; + message.allowedValues.push($root.google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datacatalog.v1.FieldType.EnumType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datacatalog.v1.FieldType.EnumType} EnumType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumType message. + * @function verify + * @memberof google.cloud.datacatalog.v1.FieldType.EnumType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumType.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowedValues != null && message.hasOwnProperty("allowedValues")) { + if (!Array.isArray(message.allowedValues)) + return "allowedValues: array expected"; + for (var i = 0; i < message.allowedValues.length; ++i) { + var error = $root.google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue.verify(message.allowedValues[i]); + if (error) + return "allowedValues." + error; + } + } + return null; + }; + + /** + * Creates an EnumType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datacatalog.v1.FieldType.EnumType + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datacatalog.v1.FieldType.EnumType} EnumType + */ + EnumType.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datacatalog.v1.FieldType.EnumType) + return object; + var message = new $root.google.cloud.datacatalog.v1.FieldType.EnumType(); + if (object.allowedValues) { + if (!Array.isArray(object.allowedValues)) + throw TypeError(".google.cloud.datacatalog.v1.FieldType.EnumType.allowedValues: array expected"); + message.allowedValues = []; + for (var i = 0; i < object.allowedValues.length; ++i) { + if (typeof object.allowedValues[i] !== "object") + throw TypeError(".google.cloud.datacatalog.v1.FieldType.EnumType.allowedValues: object expected"); + message.allowedValues[i] = $root.google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue.fromObject(object.allowedValues[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datacatalog.v1.FieldType.EnumType + * @static + * @param {google.cloud.datacatalog.v1.FieldType.EnumType} message EnumType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedValues = []; + if (message.allowedValues && message.allowedValues.length) { + object.allowedValues = []; + for (var j = 0; j < message.allowedValues.length; ++j) + object.allowedValues[j] = $root.google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue.toObject(message.allowedValues[j], options); + } + return object; + }; + + /** + * Converts this EnumType to JSON. + * @function toJSON + * @memberof google.cloud.datacatalog.v1.FieldType.EnumType + * @instance + * @returns {Object.} JSON object + */ + EnumType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + EnumType.EnumValue = (function() { + + /** + * Properties of an EnumValue. + * @memberof google.cloud.datacatalog.v1.FieldType.EnumType + * @interface IEnumValue + * @property {string|null} [displayName] EnumValue displayName + */ + + /** + * Constructs a new EnumValue. + * @memberof google.cloud.datacatalog.v1.FieldType.EnumType + * @classdesc Represents an EnumValue. + * @implements IEnumValue + * @constructor + * @param {google.cloud.datacatalog.v1.FieldType.EnumType.IEnumValue=} [properties] Properties to set + */ + function EnumValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValue displayName. + * @member {string} displayName + * @memberof google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue + * @instance + */ + EnumValue.prototype.displayName = ""; + + /** + * Creates a new EnumValue instance using the specified properties. + * @function create + * @memberof google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue + * @static + * @param {google.cloud.datacatalog.v1.FieldType.EnumType.IEnumValue=} [properties] Properties to set + * @returns {google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue} EnumValue instance + */ + EnumValue.create = function create(properties) { + return new EnumValue(properties); + }; + + /** + * Encodes the specified EnumValue message. Does not implicitly {@link google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue.verify|verify} messages. + * @function encode + * @memberof google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue + * @static + * @param {google.cloud.datacatalog.v1.FieldType.EnumType.IEnumValue} message EnumValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified EnumValue message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue + * @static + * @param {google.cloud.datacatalog.v1.FieldType.EnumType.IEnumValue} message EnumValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValue message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue} EnumValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.displayName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue} EnumValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValue message. + * @function verify + * @memberof google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates an EnumValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue} EnumValue + */ + EnumValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue) + return object; + var message = new $root.google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue(); + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from an EnumValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue + * @static + * @param {google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue} message EnumValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.displayName = ""; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this EnumValue to JSON. + * @function toJSON + * @memberof google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue + * @instance + * @returns {Object.} JSON object + */ + EnumValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumValue; + })(); + + return EnumType; + })(); + + /** + * PrimitiveType enum. + * @name google.cloud.datacatalog.v1.FieldType.PrimitiveType + * @enum {number} + * @property {number} PRIMITIVE_TYPE_UNSPECIFIED=0 PRIMITIVE_TYPE_UNSPECIFIED value + * @property {number} DOUBLE=1 DOUBLE value + * @property {number} STRING=2 STRING value + * @property {number} BOOL=3 BOOL value + * @property {number} TIMESTAMP=4 TIMESTAMP value + */ + FieldType.PrimitiveType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PRIMITIVE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DOUBLE"] = 1; + values[valuesById[2] = "STRING"] = 2; + values[valuesById[3] = "BOOL"] = 3; + values[valuesById[4] = "TIMESTAMP"] = 4; + return values; + })(); + + return FieldType; + })(); + + v1.PolicyTagManager = (function() { + + /** + * Constructs a new PolicyTagManager service. + * @memberof google.cloud.datacatalog.v1 + * @classdesc Represents a PolicyTagManager + * @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 PolicyTagManager(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (PolicyTagManager.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = PolicyTagManager; + + /** + * Creates new PolicyTagManager service using the specified rpc implementation. + * @function create + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @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 {PolicyTagManager} RPC service. Useful where requests and/or responses are streamed. + */ + PolicyTagManager.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.datacatalog.v1.PolicyTagManager#createTaxonomy}. + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @typedef CreateTaxonomyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datacatalog.v1.Taxonomy} [response] Taxonomy + */ + + /** + * Calls CreateTaxonomy. + * @function createTaxonomy + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @instance + * @param {google.cloud.datacatalog.v1.ICreateTaxonomyRequest} request CreateTaxonomyRequest message or plain object + * @param {google.cloud.datacatalog.v1.PolicyTagManager.CreateTaxonomyCallback} callback Node-style callback called with the error, if any, and Taxonomy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PolicyTagManager.prototype.createTaxonomy = function createTaxonomy(request, callback) { + return this.rpcCall(createTaxonomy, $root.google.cloud.datacatalog.v1.CreateTaxonomyRequest, $root.google.cloud.datacatalog.v1.Taxonomy, request, callback); + }, "name", { value: "CreateTaxonomy" }); + + /** + * Calls CreateTaxonomy. + * @function createTaxonomy + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @instance + * @param {google.cloud.datacatalog.v1.ICreateTaxonomyRequest} request CreateTaxonomyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datacatalog.v1.PolicyTagManager#deleteTaxonomy}. + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @typedef DeleteTaxonomyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteTaxonomy. + * @function deleteTaxonomy + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @instance + * @param {google.cloud.datacatalog.v1.IDeleteTaxonomyRequest} request DeleteTaxonomyRequest message or plain object + * @param {google.cloud.datacatalog.v1.PolicyTagManager.DeleteTaxonomyCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PolicyTagManager.prototype.deleteTaxonomy = function deleteTaxonomy(request, callback) { + return this.rpcCall(deleteTaxonomy, $root.google.cloud.datacatalog.v1.DeleteTaxonomyRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteTaxonomy" }); + + /** + * Calls DeleteTaxonomy. + * @function deleteTaxonomy + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @instance + * @param {google.cloud.datacatalog.v1.IDeleteTaxonomyRequest} request DeleteTaxonomyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datacatalog.v1.PolicyTagManager#updateTaxonomy}. + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @typedef UpdateTaxonomyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datacatalog.v1.Taxonomy} [response] Taxonomy + */ + + /** + * Calls UpdateTaxonomy. + * @function updateTaxonomy + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @instance + * @param {google.cloud.datacatalog.v1.IUpdateTaxonomyRequest} request UpdateTaxonomyRequest message or plain object + * @param {google.cloud.datacatalog.v1.PolicyTagManager.UpdateTaxonomyCallback} callback Node-style callback called with the error, if any, and Taxonomy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PolicyTagManager.prototype.updateTaxonomy = function updateTaxonomy(request, callback) { + return this.rpcCall(updateTaxonomy, $root.google.cloud.datacatalog.v1.UpdateTaxonomyRequest, $root.google.cloud.datacatalog.v1.Taxonomy, request, callback); + }, "name", { value: "UpdateTaxonomy" }); + + /** + * Calls UpdateTaxonomy. + * @function updateTaxonomy + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @instance + * @param {google.cloud.datacatalog.v1.IUpdateTaxonomyRequest} request UpdateTaxonomyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datacatalog.v1.PolicyTagManager#listTaxonomies}. + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @typedef ListTaxonomiesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datacatalog.v1.ListTaxonomiesResponse} [response] ListTaxonomiesResponse + */ + + /** + * Calls ListTaxonomies. + * @function listTaxonomies + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @instance + * @param {google.cloud.datacatalog.v1.IListTaxonomiesRequest} request ListTaxonomiesRequest message or plain object + * @param {google.cloud.datacatalog.v1.PolicyTagManager.ListTaxonomiesCallback} callback Node-style callback called with the error, if any, and ListTaxonomiesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PolicyTagManager.prototype.listTaxonomies = function listTaxonomies(request, callback) { + return this.rpcCall(listTaxonomies, $root.google.cloud.datacatalog.v1.ListTaxonomiesRequest, $root.google.cloud.datacatalog.v1.ListTaxonomiesResponse, request, callback); + }, "name", { value: "ListTaxonomies" }); + + /** + * Calls ListTaxonomies. + * @function listTaxonomies + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @instance + * @param {google.cloud.datacatalog.v1.IListTaxonomiesRequest} request ListTaxonomiesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datacatalog.v1.PolicyTagManager#getTaxonomy}. + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @typedef GetTaxonomyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datacatalog.v1.Taxonomy} [response] Taxonomy + */ + + /** + * Calls GetTaxonomy. + * @function getTaxonomy + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @instance + * @param {google.cloud.datacatalog.v1.IGetTaxonomyRequest} request GetTaxonomyRequest message or plain object + * @param {google.cloud.datacatalog.v1.PolicyTagManager.GetTaxonomyCallback} callback Node-style callback called with the error, if any, and Taxonomy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PolicyTagManager.prototype.getTaxonomy = function getTaxonomy(request, callback) { + return this.rpcCall(getTaxonomy, $root.google.cloud.datacatalog.v1.GetTaxonomyRequest, $root.google.cloud.datacatalog.v1.Taxonomy, request, callback); + }, "name", { value: "GetTaxonomy" }); + + /** + * Calls GetTaxonomy. + * @function getTaxonomy + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @instance + * @param {google.cloud.datacatalog.v1.IGetTaxonomyRequest} request GetTaxonomyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datacatalog.v1.PolicyTagManager#createPolicyTag}. + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @typedef CreatePolicyTagCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datacatalog.v1.PolicyTag} [response] PolicyTag + */ + + /** + * Calls CreatePolicyTag. + * @function createPolicyTag + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @instance + * @param {google.cloud.datacatalog.v1.ICreatePolicyTagRequest} request CreatePolicyTagRequest message or plain object + * @param {google.cloud.datacatalog.v1.PolicyTagManager.CreatePolicyTagCallback} callback Node-style callback called with the error, if any, and PolicyTag + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PolicyTagManager.prototype.createPolicyTag = function createPolicyTag(request, callback) { + return this.rpcCall(createPolicyTag, $root.google.cloud.datacatalog.v1.CreatePolicyTagRequest, $root.google.cloud.datacatalog.v1.PolicyTag, request, callback); + }, "name", { value: "CreatePolicyTag" }); + + /** + * Calls CreatePolicyTag. + * @function createPolicyTag + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @instance + * @param {google.cloud.datacatalog.v1.ICreatePolicyTagRequest} request CreatePolicyTagRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datacatalog.v1.PolicyTagManager#deletePolicyTag}. + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @typedef DeletePolicyTagCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeletePolicyTag. + * @function deletePolicyTag + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @instance + * @param {google.cloud.datacatalog.v1.IDeletePolicyTagRequest} request DeletePolicyTagRequest message or plain object + * @param {google.cloud.datacatalog.v1.PolicyTagManager.DeletePolicyTagCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PolicyTagManager.prototype.deletePolicyTag = function deletePolicyTag(request, callback) { + return this.rpcCall(deletePolicyTag, $root.google.cloud.datacatalog.v1.DeletePolicyTagRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeletePolicyTag" }); + + /** + * Calls DeletePolicyTag. + * @function deletePolicyTag + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @instance + * @param {google.cloud.datacatalog.v1.IDeletePolicyTagRequest} request DeletePolicyTagRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datacatalog.v1.PolicyTagManager#updatePolicyTag}. + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @typedef UpdatePolicyTagCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datacatalog.v1.PolicyTag} [response] PolicyTag + */ + + /** + * Calls UpdatePolicyTag. + * @function updatePolicyTag + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @instance + * @param {google.cloud.datacatalog.v1.IUpdatePolicyTagRequest} request UpdatePolicyTagRequest message or plain object + * @param {google.cloud.datacatalog.v1.PolicyTagManager.UpdatePolicyTagCallback} callback Node-style callback called with the error, if any, and PolicyTag + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PolicyTagManager.prototype.updatePolicyTag = function updatePolicyTag(request, callback) { + return this.rpcCall(updatePolicyTag, $root.google.cloud.datacatalog.v1.UpdatePolicyTagRequest, $root.google.cloud.datacatalog.v1.PolicyTag, request, callback); + }, "name", { value: "UpdatePolicyTag" }); + + /** + * Calls UpdatePolicyTag. + * @function updatePolicyTag + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @instance + * @param {google.cloud.datacatalog.v1.IUpdatePolicyTagRequest} request UpdatePolicyTagRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datacatalog.v1.PolicyTagManager#listPolicyTags}. + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @typedef ListPolicyTagsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datacatalog.v1.ListPolicyTagsResponse} [response] ListPolicyTagsResponse + */ + + /** + * Calls ListPolicyTags. + * @function listPolicyTags + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @instance + * @param {google.cloud.datacatalog.v1.IListPolicyTagsRequest} request ListPolicyTagsRequest message or plain object + * @param {google.cloud.datacatalog.v1.PolicyTagManager.ListPolicyTagsCallback} callback Node-style callback called with the error, if any, and ListPolicyTagsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PolicyTagManager.prototype.listPolicyTags = function listPolicyTags(request, callback) { + return this.rpcCall(listPolicyTags, $root.google.cloud.datacatalog.v1.ListPolicyTagsRequest, $root.google.cloud.datacatalog.v1.ListPolicyTagsResponse, request, callback); + }, "name", { value: "ListPolicyTags" }); + + /** + * Calls ListPolicyTags. + * @function listPolicyTags + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @instance + * @param {google.cloud.datacatalog.v1.IListPolicyTagsRequest} request ListPolicyTagsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datacatalog.v1.PolicyTagManager#getPolicyTag}. + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @typedef GetPolicyTagCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datacatalog.v1.PolicyTag} [response] PolicyTag + */ + + /** + * Calls GetPolicyTag. + * @function getPolicyTag + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @instance + * @param {google.cloud.datacatalog.v1.IGetPolicyTagRequest} request GetPolicyTagRequest message or plain object + * @param {google.cloud.datacatalog.v1.PolicyTagManager.GetPolicyTagCallback} callback Node-style callback called with the error, if any, and PolicyTag + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PolicyTagManager.prototype.getPolicyTag = function getPolicyTag(request, callback) { + return this.rpcCall(getPolicyTag, $root.google.cloud.datacatalog.v1.GetPolicyTagRequest, $root.google.cloud.datacatalog.v1.PolicyTag, request, callback); + }, "name", { value: "GetPolicyTag" }); + + /** + * Calls GetPolicyTag. + * @function getPolicyTag + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @instance + * @param {google.cloud.datacatalog.v1.IGetPolicyTagRequest} request GetPolicyTagRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datacatalog.v1.PolicyTagManager#getIamPolicy}. + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.cloud.datacatalog.v1.PolicyTagManager.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PolicyTagManager.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datacatalog.v1.PolicyTagManager#setIamPolicy}. + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.cloud.datacatalog.v1.PolicyTagManager.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PolicyTagManager.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datacatalog.v1.PolicyTagManager#testIamPermissions}. + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.cloud.datacatalog.v1.PolicyTagManager.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PolicyTagManager.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.datacatalog.v1.PolicyTagManager + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return PolicyTagManager; + })(); + + v1.Taxonomy = (function() { + + /** + * Properties of a Taxonomy. + * @memberof google.cloud.datacatalog.v1 + * @interface ITaxonomy + * @property {string|null} [name] Taxonomy name + * @property {string|null} [displayName] Taxonomy displayName + * @property {string|null} [description] Taxonomy description + * @property {number|null} [policyTagCount] Taxonomy policyTagCount + * @property {google.cloud.datacatalog.v1.ISystemTimestamps|null} [taxonomyTimestamps] Taxonomy taxonomyTimestamps + * @property {Array.|null} [activatedPolicyTypes] Taxonomy activatedPolicyTypes + */ + + /** + * Constructs a new Taxonomy. + * @memberof google.cloud.datacatalog.v1 + * @classdesc Represents a Taxonomy. + * @implements ITaxonomy + * @constructor + * @param {google.cloud.datacatalog.v1.ITaxonomy=} [properties] Properties to set + */ + function Taxonomy(properties) { + this.activatedPolicyTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Taxonomy name. + * @member {string} name + * @memberof google.cloud.datacatalog.v1.Taxonomy + * @instance + */ + Taxonomy.prototype.name = ""; + + /** + * Taxonomy displayName. + * @member {string} displayName + * @memberof google.cloud.datacatalog.v1.Taxonomy + * @instance + */ + Taxonomy.prototype.displayName = ""; + + /** + * Taxonomy description. + * @member {string} description + * @memberof google.cloud.datacatalog.v1.Taxonomy + * @instance + */ + Taxonomy.prototype.description = ""; + + /** + * Taxonomy policyTagCount. + * @member {number} policyTagCount + * @memberof google.cloud.datacatalog.v1.Taxonomy + * @instance + */ + Taxonomy.prototype.policyTagCount = 0; + + /** + * Taxonomy taxonomyTimestamps. + * @member {google.cloud.datacatalog.v1.ISystemTimestamps|null|undefined} taxonomyTimestamps + * @memberof google.cloud.datacatalog.v1.Taxonomy + * @instance + */ + Taxonomy.prototype.taxonomyTimestamps = null; + + /** + * Taxonomy activatedPolicyTypes. + * @member {Array.} activatedPolicyTypes + * @memberof google.cloud.datacatalog.v1.Taxonomy + * @instance + */ + Taxonomy.prototype.activatedPolicyTypes = $util.emptyArray; + + /** + * Creates a new Taxonomy instance using the specified properties. + * @function create + * @memberof google.cloud.datacatalog.v1.Taxonomy + * @static + * @param {google.cloud.datacatalog.v1.ITaxonomy=} [properties] Properties to set + * @returns {google.cloud.datacatalog.v1.Taxonomy} Taxonomy instance + */ + Taxonomy.create = function create(properties) { + return new Taxonomy(properties); + }; + + /** + * Encodes the specified Taxonomy message. Does not implicitly {@link google.cloud.datacatalog.v1.Taxonomy.verify|verify} messages. + * @function encode + * @memberof google.cloud.datacatalog.v1.Taxonomy + * @static + * @param {google.cloud.datacatalog.v1.ITaxonomy} message Taxonomy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Taxonomy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.policyTagCount != null && Object.hasOwnProperty.call(message, "policyTagCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.policyTagCount); + if (message.taxonomyTimestamps != null && Object.hasOwnProperty.call(message, "taxonomyTimestamps")) + $root.google.cloud.datacatalog.v1.SystemTimestamps.encode(message.taxonomyTimestamps, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.activatedPolicyTypes != null && message.activatedPolicyTypes.length) { + writer.uint32(/* id 6, wireType 2 =*/50).fork(); + for (var i = 0; i < message.activatedPolicyTypes.length; ++i) + writer.int32(message.activatedPolicyTypes[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Taxonomy message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.Taxonomy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datacatalog.v1.Taxonomy + * @static + * @param {google.cloud.datacatalog.v1.ITaxonomy} message Taxonomy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Taxonomy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Taxonomy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datacatalog.v1.Taxonomy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datacatalog.v1.Taxonomy} Taxonomy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Taxonomy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datacatalog.v1.Taxonomy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.displayName = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.policyTagCount = reader.int32(); + break; + case 5: + message.taxonomyTimestamps = $root.google.cloud.datacatalog.v1.SystemTimestamps.decode(reader, reader.uint32()); + break; + case 6: + if (!(message.activatedPolicyTypes && message.activatedPolicyTypes.length)) + message.activatedPolicyTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.activatedPolicyTypes.push(reader.int32()); + } else + message.activatedPolicyTypes.push(reader.int32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Taxonomy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datacatalog.v1.Taxonomy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datacatalog.v1.Taxonomy} Taxonomy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Taxonomy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Taxonomy message. + * @function verify + * @memberof google.cloud.datacatalog.v1.Taxonomy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Taxonomy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.policyTagCount != null && message.hasOwnProperty("policyTagCount")) + if (!$util.isInteger(message.policyTagCount)) + return "policyTagCount: integer expected"; + if (message.taxonomyTimestamps != null && message.hasOwnProperty("taxonomyTimestamps")) { + var error = $root.google.cloud.datacatalog.v1.SystemTimestamps.verify(message.taxonomyTimestamps); + if (error) + return "taxonomyTimestamps." + error; + } + if (message.activatedPolicyTypes != null && message.hasOwnProperty("activatedPolicyTypes")) { + if (!Array.isArray(message.activatedPolicyTypes)) + return "activatedPolicyTypes: array expected"; + for (var i = 0; i < message.activatedPolicyTypes.length; ++i) + switch (message.activatedPolicyTypes[i]) { + default: + return "activatedPolicyTypes: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a Taxonomy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datacatalog.v1.Taxonomy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datacatalog.v1.Taxonomy} Taxonomy + */ + Taxonomy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datacatalog.v1.Taxonomy) + return object; + var message = new $root.google.cloud.datacatalog.v1.Taxonomy(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.policyTagCount != null) + message.policyTagCount = object.policyTagCount | 0; + if (object.taxonomyTimestamps != null) { + if (typeof object.taxonomyTimestamps !== "object") + throw TypeError(".google.cloud.datacatalog.v1.Taxonomy.taxonomyTimestamps: object expected"); + message.taxonomyTimestamps = $root.google.cloud.datacatalog.v1.SystemTimestamps.fromObject(object.taxonomyTimestamps); + } + if (object.activatedPolicyTypes) { + if (!Array.isArray(object.activatedPolicyTypes)) + throw TypeError(".google.cloud.datacatalog.v1.Taxonomy.activatedPolicyTypes: array expected"); + message.activatedPolicyTypes = []; + for (var i = 0; i < object.activatedPolicyTypes.length; ++i) + switch (object.activatedPolicyTypes[i]) { + default: + case "POLICY_TYPE_UNSPECIFIED": + case 0: + message.activatedPolicyTypes[i] = 0; + break; + case "FINE_GRAINED_ACCESS_CONTROL": + case 1: + message.activatedPolicyTypes[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a Taxonomy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datacatalog.v1.Taxonomy + * @static + * @param {google.cloud.datacatalog.v1.Taxonomy} message Taxonomy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Taxonomy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.activatedPolicyTypes = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.policyTagCount = 0; + object.taxonomyTimestamps = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.policyTagCount != null && message.hasOwnProperty("policyTagCount")) + object.policyTagCount = message.policyTagCount; + if (message.taxonomyTimestamps != null && message.hasOwnProperty("taxonomyTimestamps")) + object.taxonomyTimestamps = $root.google.cloud.datacatalog.v1.SystemTimestamps.toObject(message.taxonomyTimestamps, options); + if (message.activatedPolicyTypes && message.activatedPolicyTypes.length) { + object.activatedPolicyTypes = []; + for (var j = 0; j < message.activatedPolicyTypes.length; ++j) + object.activatedPolicyTypes[j] = options.enums === String ? $root.google.cloud.datacatalog.v1.Taxonomy.PolicyType[message.activatedPolicyTypes[j]] : message.activatedPolicyTypes[j]; + } + return object; + }; + + /** + * Converts this Taxonomy to JSON. + * @function toJSON + * @memberof google.cloud.datacatalog.v1.Taxonomy + * @instance + * @returns {Object.} JSON object + */ + Taxonomy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * PolicyType enum. + * @name google.cloud.datacatalog.v1.Taxonomy.PolicyType + * @enum {number} + * @property {number} POLICY_TYPE_UNSPECIFIED=0 POLICY_TYPE_UNSPECIFIED value + * @property {number} FINE_GRAINED_ACCESS_CONTROL=1 FINE_GRAINED_ACCESS_CONTROL value + */ + Taxonomy.PolicyType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "POLICY_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "FINE_GRAINED_ACCESS_CONTROL"] = 1; + return values; + })(); + + return Taxonomy; + })(); + + v1.PolicyTag = (function() { + + /** + * Properties of a PolicyTag. + * @memberof google.cloud.datacatalog.v1 + * @interface IPolicyTag + * @property {string|null} [name] PolicyTag name + * @property {string|null} [displayName] PolicyTag displayName + * @property {string|null} [description] PolicyTag description + * @property {string|null} [parentPolicyTag] PolicyTag parentPolicyTag + * @property {Array.|null} [childPolicyTags] PolicyTag childPolicyTags + */ + + /** + * Constructs a new PolicyTag. + * @memberof google.cloud.datacatalog.v1 + * @classdesc Represents a PolicyTag. + * @implements IPolicyTag + * @constructor + * @param {google.cloud.datacatalog.v1.IPolicyTag=} [properties] Properties to set + */ + function PolicyTag(properties) { + this.childPolicyTags = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PolicyTag name. + * @member {string} name + * @memberof google.cloud.datacatalog.v1.PolicyTag + * @instance + */ + PolicyTag.prototype.name = ""; + + /** + * PolicyTag displayName. + * @member {string} displayName + * @memberof google.cloud.datacatalog.v1.PolicyTag + * @instance + */ + PolicyTag.prototype.displayName = ""; + + /** + * PolicyTag description. + * @member {string} description + * @memberof google.cloud.datacatalog.v1.PolicyTag + * @instance + */ + PolicyTag.prototype.description = ""; + + /** + * PolicyTag parentPolicyTag. + * @member {string} parentPolicyTag + * @memberof google.cloud.datacatalog.v1.PolicyTag + * @instance + */ + PolicyTag.prototype.parentPolicyTag = ""; + + /** + * PolicyTag childPolicyTags. + * @member {Array.} childPolicyTags + * @memberof google.cloud.datacatalog.v1.PolicyTag + * @instance + */ + PolicyTag.prototype.childPolicyTags = $util.emptyArray; + + /** + * Creates a new PolicyTag instance using the specified properties. + * @function create + * @memberof google.cloud.datacatalog.v1.PolicyTag + * @static + * @param {google.cloud.datacatalog.v1.IPolicyTag=} [properties] Properties to set + * @returns {google.cloud.datacatalog.v1.PolicyTag} PolicyTag instance + */ + PolicyTag.create = function create(properties) { + return new PolicyTag(properties); + }; + + /** + * Encodes the specified PolicyTag message. Does not implicitly {@link google.cloud.datacatalog.v1.PolicyTag.verify|verify} messages. + * @function encode + * @memberof google.cloud.datacatalog.v1.PolicyTag + * @static + * @param {google.cloud.datacatalog.v1.IPolicyTag} message PolicyTag message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyTag.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.parentPolicyTag != null && Object.hasOwnProperty.call(message, "parentPolicyTag")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.parentPolicyTag); + if (message.childPolicyTags != null && message.childPolicyTags.length) + for (var i = 0; i < message.childPolicyTags.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.childPolicyTags[i]); + return writer; + }; + + /** + * Encodes the specified PolicyTag message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.PolicyTag.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datacatalog.v1.PolicyTag + * @static + * @param {google.cloud.datacatalog.v1.IPolicyTag} message PolicyTag message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyTag.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PolicyTag message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datacatalog.v1.PolicyTag + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datacatalog.v1.PolicyTag} PolicyTag + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyTag.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datacatalog.v1.PolicyTag(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.displayName = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.parentPolicyTag = reader.string(); + break; + case 5: + if (!(message.childPolicyTags && message.childPolicyTags.length)) + message.childPolicyTags = []; + message.childPolicyTags.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PolicyTag message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datacatalog.v1.PolicyTag + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datacatalog.v1.PolicyTag} PolicyTag + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyTag.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PolicyTag message. + * @function verify + * @memberof google.cloud.datacatalog.v1.PolicyTag + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolicyTag.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.parentPolicyTag != null && message.hasOwnProperty("parentPolicyTag")) + if (!$util.isString(message.parentPolicyTag)) + return "parentPolicyTag: string expected"; + if (message.childPolicyTags != null && message.hasOwnProperty("childPolicyTags")) { + if (!Array.isArray(message.childPolicyTags)) + return "childPolicyTags: array expected"; + for (var i = 0; i < message.childPolicyTags.length; ++i) + if (!$util.isString(message.childPolicyTags[i])) + return "childPolicyTags: string[] expected"; + } + return null; + }; + + /** + * Creates a PolicyTag message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datacatalog.v1.PolicyTag + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datacatalog.v1.PolicyTag} PolicyTag + */ + PolicyTag.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datacatalog.v1.PolicyTag) + return object; + var message = new $root.google.cloud.datacatalog.v1.PolicyTag(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.parentPolicyTag != null) + message.parentPolicyTag = String(object.parentPolicyTag); + if (object.childPolicyTags) { + if (!Array.isArray(object.childPolicyTags)) + throw TypeError(".google.cloud.datacatalog.v1.PolicyTag.childPolicyTags: array expected"); + message.childPolicyTags = []; + for (var i = 0; i < object.childPolicyTags.length; ++i) + message.childPolicyTags[i] = String(object.childPolicyTags[i]); + } + return message; + }; + + /** + * Creates a plain object from a PolicyTag message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datacatalog.v1.PolicyTag + * @static + * @param {google.cloud.datacatalog.v1.PolicyTag} message PolicyTag + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PolicyTag.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.childPolicyTags = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.parentPolicyTag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.parentPolicyTag != null && message.hasOwnProperty("parentPolicyTag")) + object.parentPolicyTag = message.parentPolicyTag; + if (message.childPolicyTags && message.childPolicyTags.length) { + object.childPolicyTags = []; + for (var j = 0; j < message.childPolicyTags.length; ++j) + object.childPolicyTags[j] = message.childPolicyTags[j]; + } + return object; + }; + + /** + * Converts this PolicyTag to JSON. + * @function toJSON + * @memberof google.cloud.datacatalog.v1.PolicyTag + * @instance + * @returns {Object.} JSON object + */ + PolicyTag.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PolicyTag; + })(); + + v1.CreateTaxonomyRequest = (function() { + + /** + * Properties of a CreateTaxonomyRequest. + * @memberof google.cloud.datacatalog.v1 + * @interface ICreateTaxonomyRequest + * @property {string|null} [parent] CreateTaxonomyRequest parent + * @property {google.cloud.datacatalog.v1.ITaxonomy|null} [taxonomy] CreateTaxonomyRequest taxonomy + */ + + /** + * Constructs a new CreateTaxonomyRequest. + * @memberof google.cloud.datacatalog.v1 + * @classdesc Represents a CreateTaxonomyRequest. + * @implements ICreateTaxonomyRequest + * @constructor + * @param {google.cloud.datacatalog.v1.ICreateTaxonomyRequest=} [properties] Properties to set + */ + function CreateTaxonomyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateTaxonomyRequest parent. + * @member {string} parent + * @memberof google.cloud.datacatalog.v1.CreateTaxonomyRequest + * @instance + */ + CreateTaxonomyRequest.prototype.parent = ""; + + /** + * CreateTaxonomyRequest taxonomy. + * @member {google.cloud.datacatalog.v1.ITaxonomy|null|undefined} taxonomy + * @memberof google.cloud.datacatalog.v1.CreateTaxonomyRequest + * @instance + */ + CreateTaxonomyRequest.prototype.taxonomy = null; + + /** + * Creates a new CreateTaxonomyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datacatalog.v1.CreateTaxonomyRequest + * @static + * @param {google.cloud.datacatalog.v1.ICreateTaxonomyRequest=} [properties] Properties to set + * @returns {google.cloud.datacatalog.v1.CreateTaxonomyRequest} CreateTaxonomyRequest instance + */ + CreateTaxonomyRequest.create = function create(properties) { + return new CreateTaxonomyRequest(properties); + }; + + /** + * Encodes the specified CreateTaxonomyRequest message. Does not implicitly {@link google.cloud.datacatalog.v1.CreateTaxonomyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datacatalog.v1.CreateTaxonomyRequest + * @static + * @param {google.cloud.datacatalog.v1.ICreateTaxonomyRequest} message CreateTaxonomyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTaxonomyRequest.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.taxonomy != null && Object.hasOwnProperty.call(message, "taxonomy")) + $root.google.cloud.datacatalog.v1.Taxonomy.encode(message.taxonomy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateTaxonomyRequest message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.CreateTaxonomyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datacatalog.v1.CreateTaxonomyRequest + * @static + * @param {google.cloud.datacatalog.v1.ICreateTaxonomyRequest} message CreateTaxonomyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTaxonomyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTaxonomyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datacatalog.v1.CreateTaxonomyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datacatalog.v1.CreateTaxonomyRequest} CreateTaxonomyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTaxonomyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datacatalog.v1.CreateTaxonomyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.taxonomy = $root.google.cloud.datacatalog.v1.Taxonomy.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateTaxonomyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datacatalog.v1.CreateTaxonomyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datacatalog.v1.CreateTaxonomyRequest} CreateTaxonomyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTaxonomyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateTaxonomyRequest message. + * @function verify + * @memberof google.cloud.datacatalog.v1.CreateTaxonomyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTaxonomyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.taxonomy != null && message.hasOwnProperty("taxonomy")) { + var error = $root.google.cloud.datacatalog.v1.Taxonomy.verify(message.taxonomy); + if (error) + return "taxonomy." + error; + } + return null; + }; + + /** + * Creates a CreateTaxonomyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datacatalog.v1.CreateTaxonomyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datacatalog.v1.CreateTaxonomyRequest} CreateTaxonomyRequest + */ + CreateTaxonomyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datacatalog.v1.CreateTaxonomyRequest) + return object; + var message = new $root.google.cloud.datacatalog.v1.CreateTaxonomyRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.taxonomy != null) { + if (typeof object.taxonomy !== "object") + throw TypeError(".google.cloud.datacatalog.v1.CreateTaxonomyRequest.taxonomy: object expected"); + message.taxonomy = $root.google.cloud.datacatalog.v1.Taxonomy.fromObject(object.taxonomy); + } + return message; + }; + + /** + * Creates a plain object from a CreateTaxonomyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datacatalog.v1.CreateTaxonomyRequest + * @static + * @param {google.cloud.datacatalog.v1.CreateTaxonomyRequest} message CreateTaxonomyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTaxonomyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.taxonomy = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.taxonomy != null && message.hasOwnProperty("taxonomy")) + object.taxonomy = $root.google.cloud.datacatalog.v1.Taxonomy.toObject(message.taxonomy, options); + return object; + }; + + /** + * Converts this CreateTaxonomyRequest to JSON. + * @function toJSON + * @memberof google.cloud.datacatalog.v1.CreateTaxonomyRequest + * @instance + * @returns {Object.} JSON object + */ + CreateTaxonomyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateTaxonomyRequest; + })(); + + v1.DeleteTaxonomyRequest = (function() { + + /** + * Properties of a DeleteTaxonomyRequest. + * @memberof google.cloud.datacatalog.v1 + * @interface IDeleteTaxonomyRequest + * @property {string|null} [name] DeleteTaxonomyRequest name + */ + + /** + * Constructs a new DeleteTaxonomyRequest. + * @memberof google.cloud.datacatalog.v1 + * @classdesc Represents a DeleteTaxonomyRequest. + * @implements IDeleteTaxonomyRequest + * @constructor + * @param {google.cloud.datacatalog.v1.IDeleteTaxonomyRequest=} [properties] Properties to set + */ + function DeleteTaxonomyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteTaxonomyRequest name. + * @member {string} name + * @memberof google.cloud.datacatalog.v1.DeleteTaxonomyRequest + * @instance + */ + DeleteTaxonomyRequest.prototype.name = ""; + + /** + * Creates a new DeleteTaxonomyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datacatalog.v1.DeleteTaxonomyRequest + * @static + * @param {google.cloud.datacatalog.v1.IDeleteTaxonomyRequest=} [properties] Properties to set + * @returns {google.cloud.datacatalog.v1.DeleteTaxonomyRequest} DeleteTaxonomyRequest instance + */ + DeleteTaxonomyRequest.create = function create(properties) { + return new DeleteTaxonomyRequest(properties); + }; + + /** + * Encodes the specified DeleteTaxonomyRequest message. Does not implicitly {@link google.cloud.datacatalog.v1.DeleteTaxonomyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datacatalog.v1.DeleteTaxonomyRequest + * @static + * @param {google.cloud.datacatalog.v1.IDeleteTaxonomyRequest} message DeleteTaxonomyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTaxonomyRequest.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 DeleteTaxonomyRequest message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.DeleteTaxonomyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datacatalog.v1.DeleteTaxonomyRequest + * @static + * @param {google.cloud.datacatalog.v1.IDeleteTaxonomyRequest} message DeleteTaxonomyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTaxonomyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteTaxonomyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datacatalog.v1.DeleteTaxonomyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datacatalog.v1.DeleteTaxonomyRequest} DeleteTaxonomyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTaxonomyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datacatalog.v1.DeleteTaxonomyRequest(); + 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 DeleteTaxonomyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datacatalog.v1.DeleteTaxonomyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datacatalog.v1.DeleteTaxonomyRequest} DeleteTaxonomyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTaxonomyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTaxonomyRequest message. + * @function verify + * @memberof google.cloud.datacatalog.v1.DeleteTaxonomyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTaxonomyRequest.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 DeleteTaxonomyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datacatalog.v1.DeleteTaxonomyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datacatalog.v1.DeleteTaxonomyRequest} DeleteTaxonomyRequest + */ + DeleteTaxonomyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datacatalog.v1.DeleteTaxonomyRequest) + return object; + var message = new $root.google.cloud.datacatalog.v1.DeleteTaxonomyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteTaxonomyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datacatalog.v1.DeleteTaxonomyRequest + * @static + * @param {google.cloud.datacatalog.v1.DeleteTaxonomyRequest} message DeleteTaxonomyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTaxonomyRequest.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 DeleteTaxonomyRequest to JSON. + * @function toJSON + * @memberof google.cloud.datacatalog.v1.DeleteTaxonomyRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteTaxonomyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteTaxonomyRequest; + })(); + + v1.UpdateTaxonomyRequest = (function() { + + /** + * Properties of an UpdateTaxonomyRequest. + * @memberof google.cloud.datacatalog.v1 + * @interface IUpdateTaxonomyRequest + * @property {google.cloud.datacatalog.v1.ITaxonomy|null} [taxonomy] UpdateTaxonomyRequest taxonomy + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTaxonomyRequest updateMask + */ + + /** + * Constructs a new UpdateTaxonomyRequest. + * @memberof google.cloud.datacatalog.v1 + * @classdesc Represents an UpdateTaxonomyRequest. + * @implements IUpdateTaxonomyRequest + * @constructor + * @param {google.cloud.datacatalog.v1.IUpdateTaxonomyRequest=} [properties] Properties to set + */ + function UpdateTaxonomyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateTaxonomyRequest taxonomy. + * @member {google.cloud.datacatalog.v1.ITaxonomy|null|undefined} taxonomy + * @memberof google.cloud.datacatalog.v1.UpdateTaxonomyRequest + * @instance + */ + UpdateTaxonomyRequest.prototype.taxonomy = null; + + /** + * UpdateTaxonomyRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.datacatalog.v1.UpdateTaxonomyRequest + * @instance + */ + UpdateTaxonomyRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateTaxonomyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datacatalog.v1.UpdateTaxonomyRequest + * @static + * @param {google.cloud.datacatalog.v1.IUpdateTaxonomyRequest=} [properties] Properties to set + * @returns {google.cloud.datacatalog.v1.UpdateTaxonomyRequest} UpdateTaxonomyRequest instance + */ + UpdateTaxonomyRequest.create = function create(properties) { + return new UpdateTaxonomyRequest(properties); + }; + + /** + * Encodes the specified UpdateTaxonomyRequest message. Does not implicitly {@link google.cloud.datacatalog.v1.UpdateTaxonomyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datacatalog.v1.UpdateTaxonomyRequest + * @static + * @param {google.cloud.datacatalog.v1.IUpdateTaxonomyRequest} message UpdateTaxonomyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTaxonomyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.taxonomy != null && Object.hasOwnProperty.call(message, "taxonomy")) + $root.google.cloud.datacatalog.v1.Taxonomy.encode(message.taxonomy, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateTaxonomyRequest message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.UpdateTaxonomyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datacatalog.v1.UpdateTaxonomyRequest + * @static + * @param {google.cloud.datacatalog.v1.IUpdateTaxonomyRequest} message UpdateTaxonomyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTaxonomyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateTaxonomyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datacatalog.v1.UpdateTaxonomyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datacatalog.v1.UpdateTaxonomyRequest} UpdateTaxonomyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTaxonomyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datacatalog.v1.UpdateTaxonomyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.taxonomy = $root.google.cloud.datacatalog.v1.Taxonomy.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateTaxonomyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datacatalog.v1.UpdateTaxonomyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datacatalog.v1.UpdateTaxonomyRequest} UpdateTaxonomyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTaxonomyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateTaxonomyRequest message. + * @function verify + * @memberof google.cloud.datacatalog.v1.UpdateTaxonomyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateTaxonomyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.taxonomy != null && message.hasOwnProperty("taxonomy")) { + var error = $root.google.cloud.datacatalog.v1.Taxonomy.verify(message.taxonomy); + if (error) + return "taxonomy." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateTaxonomyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datacatalog.v1.UpdateTaxonomyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datacatalog.v1.UpdateTaxonomyRequest} UpdateTaxonomyRequest + */ + UpdateTaxonomyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datacatalog.v1.UpdateTaxonomyRequest) + return object; + var message = new $root.google.cloud.datacatalog.v1.UpdateTaxonomyRequest(); + if (object.taxonomy != null) { + if (typeof object.taxonomy !== "object") + throw TypeError(".google.cloud.datacatalog.v1.UpdateTaxonomyRequest.taxonomy: object expected"); + message.taxonomy = $root.google.cloud.datacatalog.v1.Taxonomy.fromObject(object.taxonomy); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.datacatalog.v1.UpdateTaxonomyRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateTaxonomyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datacatalog.v1.UpdateTaxonomyRequest + * @static + * @param {google.cloud.datacatalog.v1.UpdateTaxonomyRequest} message UpdateTaxonomyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateTaxonomyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.taxonomy = null; + object.updateMask = null; + } + if (message.taxonomy != null && message.hasOwnProperty("taxonomy")) + object.taxonomy = $root.google.cloud.datacatalog.v1.Taxonomy.toObject(message.taxonomy, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateTaxonomyRequest to JSON. + * @function toJSON + * @memberof google.cloud.datacatalog.v1.UpdateTaxonomyRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateTaxonomyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateTaxonomyRequest; + })(); + + v1.ListTaxonomiesRequest = (function() { + + /** + * Properties of a ListTaxonomiesRequest. + * @memberof google.cloud.datacatalog.v1 + * @interface IListTaxonomiesRequest + * @property {string|null} [parent] ListTaxonomiesRequest parent + * @property {number|null} [pageSize] ListTaxonomiesRequest pageSize + * @property {string|null} [pageToken] ListTaxonomiesRequest pageToken + */ + + /** + * Constructs a new ListTaxonomiesRequest. + * @memberof google.cloud.datacatalog.v1 + * @classdesc Represents a ListTaxonomiesRequest. + * @implements IListTaxonomiesRequest + * @constructor + * @param {google.cloud.datacatalog.v1.IListTaxonomiesRequest=} [properties] Properties to set + */ + function ListTaxonomiesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTaxonomiesRequest parent. + * @member {string} parent + * @memberof google.cloud.datacatalog.v1.ListTaxonomiesRequest + * @instance + */ + ListTaxonomiesRequest.prototype.parent = ""; + + /** + * ListTaxonomiesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.datacatalog.v1.ListTaxonomiesRequest + * @instance + */ + ListTaxonomiesRequest.prototype.pageSize = 0; + + /** + * ListTaxonomiesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.datacatalog.v1.ListTaxonomiesRequest + * @instance + */ + ListTaxonomiesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListTaxonomiesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datacatalog.v1.ListTaxonomiesRequest + * @static + * @param {google.cloud.datacatalog.v1.IListTaxonomiesRequest=} [properties] Properties to set + * @returns {google.cloud.datacatalog.v1.ListTaxonomiesRequest} ListTaxonomiesRequest instance + */ + ListTaxonomiesRequest.create = function create(properties) { + return new ListTaxonomiesRequest(properties); + }; + + /** + * Encodes the specified ListTaxonomiesRequest message. Does not implicitly {@link google.cloud.datacatalog.v1.ListTaxonomiesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datacatalog.v1.ListTaxonomiesRequest + * @static + * @param {google.cloud.datacatalog.v1.IListTaxonomiesRequest} message ListTaxonomiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTaxonomiesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListTaxonomiesRequest message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.ListTaxonomiesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datacatalog.v1.ListTaxonomiesRequest + * @static + * @param {google.cloud.datacatalog.v1.IListTaxonomiesRequest} message ListTaxonomiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTaxonomiesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTaxonomiesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datacatalog.v1.ListTaxonomiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datacatalog.v1.ListTaxonomiesRequest} ListTaxonomiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTaxonomiesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datacatalog.v1.ListTaxonomiesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTaxonomiesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datacatalog.v1.ListTaxonomiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datacatalog.v1.ListTaxonomiesRequest} ListTaxonomiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTaxonomiesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTaxonomiesRequest message. + * @function verify + * @memberof google.cloud.datacatalog.v1.ListTaxonomiesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTaxonomiesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListTaxonomiesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datacatalog.v1.ListTaxonomiesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datacatalog.v1.ListTaxonomiesRequest} ListTaxonomiesRequest + */ + ListTaxonomiesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datacatalog.v1.ListTaxonomiesRequest) + return object; + var message = new $root.google.cloud.datacatalog.v1.ListTaxonomiesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListTaxonomiesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datacatalog.v1.ListTaxonomiesRequest + * @static + * @param {google.cloud.datacatalog.v1.ListTaxonomiesRequest} message ListTaxonomiesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTaxonomiesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListTaxonomiesRequest to JSON. + * @function toJSON + * @memberof google.cloud.datacatalog.v1.ListTaxonomiesRequest + * @instance + * @returns {Object.} JSON object + */ + ListTaxonomiesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListTaxonomiesRequest; + })(); + + v1.ListTaxonomiesResponse = (function() { + + /** + * Properties of a ListTaxonomiesResponse. + * @memberof google.cloud.datacatalog.v1 + * @interface IListTaxonomiesResponse + * @property {Array.|null} [taxonomies] ListTaxonomiesResponse taxonomies + * @property {string|null} [nextPageToken] ListTaxonomiesResponse nextPageToken + */ + + /** + * Constructs a new ListTaxonomiesResponse. + * @memberof google.cloud.datacatalog.v1 + * @classdesc Represents a ListTaxonomiesResponse. + * @implements IListTaxonomiesResponse + * @constructor + * @param {google.cloud.datacatalog.v1.IListTaxonomiesResponse=} [properties] Properties to set + */ + function ListTaxonomiesResponse(properties) { + this.taxonomies = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTaxonomiesResponse taxonomies. + * @member {Array.} taxonomies + * @memberof google.cloud.datacatalog.v1.ListTaxonomiesResponse + * @instance + */ + ListTaxonomiesResponse.prototype.taxonomies = $util.emptyArray; + + /** + * ListTaxonomiesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.datacatalog.v1.ListTaxonomiesResponse + * @instance + */ + ListTaxonomiesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListTaxonomiesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.datacatalog.v1.ListTaxonomiesResponse + * @static + * @param {google.cloud.datacatalog.v1.IListTaxonomiesResponse=} [properties] Properties to set + * @returns {google.cloud.datacatalog.v1.ListTaxonomiesResponse} ListTaxonomiesResponse instance + */ + ListTaxonomiesResponse.create = function create(properties) { + return new ListTaxonomiesResponse(properties); + }; + + /** + * Encodes the specified ListTaxonomiesResponse message. Does not implicitly {@link google.cloud.datacatalog.v1.ListTaxonomiesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.datacatalog.v1.ListTaxonomiesResponse + * @static + * @param {google.cloud.datacatalog.v1.IListTaxonomiesResponse} message ListTaxonomiesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTaxonomiesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.taxonomies != null && message.taxonomies.length) + for (var i = 0; i < message.taxonomies.length; ++i) + $root.google.cloud.datacatalog.v1.Taxonomy.encode(message.taxonomies[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListTaxonomiesResponse message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.ListTaxonomiesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datacatalog.v1.ListTaxonomiesResponse + * @static + * @param {google.cloud.datacatalog.v1.IListTaxonomiesResponse} message ListTaxonomiesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTaxonomiesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTaxonomiesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datacatalog.v1.ListTaxonomiesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datacatalog.v1.ListTaxonomiesResponse} ListTaxonomiesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTaxonomiesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datacatalog.v1.ListTaxonomiesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.taxonomies && message.taxonomies.length)) + message.taxonomies = []; + message.taxonomies.push($root.google.cloud.datacatalog.v1.Taxonomy.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTaxonomiesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datacatalog.v1.ListTaxonomiesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datacatalog.v1.ListTaxonomiesResponse} ListTaxonomiesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTaxonomiesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTaxonomiesResponse message. + * @function verify + * @memberof google.cloud.datacatalog.v1.ListTaxonomiesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTaxonomiesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.taxonomies != null && message.hasOwnProperty("taxonomies")) { + if (!Array.isArray(message.taxonomies)) + return "taxonomies: array expected"; + for (var i = 0; i < message.taxonomies.length; ++i) { + var error = $root.google.cloud.datacatalog.v1.Taxonomy.verify(message.taxonomies[i]); + if (error) + return "taxonomies." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListTaxonomiesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datacatalog.v1.ListTaxonomiesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datacatalog.v1.ListTaxonomiesResponse} ListTaxonomiesResponse + */ + ListTaxonomiesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datacatalog.v1.ListTaxonomiesResponse) + return object; + var message = new $root.google.cloud.datacatalog.v1.ListTaxonomiesResponse(); + if (object.taxonomies) { + if (!Array.isArray(object.taxonomies)) + throw TypeError(".google.cloud.datacatalog.v1.ListTaxonomiesResponse.taxonomies: array expected"); + message.taxonomies = []; + for (var i = 0; i < object.taxonomies.length; ++i) { + if (typeof object.taxonomies[i] !== "object") + throw TypeError(".google.cloud.datacatalog.v1.ListTaxonomiesResponse.taxonomies: object expected"); + message.taxonomies[i] = $root.google.cloud.datacatalog.v1.Taxonomy.fromObject(object.taxonomies[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListTaxonomiesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datacatalog.v1.ListTaxonomiesResponse + * @static + * @param {google.cloud.datacatalog.v1.ListTaxonomiesResponse} message ListTaxonomiesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTaxonomiesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.taxonomies = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.taxonomies && message.taxonomies.length) { + object.taxonomies = []; + for (var j = 0; j < message.taxonomies.length; ++j) + object.taxonomies[j] = $root.google.cloud.datacatalog.v1.Taxonomy.toObject(message.taxonomies[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListTaxonomiesResponse to JSON. + * @function toJSON + * @memberof google.cloud.datacatalog.v1.ListTaxonomiesResponse + * @instance + * @returns {Object.} JSON object + */ + ListTaxonomiesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListTaxonomiesResponse; + })(); + + v1.GetTaxonomyRequest = (function() { + + /** + * Properties of a GetTaxonomyRequest. + * @memberof google.cloud.datacatalog.v1 + * @interface IGetTaxonomyRequest + * @property {string|null} [name] GetTaxonomyRequest name + */ + + /** + * Constructs a new GetTaxonomyRequest. + * @memberof google.cloud.datacatalog.v1 + * @classdesc Represents a GetTaxonomyRequest. + * @implements IGetTaxonomyRequest + * @constructor + * @param {google.cloud.datacatalog.v1.IGetTaxonomyRequest=} [properties] Properties to set + */ + function GetTaxonomyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTaxonomyRequest name. + * @member {string} name + * @memberof google.cloud.datacatalog.v1.GetTaxonomyRequest + * @instance + */ + GetTaxonomyRequest.prototype.name = ""; + + /** + * Creates a new GetTaxonomyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datacatalog.v1.GetTaxonomyRequest + * @static + * @param {google.cloud.datacatalog.v1.IGetTaxonomyRequest=} [properties] Properties to set + * @returns {google.cloud.datacatalog.v1.GetTaxonomyRequest} GetTaxonomyRequest instance + */ + GetTaxonomyRequest.create = function create(properties) { + return new GetTaxonomyRequest(properties); + }; + + /** + * Encodes the specified GetTaxonomyRequest message. Does not implicitly {@link google.cloud.datacatalog.v1.GetTaxonomyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datacatalog.v1.GetTaxonomyRequest + * @static + * @param {google.cloud.datacatalog.v1.IGetTaxonomyRequest} message GetTaxonomyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTaxonomyRequest.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 GetTaxonomyRequest message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.GetTaxonomyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datacatalog.v1.GetTaxonomyRequest + * @static + * @param {google.cloud.datacatalog.v1.IGetTaxonomyRequest} message GetTaxonomyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTaxonomyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTaxonomyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datacatalog.v1.GetTaxonomyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datacatalog.v1.GetTaxonomyRequest} GetTaxonomyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTaxonomyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datacatalog.v1.GetTaxonomyRequest(); + 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 GetTaxonomyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datacatalog.v1.GetTaxonomyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datacatalog.v1.GetTaxonomyRequest} GetTaxonomyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTaxonomyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTaxonomyRequest message. + * @function verify + * @memberof google.cloud.datacatalog.v1.GetTaxonomyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTaxonomyRequest.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 GetTaxonomyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datacatalog.v1.GetTaxonomyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datacatalog.v1.GetTaxonomyRequest} GetTaxonomyRequest + */ + GetTaxonomyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datacatalog.v1.GetTaxonomyRequest) + return object; + var message = new $root.google.cloud.datacatalog.v1.GetTaxonomyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetTaxonomyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datacatalog.v1.GetTaxonomyRequest + * @static + * @param {google.cloud.datacatalog.v1.GetTaxonomyRequest} message GetTaxonomyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTaxonomyRequest.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 GetTaxonomyRequest to JSON. + * @function toJSON + * @memberof google.cloud.datacatalog.v1.GetTaxonomyRequest + * @instance + * @returns {Object.} JSON object + */ + GetTaxonomyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetTaxonomyRequest; + })(); + + v1.CreatePolicyTagRequest = (function() { + + /** + * Properties of a CreatePolicyTagRequest. + * @memberof google.cloud.datacatalog.v1 + * @interface ICreatePolicyTagRequest + * @property {string|null} [parent] CreatePolicyTagRequest parent + * @property {google.cloud.datacatalog.v1.IPolicyTag|null} [policyTag] CreatePolicyTagRequest policyTag + */ + + /** + * Constructs a new CreatePolicyTagRequest. + * @memberof google.cloud.datacatalog.v1 + * @classdesc Represents a CreatePolicyTagRequest. + * @implements ICreatePolicyTagRequest + * @constructor + * @param {google.cloud.datacatalog.v1.ICreatePolicyTagRequest=} [properties] Properties to set + */ + function CreatePolicyTagRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreatePolicyTagRequest parent. + * @member {string} parent + * @memberof google.cloud.datacatalog.v1.CreatePolicyTagRequest + * @instance + */ + CreatePolicyTagRequest.prototype.parent = ""; + + /** + * CreatePolicyTagRequest policyTag. + * @member {google.cloud.datacatalog.v1.IPolicyTag|null|undefined} policyTag + * @memberof google.cloud.datacatalog.v1.CreatePolicyTagRequest + * @instance + */ + CreatePolicyTagRequest.prototype.policyTag = null; + + /** + * Creates a new CreatePolicyTagRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datacatalog.v1.CreatePolicyTagRequest + * @static + * @param {google.cloud.datacatalog.v1.ICreatePolicyTagRequest=} [properties] Properties to set + * @returns {google.cloud.datacatalog.v1.CreatePolicyTagRequest} CreatePolicyTagRequest instance + */ + CreatePolicyTagRequest.create = function create(properties) { + return new CreatePolicyTagRequest(properties); + }; + + /** + * Encodes the specified CreatePolicyTagRequest message. Does not implicitly {@link google.cloud.datacatalog.v1.CreatePolicyTagRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datacatalog.v1.CreatePolicyTagRequest + * @static + * @param {google.cloud.datacatalog.v1.ICreatePolicyTagRequest} message CreatePolicyTagRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePolicyTagRequest.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.policyTag != null && Object.hasOwnProperty.call(message, "policyTag")) + $root.google.cloud.datacatalog.v1.PolicyTag.encode(message.policyTag, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreatePolicyTagRequest message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.CreatePolicyTagRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datacatalog.v1.CreatePolicyTagRequest + * @static + * @param {google.cloud.datacatalog.v1.ICreatePolicyTagRequest} message CreatePolicyTagRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePolicyTagRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreatePolicyTagRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datacatalog.v1.CreatePolicyTagRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datacatalog.v1.CreatePolicyTagRequest} CreatePolicyTagRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePolicyTagRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datacatalog.v1.CreatePolicyTagRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.policyTag = $root.google.cloud.datacatalog.v1.PolicyTag.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreatePolicyTagRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datacatalog.v1.CreatePolicyTagRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datacatalog.v1.CreatePolicyTagRequest} CreatePolicyTagRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePolicyTagRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreatePolicyTagRequest message. + * @function verify + * @memberof google.cloud.datacatalog.v1.CreatePolicyTagRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreatePolicyTagRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.policyTag != null && message.hasOwnProperty("policyTag")) { + var error = $root.google.cloud.datacatalog.v1.PolicyTag.verify(message.policyTag); + if (error) + return "policyTag." + error; + } + return null; + }; + + /** + * Creates a CreatePolicyTagRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datacatalog.v1.CreatePolicyTagRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datacatalog.v1.CreatePolicyTagRequest} CreatePolicyTagRequest + */ + CreatePolicyTagRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datacatalog.v1.CreatePolicyTagRequest) + return object; + var message = new $root.google.cloud.datacatalog.v1.CreatePolicyTagRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.policyTag != null) { + if (typeof object.policyTag !== "object") + throw TypeError(".google.cloud.datacatalog.v1.CreatePolicyTagRequest.policyTag: object expected"); + message.policyTag = $root.google.cloud.datacatalog.v1.PolicyTag.fromObject(object.policyTag); + } + return message; + }; + + /** + * Creates a plain object from a CreatePolicyTagRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datacatalog.v1.CreatePolicyTagRequest + * @static + * @param {google.cloud.datacatalog.v1.CreatePolicyTagRequest} message CreatePolicyTagRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreatePolicyTagRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.policyTag = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.policyTag != null && message.hasOwnProperty("policyTag")) + object.policyTag = $root.google.cloud.datacatalog.v1.PolicyTag.toObject(message.policyTag, options); + return object; + }; + + /** + * Converts this CreatePolicyTagRequest to JSON. + * @function toJSON + * @memberof google.cloud.datacatalog.v1.CreatePolicyTagRequest + * @instance + * @returns {Object.} JSON object + */ + CreatePolicyTagRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreatePolicyTagRequest; + })(); + + v1.DeletePolicyTagRequest = (function() { + + /** + * Properties of a DeletePolicyTagRequest. + * @memberof google.cloud.datacatalog.v1 + * @interface IDeletePolicyTagRequest + * @property {string|null} [name] DeletePolicyTagRequest name + */ + + /** + * Constructs a new DeletePolicyTagRequest. + * @memberof google.cloud.datacatalog.v1 + * @classdesc Represents a DeletePolicyTagRequest. + * @implements IDeletePolicyTagRequest + * @constructor + * @param {google.cloud.datacatalog.v1.IDeletePolicyTagRequest=} [properties] Properties to set + */ + function DeletePolicyTagRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeletePolicyTagRequest name. + * @member {string} name + * @memberof google.cloud.datacatalog.v1.DeletePolicyTagRequest + * @instance + */ + DeletePolicyTagRequest.prototype.name = ""; + + /** + * Creates a new DeletePolicyTagRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datacatalog.v1.DeletePolicyTagRequest + * @static + * @param {google.cloud.datacatalog.v1.IDeletePolicyTagRequest=} [properties] Properties to set + * @returns {google.cloud.datacatalog.v1.DeletePolicyTagRequest} DeletePolicyTagRequest instance + */ + DeletePolicyTagRequest.create = function create(properties) { + return new DeletePolicyTagRequest(properties); + }; + + /** + * Encodes the specified DeletePolicyTagRequest message. Does not implicitly {@link google.cloud.datacatalog.v1.DeletePolicyTagRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datacatalog.v1.DeletePolicyTagRequest + * @static + * @param {google.cloud.datacatalog.v1.IDeletePolicyTagRequest} message DeletePolicyTagRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePolicyTagRequest.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 DeletePolicyTagRequest message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.DeletePolicyTagRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datacatalog.v1.DeletePolicyTagRequest + * @static + * @param {google.cloud.datacatalog.v1.IDeletePolicyTagRequest} message DeletePolicyTagRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePolicyTagRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeletePolicyTagRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datacatalog.v1.DeletePolicyTagRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datacatalog.v1.DeletePolicyTagRequest} DeletePolicyTagRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePolicyTagRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datacatalog.v1.DeletePolicyTagRequest(); + 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 DeletePolicyTagRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datacatalog.v1.DeletePolicyTagRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datacatalog.v1.DeletePolicyTagRequest} DeletePolicyTagRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePolicyTagRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeletePolicyTagRequest message. + * @function verify + * @memberof google.cloud.datacatalog.v1.DeletePolicyTagRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeletePolicyTagRequest.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 DeletePolicyTagRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datacatalog.v1.DeletePolicyTagRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datacatalog.v1.DeletePolicyTagRequest} DeletePolicyTagRequest + */ + DeletePolicyTagRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datacatalog.v1.DeletePolicyTagRequest) + return object; + var message = new $root.google.cloud.datacatalog.v1.DeletePolicyTagRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeletePolicyTagRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datacatalog.v1.DeletePolicyTagRequest + * @static + * @param {google.cloud.datacatalog.v1.DeletePolicyTagRequest} message DeletePolicyTagRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeletePolicyTagRequest.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 DeletePolicyTagRequest to JSON. + * @function toJSON + * @memberof google.cloud.datacatalog.v1.DeletePolicyTagRequest + * @instance + * @returns {Object.} JSON object + */ + DeletePolicyTagRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeletePolicyTagRequest; + })(); + + v1.UpdatePolicyTagRequest = (function() { + + /** + * Properties of an UpdatePolicyTagRequest. + * @memberof google.cloud.datacatalog.v1 + * @interface IUpdatePolicyTagRequest + * @property {google.cloud.datacatalog.v1.IPolicyTag|null} [policyTag] UpdatePolicyTagRequest policyTag + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdatePolicyTagRequest updateMask + */ + + /** + * Constructs a new UpdatePolicyTagRequest. + * @memberof google.cloud.datacatalog.v1 + * @classdesc Represents an UpdatePolicyTagRequest. + * @implements IUpdatePolicyTagRequest + * @constructor + * @param {google.cloud.datacatalog.v1.IUpdatePolicyTagRequest=} [properties] Properties to set + */ + function UpdatePolicyTagRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdatePolicyTagRequest policyTag. + * @member {google.cloud.datacatalog.v1.IPolicyTag|null|undefined} policyTag + * @memberof google.cloud.datacatalog.v1.UpdatePolicyTagRequest + * @instance + */ + UpdatePolicyTagRequest.prototype.policyTag = null; + + /** + * UpdatePolicyTagRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.datacatalog.v1.UpdatePolicyTagRequest + * @instance + */ + UpdatePolicyTagRequest.prototype.updateMask = null; + + /** + * Creates a new UpdatePolicyTagRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datacatalog.v1.UpdatePolicyTagRequest + * @static + * @param {google.cloud.datacatalog.v1.IUpdatePolicyTagRequest=} [properties] Properties to set + * @returns {google.cloud.datacatalog.v1.UpdatePolicyTagRequest} UpdatePolicyTagRequest instance + */ + UpdatePolicyTagRequest.create = function create(properties) { + return new UpdatePolicyTagRequest(properties); + }; + + /** + * Encodes the specified UpdatePolicyTagRequest message. Does not implicitly {@link google.cloud.datacatalog.v1.UpdatePolicyTagRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datacatalog.v1.UpdatePolicyTagRequest + * @static + * @param {google.cloud.datacatalog.v1.IUpdatePolicyTagRequest} message UpdatePolicyTagRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePolicyTagRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.policyTag != null && Object.hasOwnProperty.call(message, "policyTag")) + $root.google.cloud.datacatalog.v1.PolicyTag.encode(message.policyTag, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdatePolicyTagRequest message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.UpdatePolicyTagRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datacatalog.v1.UpdatePolicyTagRequest + * @static + * @param {google.cloud.datacatalog.v1.IUpdatePolicyTagRequest} message UpdatePolicyTagRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePolicyTagRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdatePolicyTagRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datacatalog.v1.UpdatePolicyTagRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datacatalog.v1.UpdatePolicyTagRequest} UpdatePolicyTagRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePolicyTagRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datacatalog.v1.UpdatePolicyTagRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.policyTag = $root.google.cloud.datacatalog.v1.PolicyTag.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdatePolicyTagRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datacatalog.v1.UpdatePolicyTagRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datacatalog.v1.UpdatePolicyTagRequest} UpdatePolicyTagRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePolicyTagRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdatePolicyTagRequest message. + * @function verify + * @memberof google.cloud.datacatalog.v1.UpdatePolicyTagRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdatePolicyTagRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.policyTag != null && message.hasOwnProperty("policyTag")) { + var error = $root.google.cloud.datacatalog.v1.PolicyTag.verify(message.policyTag); + if (error) + return "policyTag." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdatePolicyTagRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datacatalog.v1.UpdatePolicyTagRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datacatalog.v1.UpdatePolicyTagRequest} UpdatePolicyTagRequest + */ + UpdatePolicyTagRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datacatalog.v1.UpdatePolicyTagRequest) + return object; + var message = new $root.google.cloud.datacatalog.v1.UpdatePolicyTagRequest(); + if (object.policyTag != null) { + if (typeof object.policyTag !== "object") + throw TypeError(".google.cloud.datacatalog.v1.UpdatePolicyTagRequest.policyTag: object expected"); + message.policyTag = $root.google.cloud.datacatalog.v1.PolicyTag.fromObject(object.policyTag); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.datacatalog.v1.UpdatePolicyTagRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdatePolicyTagRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datacatalog.v1.UpdatePolicyTagRequest + * @static + * @param {google.cloud.datacatalog.v1.UpdatePolicyTagRequest} message UpdatePolicyTagRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdatePolicyTagRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.policyTag = null; + object.updateMask = null; + } + if (message.policyTag != null && message.hasOwnProperty("policyTag")) + object.policyTag = $root.google.cloud.datacatalog.v1.PolicyTag.toObject(message.policyTag, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdatePolicyTagRequest to JSON. + * @function toJSON + * @memberof google.cloud.datacatalog.v1.UpdatePolicyTagRequest + * @instance + * @returns {Object.} JSON object + */ + UpdatePolicyTagRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdatePolicyTagRequest; + })(); + + v1.ListPolicyTagsRequest = (function() { + + /** + * Properties of a ListPolicyTagsRequest. + * @memberof google.cloud.datacatalog.v1 + * @interface IListPolicyTagsRequest + * @property {string|null} [parent] ListPolicyTagsRequest parent + * @property {number|null} [pageSize] ListPolicyTagsRequest pageSize + * @property {string|null} [pageToken] ListPolicyTagsRequest pageToken + */ + + /** + * Constructs a new ListPolicyTagsRequest. + * @memberof google.cloud.datacatalog.v1 + * @classdesc Represents a ListPolicyTagsRequest. + * @implements IListPolicyTagsRequest + * @constructor + * @param {google.cloud.datacatalog.v1.IListPolicyTagsRequest=} [properties] Properties to set + */ + function ListPolicyTagsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPolicyTagsRequest parent. + * @member {string} parent + * @memberof google.cloud.datacatalog.v1.ListPolicyTagsRequest + * @instance + */ + ListPolicyTagsRequest.prototype.parent = ""; + + /** + * ListPolicyTagsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.datacatalog.v1.ListPolicyTagsRequest + * @instance + */ + ListPolicyTagsRequest.prototype.pageSize = 0; + + /** + * ListPolicyTagsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.datacatalog.v1.ListPolicyTagsRequest + * @instance + */ + ListPolicyTagsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListPolicyTagsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datacatalog.v1.ListPolicyTagsRequest + * @static + * @param {google.cloud.datacatalog.v1.IListPolicyTagsRequest=} [properties] Properties to set + * @returns {google.cloud.datacatalog.v1.ListPolicyTagsRequest} ListPolicyTagsRequest instance + */ + ListPolicyTagsRequest.create = function create(properties) { + return new ListPolicyTagsRequest(properties); + }; + + /** + * Encodes the specified ListPolicyTagsRequest message. Does not implicitly {@link google.cloud.datacatalog.v1.ListPolicyTagsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datacatalog.v1.ListPolicyTagsRequest + * @static + * @param {google.cloud.datacatalog.v1.IListPolicyTagsRequest} message ListPolicyTagsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPolicyTagsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListPolicyTagsRequest message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.ListPolicyTagsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datacatalog.v1.ListPolicyTagsRequest + * @static + * @param {google.cloud.datacatalog.v1.IListPolicyTagsRequest} message ListPolicyTagsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPolicyTagsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPolicyTagsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datacatalog.v1.ListPolicyTagsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datacatalog.v1.ListPolicyTagsRequest} ListPolicyTagsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPolicyTagsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datacatalog.v1.ListPolicyTagsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPolicyTagsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datacatalog.v1.ListPolicyTagsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datacatalog.v1.ListPolicyTagsRequest} ListPolicyTagsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPolicyTagsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPolicyTagsRequest message. + * @function verify + * @memberof google.cloud.datacatalog.v1.ListPolicyTagsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPolicyTagsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListPolicyTagsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datacatalog.v1.ListPolicyTagsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datacatalog.v1.ListPolicyTagsRequest} ListPolicyTagsRequest + */ + ListPolicyTagsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datacatalog.v1.ListPolicyTagsRequest) + return object; + var message = new $root.google.cloud.datacatalog.v1.ListPolicyTagsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListPolicyTagsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datacatalog.v1.ListPolicyTagsRequest + * @static + * @param {google.cloud.datacatalog.v1.ListPolicyTagsRequest} message ListPolicyTagsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPolicyTagsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListPolicyTagsRequest to JSON. + * @function toJSON + * @memberof google.cloud.datacatalog.v1.ListPolicyTagsRequest + * @instance + * @returns {Object.} JSON object + */ + ListPolicyTagsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListPolicyTagsRequest; + })(); + + v1.ListPolicyTagsResponse = (function() { + + /** + * Properties of a ListPolicyTagsResponse. + * @memberof google.cloud.datacatalog.v1 + * @interface IListPolicyTagsResponse + * @property {Array.|null} [policyTags] ListPolicyTagsResponse policyTags + * @property {string|null} [nextPageToken] ListPolicyTagsResponse nextPageToken + */ + + /** + * Constructs a new ListPolicyTagsResponse. + * @memberof google.cloud.datacatalog.v1 + * @classdesc Represents a ListPolicyTagsResponse. + * @implements IListPolicyTagsResponse + * @constructor + * @param {google.cloud.datacatalog.v1.IListPolicyTagsResponse=} [properties] Properties to set + */ + function ListPolicyTagsResponse(properties) { + this.policyTags = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPolicyTagsResponse policyTags. + * @member {Array.} policyTags + * @memberof google.cloud.datacatalog.v1.ListPolicyTagsResponse + * @instance + */ + ListPolicyTagsResponse.prototype.policyTags = $util.emptyArray; + + /** + * ListPolicyTagsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.datacatalog.v1.ListPolicyTagsResponse + * @instance + */ + ListPolicyTagsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListPolicyTagsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.datacatalog.v1.ListPolicyTagsResponse + * @static + * @param {google.cloud.datacatalog.v1.IListPolicyTagsResponse=} [properties] Properties to set + * @returns {google.cloud.datacatalog.v1.ListPolicyTagsResponse} ListPolicyTagsResponse instance + */ + ListPolicyTagsResponse.create = function create(properties) { + return new ListPolicyTagsResponse(properties); + }; + + /** + * Encodes the specified ListPolicyTagsResponse message. Does not implicitly {@link google.cloud.datacatalog.v1.ListPolicyTagsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.datacatalog.v1.ListPolicyTagsResponse + * @static + * @param {google.cloud.datacatalog.v1.IListPolicyTagsResponse} message ListPolicyTagsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPolicyTagsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.policyTags != null && message.policyTags.length) + for (var i = 0; i < message.policyTags.length; ++i) + $root.google.cloud.datacatalog.v1.PolicyTag.encode(message.policyTags[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListPolicyTagsResponse message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.ListPolicyTagsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datacatalog.v1.ListPolicyTagsResponse + * @static + * @param {google.cloud.datacatalog.v1.IListPolicyTagsResponse} message ListPolicyTagsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPolicyTagsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPolicyTagsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datacatalog.v1.ListPolicyTagsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datacatalog.v1.ListPolicyTagsResponse} ListPolicyTagsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPolicyTagsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datacatalog.v1.ListPolicyTagsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.policyTags && message.policyTags.length)) + message.policyTags = []; + message.policyTags.push($root.google.cloud.datacatalog.v1.PolicyTag.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPolicyTagsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datacatalog.v1.ListPolicyTagsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datacatalog.v1.ListPolicyTagsResponse} ListPolicyTagsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPolicyTagsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPolicyTagsResponse message. + * @function verify + * @memberof google.cloud.datacatalog.v1.ListPolicyTagsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPolicyTagsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.policyTags != null && message.hasOwnProperty("policyTags")) { + if (!Array.isArray(message.policyTags)) + return "policyTags: array expected"; + for (var i = 0; i < message.policyTags.length; ++i) { + var error = $root.google.cloud.datacatalog.v1.PolicyTag.verify(message.policyTags[i]); + if (error) + return "policyTags." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListPolicyTagsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datacatalog.v1.ListPolicyTagsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datacatalog.v1.ListPolicyTagsResponse} ListPolicyTagsResponse + */ + ListPolicyTagsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datacatalog.v1.ListPolicyTagsResponse) + return object; + var message = new $root.google.cloud.datacatalog.v1.ListPolicyTagsResponse(); + if (object.policyTags) { + if (!Array.isArray(object.policyTags)) + throw TypeError(".google.cloud.datacatalog.v1.ListPolicyTagsResponse.policyTags: array expected"); + message.policyTags = []; + for (var i = 0; i < object.policyTags.length; ++i) { + if (typeof object.policyTags[i] !== "object") + throw TypeError(".google.cloud.datacatalog.v1.ListPolicyTagsResponse.policyTags: object expected"); + message.policyTags[i] = $root.google.cloud.datacatalog.v1.PolicyTag.fromObject(object.policyTags[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListPolicyTagsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datacatalog.v1.ListPolicyTagsResponse + * @static + * @param {google.cloud.datacatalog.v1.ListPolicyTagsResponse} message ListPolicyTagsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPolicyTagsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.policyTags = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.policyTags && message.policyTags.length) { + object.policyTags = []; + for (var j = 0; j < message.policyTags.length; ++j) + object.policyTags[j] = $root.google.cloud.datacatalog.v1.PolicyTag.toObject(message.policyTags[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListPolicyTagsResponse to JSON. + * @function toJSON + * @memberof google.cloud.datacatalog.v1.ListPolicyTagsResponse + * @instance + * @returns {Object.} JSON object + */ + ListPolicyTagsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListPolicyTagsResponse; + })(); + + v1.GetPolicyTagRequest = (function() { + + /** + * Properties of a GetPolicyTagRequest. + * @memberof google.cloud.datacatalog.v1 + * @interface IGetPolicyTagRequest + * @property {string|null} [name] GetPolicyTagRequest name + */ + + /** + * Constructs a new GetPolicyTagRequest. + * @memberof google.cloud.datacatalog.v1 + * @classdesc Represents a GetPolicyTagRequest. + * @implements IGetPolicyTagRequest + * @constructor + * @param {google.cloud.datacatalog.v1.IGetPolicyTagRequest=} [properties] Properties to set + */ + function GetPolicyTagRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPolicyTagRequest name. + * @member {string} name + * @memberof google.cloud.datacatalog.v1.GetPolicyTagRequest + * @instance + */ + GetPolicyTagRequest.prototype.name = ""; + + /** + * Creates a new GetPolicyTagRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datacatalog.v1.GetPolicyTagRequest + * @static + * @param {google.cloud.datacatalog.v1.IGetPolicyTagRequest=} [properties] Properties to set + * @returns {google.cloud.datacatalog.v1.GetPolicyTagRequest} GetPolicyTagRequest instance + */ + GetPolicyTagRequest.create = function create(properties) { + return new GetPolicyTagRequest(properties); + }; + + /** + * Encodes the specified GetPolicyTagRequest message. Does not implicitly {@link google.cloud.datacatalog.v1.GetPolicyTagRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datacatalog.v1.GetPolicyTagRequest + * @static + * @param {google.cloud.datacatalog.v1.IGetPolicyTagRequest} message GetPolicyTagRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPolicyTagRequest.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 GetPolicyTagRequest message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.GetPolicyTagRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datacatalog.v1.GetPolicyTagRequest + * @static + * @param {google.cloud.datacatalog.v1.IGetPolicyTagRequest} message GetPolicyTagRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPolicyTagRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPolicyTagRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datacatalog.v1.GetPolicyTagRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datacatalog.v1.GetPolicyTagRequest} GetPolicyTagRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPolicyTagRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datacatalog.v1.GetPolicyTagRequest(); + 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 GetPolicyTagRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datacatalog.v1.GetPolicyTagRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datacatalog.v1.GetPolicyTagRequest} GetPolicyTagRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPolicyTagRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPolicyTagRequest message. + * @function verify + * @memberof google.cloud.datacatalog.v1.GetPolicyTagRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPolicyTagRequest.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 GetPolicyTagRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datacatalog.v1.GetPolicyTagRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datacatalog.v1.GetPolicyTagRequest} GetPolicyTagRequest + */ + GetPolicyTagRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datacatalog.v1.GetPolicyTagRequest) + return object; + var message = new $root.google.cloud.datacatalog.v1.GetPolicyTagRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetPolicyTagRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datacatalog.v1.GetPolicyTagRequest + * @static + * @param {google.cloud.datacatalog.v1.GetPolicyTagRequest} message GetPolicyTagRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPolicyTagRequest.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 GetPolicyTagRequest to JSON. + * @function toJSON + * @memberof google.cloud.datacatalog.v1.GetPolicyTagRequest + * @instance + * @returns {Object.} JSON object + */ + GetPolicyTagRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetPolicyTagRequest; + })(); + + v1.PolicyTagManagerSerialization = (function() { + + /** + * Constructs a new PolicyTagManagerSerialization service. + * @memberof google.cloud.datacatalog.v1 + * @classdesc Represents a PolicyTagManagerSerialization + * @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 PolicyTagManagerSerialization(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (PolicyTagManagerSerialization.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = PolicyTagManagerSerialization; + + /** + * Creates new PolicyTagManagerSerialization service using the specified rpc implementation. + * @function create + * @memberof google.cloud.datacatalog.v1.PolicyTagManagerSerialization + * @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 {PolicyTagManagerSerialization} RPC service. Useful where requests and/or responses are streamed. + */ + PolicyTagManagerSerialization.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.datacatalog.v1.PolicyTagManagerSerialization#importTaxonomies}. + * @memberof google.cloud.datacatalog.v1.PolicyTagManagerSerialization + * @typedef ImportTaxonomiesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datacatalog.v1.ImportTaxonomiesResponse} [response] ImportTaxonomiesResponse + */ + + /** + * Calls ImportTaxonomies. + * @function importTaxonomies + * @memberof google.cloud.datacatalog.v1.PolicyTagManagerSerialization + * @instance + * @param {google.cloud.datacatalog.v1.IImportTaxonomiesRequest} request ImportTaxonomiesRequest message or plain object + * @param {google.cloud.datacatalog.v1.PolicyTagManagerSerialization.ImportTaxonomiesCallback} callback Node-style callback called with the error, if any, and ImportTaxonomiesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PolicyTagManagerSerialization.prototype.importTaxonomies = function importTaxonomies(request, callback) { + return this.rpcCall(importTaxonomies, $root.google.cloud.datacatalog.v1.ImportTaxonomiesRequest, $root.google.cloud.datacatalog.v1.ImportTaxonomiesResponse, request, callback); + }, "name", { value: "ImportTaxonomies" }); + + /** + * Calls ImportTaxonomies. + * @function importTaxonomies + * @memberof google.cloud.datacatalog.v1.PolicyTagManagerSerialization + * @instance + * @param {google.cloud.datacatalog.v1.IImportTaxonomiesRequest} request ImportTaxonomiesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datacatalog.v1.PolicyTagManagerSerialization#exportTaxonomies}. + * @memberof google.cloud.datacatalog.v1.PolicyTagManagerSerialization + * @typedef ExportTaxonomiesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datacatalog.v1.ExportTaxonomiesResponse} [response] ExportTaxonomiesResponse + */ + + /** + * Calls ExportTaxonomies. + * @function exportTaxonomies + * @memberof google.cloud.datacatalog.v1.PolicyTagManagerSerialization + * @instance + * @param {google.cloud.datacatalog.v1.IExportTaxonomiesRequest} request ExportTaxonomiesRequest message or plain object + * @param {google.cloud.datacatalog.v1.PolicyTagManagerSerialization.ExportTaxonomiesCallback} callback Node-style callback called with the error, if any, and ExportTaxonomiesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PolicyTagManagerSerialization.prototype.exportTaxonomies = function exportTaxonomies(request, callback) { + return this.rpcCall(exportTaxonomies, $root.google.cloud.datacatalog.v1.ExportTaxonomiesRequest, $root.google.cloud.datacatalog.v1.ExportTaxonomiesResponse, request, callback); + }, "name", { value: "ExportTaxonomies" }); + + /** + * Calls ExportTaxonomies. + * @function exportTaxonomies + * @memberof google.cloud.datacatalog.v1.PolicyTagManagerSerialization + * @instance + * @param {google.cloud.datacatalog.v1.IExportTaxonomiesRequest} request ExportTaxonomiesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return PolicyTagManagerSerialization; + })(); + + v1.SerializedTaxonomy = (function() { + + /** + * Properties of a SerializedTaxonomy. + * @memberof google.cloud.datacatalog.v1 + * @interface ISerializedTaxonomy + * @property {string|null} [displayName] SerializedTaxonomy displayName + * @property {string|null} [description] SerializedTaxonomy description + * @property {Array.|null} [policyTags] SerializedTaxonomy policyTags + * @property {Array.|null} [activatedPolicyTypes] SerializedTaxonomy activatedPolicyTypes + */ + + /** + * Constructs a new SerializedTaxonomy. + * @memberof google.cloud.datacatalog.v1 + * @classdesc Represents a SerializedTaxonomy. + * @implements ISerializedTaxonomy + * @constructor + * @param {google.cloud.datacatalog.v1.ISerializedTaxonomy=} [properties] Properties to set + */ + function SerializedTaxonomy(properties) { + this.policyTags = []; + this.activatedPolicyTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SerializedTaxonomy displayName. + * @member {string} displayName + * @memberof google.cloud.datacatalog.v1.SerializedTaxonomy + * @instance + */ + SerializedTaxonomy.prototype.displayName = ""; + + /** + * SerializedTaxonomy description. + * @member {string} description + * @memberof google.cloud.datacatalog.v1.SerializedTaxonomy + * @instance + */ + SerializedTaxonomy.prototype.description = ""; + + /** + * SerializedTaxonomy policyTags. + * @member {Array.} policyTags + * @memberof google.cloud.datacatalog.v1.SerializedTaxonomy + * @instance + */ + SerializedTaxonomy.prototype.policyTags = $util.emptyArray; + + /** + * SerializedTaxonomy activatedPolicyTypes. + * @member {Array.} activatedPolicyTypes + * @memberof google.cloud.datacatalog.v1.SerializedTaxonomy + * @instance + */ + SerializedTaxonomy.prototype.activatedPolicyTypes = $util.emptyArray; + + /** + * Creates a new SerializedTaxonomy instance using the specified properties. + * @function create + * @memberof google.cloud.datacatalog.v1.SerializedTaxonomy + * @static + * @param {google.cloud.datacatalog.v1.ISerializedTaxonomy=} [properties] Properties to set + * @returns {google.cloud.datacatalog.v1.SerializedTaxonomy} SerializedTaxonomy instance + */ + SerializedTaxonomy.create = function create(properties) { + return new SerializedTaxonomy(properties); + }; + + /** + * Encodes the specified SerializedTaxonomy message. Does not implicitly {@link google.cloud.datacatalog.v1.SerializedTaxonomy.verify|verify} messages. + * @function encode + * @memberof google.cloud.datacatalog.v1.SerializedTaxonomy + * @static + * @param {google.cloud.datacatalog.v1.ISerializedTaxonomy} message SerializedTaxonomy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SerializedTaxonomy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.policyTags != null && message.policyTags.length) + for (var i = 0; i < message.policyTags.length; ++i) + $root.google.cloud.datacatalog.v1.SerializedPolicyTag.encode(message.policyTags[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.activatedPolicyTypes != null && message.activatedPolicyTypes.length) { + writer.uint32(/* id 4, wireType 2 =*/34).fork(); + for (var i = 0; i < message.activatedPolicyTypes.length; ++i) + writer.int32(message.activatedPolicyTypes[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified SerializedTaxonomy message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.SerializedTaxonomy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datacatalog.v1.SerializedTaxonomy + * @static + * @param {google.cloud.datacatalog.v1.ISerializedTaxonomy} message SerializedTaxonomy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SerializedTaxonomy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SerializedTaxonomy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datacatalog.v1.SerializedTaxonomy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datacatalog.v1.SerializedTaxonomy} SerializedTaxonomy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SerializedTaxonomy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datacatalog.v1.SerializedTaxonomy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.displayName = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if (!(message.policyTags && message.policyTags.length)) + message.policyTags = []; + message.policyTags.push($root.google.cloud.datacatalog.v1.SerializedPolicyTag.decode(reader, reader.uint32())); + break; + case 4: + if (!(message.activatedPolicyTypes && message.activatedPolicyTypes.length)) + message.activatedPolicyTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.activatedPolicyTypes.push(reader.int32()); + } else + message.activatedPolicyTypes.push(reader.int32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SerializedTaxonomy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datacatalog.v1.SerializedTaxonomy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datacatalog.v1.SerializedTaxonomy} SerializedTaxonomy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SerializedTaxonomy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SerializedTaxonomy message. + * @function verify + * @memberof google.cloud.datacatalog.v1.SerializedTaxonomy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SerializedTaxonomy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.policyTags != null && message.hasOwnProperty("policyTags")) { + if (!Array.isArray(message.policyTags)) + return "policyTags: array expected"; + for (var i = 0; i < message.policyTags.length; ++i) { + var error = $root.google.cloud.datacatalog.v1.SerializedPolicyTag.verify(message.policyTags[i]); + if (error) + return "policyTags." + error; + } + } + if (message.activatedPolicyTypes != null && message.hasOwnProperty("activatedPolicyTypes")) { + if (!Array.isArray(message.activatedPolicyTypes)) + return "activatedPolicyTypes: array expected"; + for (var i = 0; i < message.activatedPolicyTypes.length; ++i) + switch (message.activatedPolicyTypes[i]) { + default: + return "activatedPolicyTypes: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a SerializedTaxonomy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datacatalog.v1.SerializedTaxonomy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datacatalog.v1.SerializedTaxonomy} SerializedTaxonomy + */ + SerializedTaxonomy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datacatalog.v1.SerializedTaxonomy) + return object; + var message = new $root.google.cloud.datacatalog.v1.SerializedTaxonomy(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.policyTags) { + if (!Array.isArray(object.policyTags)) + throw TypeError(".google.cloud.datacatalog.v1.SerializedTaxonomy.policyTags: array expected"); + message.policyTags = []; + for (var i = 0; i < object.policyTags.length; ++i) { + if (typeof object.policyTags[i] !== "object") + throw TypeError(".google.cloud.datacatalog.v1.SerializedTaxonomy.policyTags: object expected"); + message.policyTags[i] = $root.google.cloud.datacatalog.v1.SerializedPolicyTag.fromObject(object.policyTags[i]); + } + } + if (object.activatedPolicyTypes) { + if (!Array.isArray(object.activatedPolicyTypes)) + throw TypeError(".google.cloud.datacatalog.v1.SerializedTaxonomy.activatedPolicyTypes: array expected"); + message.activatedPolicyTypes = []; + for (var i = 0; i < object.activatedPolicyTypes.length; ++i) + switch (object.activatedPolicyTypes[i]) { + default: + case "POLICY_TYPE_UNSPECIFIED": + case 0: + message.activatedPolicyTypes[i] = 0; + break; + case "FINE_GRAINED_ACCESS_CONTROL": + case 1: + message.activatedPolicyTypes[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a SerializedTaxonomy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datacatalog.v1.SerializedTaxonomy + * @static + * @param {google.cloud.datacatalog.v1.SerializedTaxonomy} message SerializedTaxonomy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SerializedTaxonomy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.policyTags = []; + object.activatedPolicyTypes = []; + } + if (options.defaults) { + object.displayName = ""; + object.description = ""; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.policyTags && message.policyTags.length) { + object.policyTags = []; + for (var j = 0; j < message.policyTags.length; ++j) + object.policyTags[j] = $root.google.cloud.datacatalog.v1.SerializedPolicyTag.toObject(message.policyTags[j], options); + } + if (message.activatedPolicyTypes && message.activatedPolicyTypes.length) { + object.activatedPolicyTypes = []; + for (var j = 0; j < message.activatedPolicyTypes.length; ++j) + object.activatedPolicyTypes[j] = options.enums === String ? $root.google.cloud.datacatalog.v1.Taxonomy.PolicyType[message.activatedPolicyTypes[j]] : message.activatedPolicyTypes[j]; + } + return object; + }; + + /** + * Converts this SerializedTaxonomy to JSON. + * @function toJSON + * @memberof google.cloud.datacatalog.v1.SerializedTaxonomy + * @instance + * @returns {Object.} JSON object + */ + SerializedTaxonomy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SerializedTaxonomy; + })(); + + v1.SerializedPolicyTag = (function() { + + /** + * Properties of a SerializedPolicyTag. + * @memberof google.cloud.datacatalog.v1 + * @interface ISerializedPolicyTag + * @property {string|null} [policyTag] SerializedPolicyTag policyTag + * @property {string|null} [displayName] SerializedPolicyTag displayName + * @property {string|null} [description] SerializedPolicyTag description + * @property {Array.|null} [childPolicyTags] SerializedPolicyTag childPolicyTags + */ + + /** + * Constructs a new SerializedPolicyTag. + * @memberof google.cloud.datacatalog.v1 + * @classdesc Represents a SerializedPolicyTag. + * @implements ISerializedPolicyTag + * @constructor + * @param {google.cloud.datacatalog.v1.ISerializedPolicyTag=} [properties] Properties to set + */ + function SerializedPolicyTag(properties) { + this.childPolicyTags = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SerializedPolicyTag policyTag. + * @member {string} policyTag + * @memberof google.cloud.datacatalog.v1.SerializedPolicyTag + * @instance + */ + SerializedPolicyTag.prototype.policyTag = ""; + + /** + * SerializedPolicyTag displayName. + * @member {string} displayName + * @memberof google.cloud.datacatalog.v1.SerializedPolicyTag + * @instance + */ + SerializedPolicyTag.prototype.displayName = ""; + + /** + * SerializedPolicyTag description. + * @member {string} description + * @memberof google.cloud.datacatalog.v1.SerializedPolicyTag + * @instance + */ + SerializedPolicyTag.prototype.description = ""; + + /** + * SerializedPolicyTag childPolicyTags. + * @member {Array.} childPolicyTags + * @memberof google.cloud.datacatalog.v1.SerializedPolicyTag + * @instance + */ + SerializedPolicyTag.prototype.childPolicyTags = $util.emptyArray; + + /** + * Creates a new SerializedPolicyTag instance using the specified properties. + * @function create + * @memberof google.cloud.datacatalog.v1.SerializedPolicyTag + * @static + * @param {google.cloud.datacatalog.v1.ISerializedPolicyTag=} [properties] Properties to set + * @returns {google.cloud.datacatalog.v1.SerializedPolicyTag} SerializedPolicyTag instance + */ + SerializedPolicyTag.create = function create(properties) { + return new SerializedPolicyTag(properties); + }; + + /** + * Encodes the specified SerializedPolicyTag message. Does not implicitly {@link google.cloud.datacatalog.v1.SerializedPolicyTag.verify|verify} messages. + * @function encode + * @memberof google.cloud.datacatalog.v1.SerializedPolicyTag + * @static + * @param {google.cloud.datacatalog.v1.ISerializedPolicyTag} message SerializedPolicyTag message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SerializedPolicyTag.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.policyTag != null && Object.hasOwnProperty.call(message, "policyTag")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.policyTag); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.childPolicyTags != null && message.childPolicyTags.length) + for (var i = 0; i < message.childPolicyTags.length; ++i) + $root.google.cloud.datacatalog.v1.SerializedPolicyTag.encode(message.childPolicyTags[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SerializedPolicyTag message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.SerializedPolicyTag.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datacatalog.v1.SerializedPolicyTag + * @static + * @param {google.cloud.datacatalog.v1.ISerializedPolicyTag} message SerializedPolicyTag message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SerializedPolicyTag.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SerializedPolicyTag message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datacatalog.v1.SerializedPolicyTag + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datacatalog.v1.SerializedPolicyTag} SerializedPolicyTag + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SerializedPolicyTag.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datacatalog.v1.SerializedPolicyTag(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.policyTag = reader.string(); + break; + case 2: + message.displayName = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + if (!(message.childPolicyTags && message.childPolicyTags.length)) + message.childPolicyTags = []; + message.childPolicyTags.push($root.google.cloud.datacatalog.v1.SerializedPolicyTag.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SerializedPolicyTag message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datacatalog.v1.SerializedPolicyTag + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datacatalog.v1.SerializedPolicyTag} SerializedPolicyTag + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SerializedPolicyTag.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SerializedPolicyTag message. + * @function verify + * @memberof google.cloud.datacatalog.v1.SerializedPolicyTag + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SerializedPolicyTag.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.policyTag != null && message.hasOwnProperty("policyTag")) + if (!$util.isString(message.policyTag)) + return "policyTag: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.childPolicyTags != null && message.hasOwnProperty("childPolicyTags")) { + if (!Array.isArray(message.childPolicyTags)) + return "childPolicyTags: array expected"; + for (var i = 0; i < message.childPolicyTags.length; ++i) { + var error = $root.google.cloud.datacatalog.v1.SerializedPolicyTag.verify(message.childPolicyTags[i]); + if (error) + return "childPolicyTags." + error; + } + } + return null; + }; + + /** + * Creates a SerializedPolicyTag message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datacatalog.v1.SerializedPolicyTag + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datacatalog.v1.SerializedPolicyTag} SerializedPolicyTag + */ + SerializedPolicyTag.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datacatalog.v1.SerializedPolicyTag) + return object; + var message = new $root.google.cloud.datacatalog.v1.SerializedPolicyTag(); + if (object.policyTag != null) + message.policyTag = String(object.policyTag); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.childPolicyTags) { + if (!Array.isArray(object.childPolicyTags)) + throw TypeError(".google.cloud.datacatalog.v1.SerializedPolicyTag.childPolicyTags: array expected"); + message.childPolicyTags = []; + for (var i = 0; i < object.childPolicyTags.length; ++i) { + if (typeof object.childPolicyTags[i] !== "object") + throw TypeError(".google.cloud.datacatalog.v1.SerializedPolicyTag.childPolicyTags: object expected"); + message.childPolicyTags[i] = $root.google.cloud.datacatalog.v1.SerializedPolicyTag.fromObject(object.childPolicyTags[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SerializedPolicyTag message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datacatalog.v1.SerializedPolicyTag + * @static + * @param {google.cloud.datacatalog.v1.SerializedPolicyTag} message SerializedPolicyTag + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SerializedPolicyTag.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.childPolicyTags = []; + if (options.defaults) { + object.policyTag = ""; + object.displayName = ""; + object.description = ""; + } + if (message.policyTag != null && message.hasOwnProperty("policyTag")) + object.policyTag = message.policyTag; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.childPolicyTags && message.childPolicyTags.length) { + object.childPolicyTags = []; + for (var j = 0; j < message.childPolicyTags.length; ++j) + object.childPolicyTags[j] = $root.google.cloud.datacatalog.v1.SerializedPolicyTag.toObject(message.childPolicyTags[j], options); + } + return object; + }; + + /** + * Converts this SerializedPolicyTag to JSON. + * @function toJSON + * @memberof google.cloud.datacatalog.v1.SerializedPolicyTag + * @instance + * @returns {Object.} JSON object + */ + SerializedPolicyTag.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SerializedPolicyTag; + })(); + + v1.ImportTaxonomiesRequest = (function() { + + /** + * Properties of an ImportTaxonomiesRequest. + * @memberof google.cloud.datacatalog.v1 + * @interface IImportTaxonomiesRequest + * @property {string|null} [parent] ImportTaxonomiesRequest parent + * @property {google.cloud.datacatalog.v1.IInlineSource|null} [inlineSource] ImportTaxonomiesRequest inlineSource + * @property {google.cloud.datacatalog.v1.ICrossRegionalSource|null} [crossRegionalSource] ImportTaxonomiesRequest crossRegionalSource + */ + + /** + * Constructs a new ImportTaxonomiesRequest. + * @memberof google.cloud.datacatalog.v1 + * @classdesc Represents an ImportTaxonomiesRequest. + * @implements IImportTaxonomiesRequest + * @constructor + * @param {google.cloud.datacatalog.v1.IImportTaxonomiesRequest=} [properties] Properties to set + */ + function ImportTaxonomiesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportTaxonomiesRequest parent. + * @member {string} parent + * @memberof google.cloud.datacatalog.v1.ImportTaxonomiesRequest + * @instance + */ + ImportTaxonomiesRequest.prototype.parent = ""; + + /** + * ImportTaxonomiesRequest inlineSource. + * @member {google.cloud.datacatalog.v1.IInlineSource|null|undefined} inlineSource + * @memberof google.cloud.datacatalog.v1.ImportTaxonomiesRequest + * @instance + */ + ImportTaxonomiesRequest.prototype.inlineSource = null; + + /** + * ImportTaxonomiesRequest crossRegionalSource. + * @member {google.cloud.datacatalog.v1.ICrossRegionalSource|null|undefined} crossRegionalSource + * @memberof google.cloud.datacatalog.v1.ImportTaxonomiesRequest + * @instance + */ + ImportTaxonomiesRequest.prototype.crossRegionalSource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImportTaxonomiesRequest source. + * @member {"inlineSource"|"crossRegionalSource"|undefined} source + * @memberof google.cloud.datacatalog.v1.ImportTaxonomiesRequest + * @instance + */ + Object.defineProperty(ImportTaxonomiesRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["inlineSource", "crossRegionalSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImportTaxonomiesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datacatalog.v1.ImportTaxonomiesRequest + * @static + * @param {google.cloud.datacatalog.v1.IImportTaxonomiesRequest=} [properties] Properties to set + * @returns {google.cloud.datacatalog.v1.ImportTaxonomiesRequest} ImportTaxonomiesRequest instance + */ + ImportTaxonomiesRequest.create = function create(properties) { + return new ImportTaxonomiesRequest(properties); + }; + + /** + * Encodes the specified ImportTaxonomiesRequest message. Does not implicitly {@link google.cloud.datacatalog.v1.ImportTaxonomiesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datacatalog.v1.ImportTaxonomiesRequest + * @static + * @param {google.cloud.datacatalog.v1.IImportTaxonomiesRequest} message ImportTaxonomiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportTaxonomiesRequest.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.datacatalog.v1.InlineSource.encode(message.inlineSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.crossRegionalSource != null && Object.hasOwnProperty.call(message, "crossRegionalSource")) + $root.google.cloud.datacatalog.v1.CrossRegionalSource.encode(message.crossRegionalSource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportTaxonomiesRequest message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.ImportTaxonomiesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datacatalog.v1.ImportTaxonomiesRequest + * @static + * @param {google.cloud.datacatalog.v1.IImportTaxonomiesRequest} message ImportTaxonomiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportTaxonomiesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportTaxonomiesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datacatalog.v1.ImportTaxonomiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datacatalog.v1.ImportTaxonomiesRequest} ImportTaxonomiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportTaxonomiesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datacatalog.v1.ImportTaxonomiesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.inlineSource = $root.google.cloud.datacatalog.v1.InlineSource.decode(reader, reader.uint32()); + break; + case 3: + message.crossRegionalSource = $root.google.cloud.datacatalog.v1.CrossRegionalSource.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportTaxonomiesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datacatalog.v1.ImportTaxonomiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datacatalog.v1.ImportTaxonomiesRequest} ImportTaxonomiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportTaxonomiesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportTaxonomiesRequest message. + * @function verify + * @memberof google.cloud.datacatalog.v1.ImportTaxonomiesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportTaxonomiesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.inlineSource != null && message.hasOwnProperty("inlineSource")) { + properties.source = 1; + { + var error = $root.google.cloud.datacatalog.v1.InlineSource.verify(message.inlineSource); + if (error) + return "inlineSource." + error; + } + } + if (message.crossRegionalSource != null && message.hasOwnProperty("crossRegionalSource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.datacatalog.v1.CrossRegionalSource.verify(message.crossRegionalSource); + if (error) + return "crossRegionalSource." + error; + } + } + return null; + }; + + /** + * Creates an ImportTaxonomiesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datacatalog.v1.ImportTaxonomiesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datacatalog.v1.ImportTaxonomiesRequest} ImportTaxonomiesRequest + */ + ImportTaxonomiesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datacatalog.v1.ImportTaxonomiesRequest) + return object; + var message = new $root.google.cloud.datacatalog.v1.ImportTaxonomiesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.inlineSource != null) { + if (typeof object.inlineSource !== "object") + throw TypeError(".google.cloud.datacatalog.v1.ImportTaxonomiesRequest.inlineSource: object expected"); + message.inlineSource = $root.google.cloud.datacatalog.v1.InlineSource.fromObject(object.inlineSource); + } + if (object.crossRegionalSource != null) { + if (typeof object.crossRegionalSource !== "object") + throw TypeError(".google.cloud.datacatalog.v1.ImportTaxonomiesRequest.crossRegionalSource: object expected"); + message.crossRegionalSource = $root.google.cloud.datacatalog.v1.CrossRegionalSource.fromObject(object.crossRegionalSource); + } + return message; + }; + + /** + * Creates a plain object from an ImportTaxonomiesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datacatalog.v1.ImportTaxonomiesRequest + * @static + * @param {google.cloud.datacatalog.v1.ImportTaxonomiesRequest} message ImportTaxonomiesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportTaxonomiesRequest.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.datacatalog.v1.InlineSource.toObject(message.inlineSource, options); + if (options.oneofs) + object.source = "inlineSource"; + } + if (message.crossRegionalSource != null && message.hasOwnProperty("crossRegionalSource")) { + object.crossRegionalSource = $root.google.cloud.datacatalog.v1.CrossRegionalSource.toObject(message.crossRegionalSource, options); + if (options.oneofs) + object.source = "crossRegionalSource"; + } + return object; + }; + + /** + * Converts this ImportTaxonomiesRequest to JSON. + * @function toJSON + * @memberof google.cloud.datacatalog.v1.ImportTaxonomiesRequest + * @instance + * @returns {Object.} JSON object + */ + ImportTaxonomiesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImportTaxonomiesRequest; + })(); + + v1.InlineSource = (function() { + + /** + * Properties of an InlineSource. + * @memberof google.cloud.datacatalog.v1 + * @interface IInlineSource + * @property {Array.|null} [taxonomies] InlineSource taxonomies + */ + + /** + * Constructs a new InlineSource. + * @memberof google.cloud.datacatalog.v1 + * @classdesc Represents an InlineSource. + * @implements IInlineSource + * @constructor + * @param {google.cloud.datacatalog.v1.IInlineSource=} [properties] Properties to set + */ + function InlineSource(properties) { + this.taxonomies = []; + if (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 taxonomies. + * @member {Array.} taxonomies + * @memberof google.cloud.datacatalog.v1.InlineSource + * @instance + */ + InlineSource.prototype.taxonomies = $util.emptyArray; + + /** + * Creates a new InlineSource instance using the specified properties. + * @function create + * @memberof google.cloud.datacatalog.v1.InlineSource + * @static + * @param {google.cloud.datacatalog.v1.IInlineSource=} [properties] Properties to set + * @returns {google.cloud.datacatalog.v1.InlineSource} InlineSource instance + */ + InlineSource.create = function create(properties) { + return new InlineSource(properties); + }; + + /** + * Encodes the specified InlineSource message. Does not implicitly {@link google.cloud.datacatalog.v1.InlineSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.datacatalog.v1.InlineSource + * @static + * @param {google.cloud.datacatalog.v1.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.taxonomies != null && message.taxonomies.length) + for (var i = 0; i < message.taxonomies.length; ++i) + $root.google.cloud.datacatalog.v1.SerializedTaxonomy.encode(message.taxonomies[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.datacatalog.v1.InlineSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datacatalog.v1.InlineSource + * @static + * @param {google.cloud.datacatalog.v1.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.datacatalog.v1.InlineSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datacatalog.v1.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.datacatalog.v1.InlineSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.taxonomies && message.taxonomies.length)) + message.taxonomies = []; + message.taxonomies.push($root.google.cloud.datacatalog.v1.SerializedTaxonomy.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.datacatalog.v1.InlineSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datacatalog.v1.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.datacatalog.v1.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.taxonomies != null && message.hasOwnProperty("taxonomies")) { + if (!Array.isArray(message.taxonomies)) + return "taxonomies: array expected"; + for (var i = 0; i < message.taxonomies.length; ++i) { + var error = $root.google.cloud.datacatalog.v1.SerializedTaxonomy.verify(message.taxonomies[i]); + if (error) + return "taxonomies." + error; + } + } + return null; + }; + + /** + * Creates an InlineSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datacatalog.v1.InlineSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datacatalog.v1.InlineSource} InlineSource + */ + InlineSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datacatalog.v1.InlineSource) + return object; + var message = new $root.google.cloud.datacatalog.v1.InlineSource(); + if (object.taxonomies) { + if (!Array.isArray(object.taxonomies)) + throw TypeError(".google.cloud.datacatalog.v1.InlineSource.taxonomies: array expected"); + message.taxonomies = []; + for (var i = 0; i < object.taxonomies.length; ++i) { + if (typeof object.taxonomies[i] !== "object") + throw TypeError(".google.cloud.datacatalog.v1.InlineSource.taxonomies: object expected"); + message.taxonomies[i] = $root.google.cloud.datacatalog.v1.SerializedTaxonomy.fromObject(object.taxonomies[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an InlineSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datacatalog.v1.InlineSource + * @static + * @param {google.cloud.datacatalog.v1.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.taxonomies = []; + if (message.taxonomies && message.taxonomies.length) { + object.taxonomies = []; + for (var j = 0; j < message.taxonomies.length; ++j) + object.taxonomies[j] = $root.google.cloud.datacatalog.v1.SerializedTaxonomy.toObject(message.taxonomies[j], options); + } + return object; + }; + + /** + * Converts this InlineSource to JSON. + * @function toJSON + * @memberof google.cloud.datacatalog.v1.InlineSource + * @instance + * @returns {Object.} JSON object + */ + InlineSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InlineSource; + })(); + + v1.CrossRegionalSource = (function() { + + /** + * Properties of a CrossRegionalSource. + * @memberof google.cloud.datacatalog.v1 + * @interface ICrossRegionalSource + * @property {string|null} [taxonomy] CrossRegionalSource taxonomy + */ + + /** + * Constructs a new CrossRegionalSource. + * @memberof google.cloud.datacatalog.v1 + * @classdesc Represents a CrossRegionalSource. + * @implements ICrossRegionalSource + * @constructor + * @param {google.cloud.datacatalog.v1.ICrossRegionalSource=} [properties] Properties to set + */ + function CrossRegionalSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CrossRegionalSource taxonomy. + * @member {string} taxonomy + * @memberof google.cloud.datacatalog.v1.CrossRegionalSource + * @instance + */ + CrossRegionalSource.prototype.taxonomy = ""; + + /** + * Creates a new CrossRegionalSource instance using the specified properties. + * @function create + * @memberof google.cloud.datacatalog.v1.CrossRegionalSource + * @static + * @param {google.cloud.datacatalog.v1.ICrossRegionalSource=} [properties] Properties to set + * @returns {google.cloud.datacatalog.v1.CrossRegionalSource} CrossRegionalSource instance + */ + CrossRegionalSource.create = function create(properties) { + return new CrossRegionalSource(properties); + }; + + /** + * Encodes the specified CrossRegionalSource message. Does not implicitly {@link google.cloud.datacatalog.v1.CrossRegionalSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.datacatalog.v1.CrossRegionalSource + * @static + * @param {google.cloud.datacatalog.v1.ICrossRegionalSource} message CrossRegionalSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CrossRegionalSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.taxonomy != null && Object.hasOwnProperty.call(message, "taxonomy")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.taxonomy); + return writer; + }; + + /** + * Encodes the specified CrossRegionalSource message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.CrossRegionalSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datacatalog.v1.CrossRegionalSource + * @static + * @param {google.cloud.datacatalog.v1.ICrossRegionalSource} message CrossRegionalSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CrossRegionalSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CrossRegionalSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datacatalog.v1.CrossRegionalSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datacatalog.v1.CrossRegionalSource} CrossRegionalSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CrossRegionalSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datacatalog.v1.CrossRegionalSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.taxonomy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CrossRegionalSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datacatalog.v1.CrossRegionalSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datacatalog.v1.CrossRegionalSource} CrossRegionalSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CrossRegionalSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CrossRegionalSource message. + * @function verify + * @memberof google.cloud.datacatalog.v1.CrossRegionalSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CrossRegionalSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.taxonomy != null && message.hasOwnProperty("taxonomy")) + if (!$util.isString(message.taxonomy)) + return "taxonomy: string expected"; + return null; + }; + + /** + * Creates a CrossRegionalSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datacatalog.v1.CrossRegionalSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datacatalog.v1.CrossRegionalSource} CrossRegionalSource + */ + CrossRegionalSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datacatalog.v1.CrossRegionalSource) + return object; + var message = new $root.google.cloud.datacatalog.v1.CrossRegionalSource(); + if (object.taxonomy != null) + message.taxonomy = String(object.taxonomy); + return message; + }; + + /** + * Creates a plain object from a CrossRegionalSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datacatalog.v1.CrossRegionalSource + * @static + * @param {google.cloud.datacatalog.v1.CrossRegionalSource} message CrossRegionalSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CrossRegionalSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.taxonomy = ""; + if (message.taxonomy != null && message.hasOwnProperty("taxonomy")) + object.taxonomy = message.taxonomy; + return object; + }; + + /** + * Converts this CrossRegionalSource to JSON. + * @function toJSON + * @memberof google.cloud.datacatalog.v1.CrossRegionalSource + * @instance + * @returns {Object.} JSON object + */ + CrossRegionalSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CrossRegionalSource; + })(); + + v1.ImportTaxonomiesResponse = (function() { + + /** + * Properties of an ImportTaxonomiesResponse. + * @memberof google.cloud.datacatalog.v1 + * @interface IImportTaxonomiesResponse + * @property {Array.|null} [taxonomies] ImportTaxonomiesResponse taxonomies + */ + + /** + * Constructs a new ImportTaxonomiesResponse. + * @memberof google.cloud.datacatalog.v1 + * @classdesc Represents an ImportTaxonomiesResponse. + * @implements IImportTaxonomiesResponse + * @constructor + * @param {google.cloud.datacatalog.v1.IImportTaxonomiesResponse=} [properties] Properties to set + */ + function ImportTaxonomiesResponse(properties) { + this.taxonomies = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportTaxonomiesResponse taxonomies. + * @member {Array.} taxonomies + * @memberof google.cloud.datacatalog.v1.ImportTaxonomiesResponse + * @instance + */ + ImportTaxonomiesResponse.prototype.taxonomies = $util.emptyArray; + + /** + * Creates a new ImportTaxonomiesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.datacatalog.v1.ImportTaxonomiesResponse + * @static + * @param {google.cloud.datacatalog.v1.IImportTaxonomiesResponse=} [properties] Properties to set + * @returns {google.cloud.datacatalog.v1.ImportTaxonomiesResponse} ImportTaxonomiesResponse instance + */ + ImportTaxonomiesResponse.create = function create(properties) { + return new ImportTaxonomiesResponse(properties); + }; + + /** + * Encodes the specified ImportTaxonomiesResponse message. Does not implicitly {@link google.cloud.datacatalog.v1.ImportTaxonomiesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.datacatalog.v1.ImportTaxonomiesResponse + * @static + * @param {google.cloud.datacatalog.v1.IImportTaxonomiesResponse} message ImportTaxonomiesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportTaxonomiesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.taxonomies != null && message.taxonomies.length) + for (var i = 0; i < message.taxonomies.length; ++i) + $root.google.cloud.datacatalog.v1.Taxonomy.encode(message.taxonomies[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportTaxonomiesResponse message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.ImportTaxonomiesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datacatalog.v1.ImportTaxonomiesResponse + * @static + * @param {google.cloud.datacatalog.v1.IImportTaxonomiesResponse} message ImportTaxonomiesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportTaxonomiesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportTaxonomiesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datacatalog.v1.ImportTaxonomiesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datacatalog.v1.ImportTaxonomiesResponse} ImportTaxonomiesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportTaxonomiesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datacatalog.v1.ImportTaxonomiesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.taxonomies && message.taxonomies.length)) + message.taxonomies = []; + message.taxonomies.push($root.google.cloud.datacatalog.v1.Taxonomy.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportTaxonomiesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datacatalog.v1.ImportTaxonomiesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datacatalog.v1.ImportTaxonomiesResponse} ImportTaxonomiesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportTaxonomiesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportTaxonomiesResponse message. + * @function verify + * @memberof google.cloud.datacatalog.v1.ImportTaxonomiesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportTaxonomiesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.taxonomies != null && message.hasOwnProperty("taxonomies")) { + if (!Array.isArray(message.taxonomies)) + return "taxonomies: array expected"; + for (var i = 0; i < message.taxonomies.length; ++i) { + var error = $root.google.cloud.datacatalog.v1.Taxonomy.verify(message.taxonomies[i]); + if (error) + return "taxonomies." + error; + } + } + return null; + }; + + /** + * Creates an ImportTaxonomiesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datacatalog.v1.ImportTaxonomiesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datacatalog.v1.ImportTaxonomiesResponse} ImportTaxonomiesResponse + */ + ImportTaxonomiesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datacatalog.v1.ImportTaxonomiesResponse) + return object; + var message = new $root.google.cloud.datacatalog.v1.ImportTaxonomiesResponse(); + if (object.taxonomies) { + if (!Array.isArray(object.taxonomies)) + throw TypeError(".google.cloud.datacatalog.v1.ImportTaxonomiesResponse.taxonomies: array expected"); + message.taxonomies = []; + for (var i = 0; i < object.taxonomies.length; ++i) { + if (typeof object.taxonomies[i] !== "object") + throw TypeError(".google.cloud.datacatalog.v1.ImportTaxonomiesResponse.taxonomies: object expected"); + message.taxonomies[i] = $root.google.cloud.datacatalog.v1.Taxonomy.fromObject(object.taxonomies[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ImportTaxonomiesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datacatalog.v1.ImportTaxonomiesResponse + * @static + * @param {google.cloud.datacatalog.v1.ImportTaxonomiesResponse} message ImportTaxonomiesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportTaxonomiesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.taxonomies = []; + if (message.taxonomies && message.taxonomies.length) { + object.taxonomies = []; + for (var j = 0; j < message.taxonomies.length; ++j) + object.taxonomies[j] = $root.google.cloud.datacatalog.v1.Taxonomy.toObject(message.taxonomies[j], options); + } + return object; + }; + + /** + * Converts this ImportTaxonomiesResponse to JSON. + * @function toJSON + * @memberof google.cloud.datacatalog.v1.ImportTaxonomiesResponse + * @instance + * @returns {Object.} JSON object + */ + ImportTaxonomiesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImportTaxonomiesResponse; + })(); + + v1.ExportTaxonomiesRequest = (function() { + + /** + * Properties of an ExportTaxonomiesRequest. + * @memberof google.cloud.datacatalog.v1 + * @interface IExportTaxonomiesRequest + * @property {string|null} [parent] ExportTaxonomiesRequest parent + * @property {Array.|null} [taxonomies] ExportTaxonomiesRequest taxonomies + * @property {boolean|null} [serializedTaxonomies] ExportTaxonomiesRequest serializedTaxonomies + */ + + /** + * Constructs a new ExportTaxonomiesRequest. + * @memberof google.cloud.datacatalog.v1 + * @classdesc Represents an ExportTaxonomiesRequest. + * @implements IExportTaxonomiesRequest + * @constructor + * @param {google.cloud.datacatalog.v1.IExportTaxonomiesRequest=} [properties] Properties to set + */ + function ExportTaxonomiesRequest(properties) { + this.taxonomies = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportTaxonomiesRequest parent. + * @member {string} parent + * @memberof google.cloud.datacatalog.v1.ExportTaxonomiesRequest + * @instance + */ + ExportTaxonomiesRequest.prototype.parent = ""; + + /** + * ExportTaxonomiesRequest taxonomies. + * @member {Array.} taxonomies + * @memberof google.cloud.datacatalog.v1.ExportTaxonomiesRequest + * @instance + */ + ExportTaxonomiesRequest.prototype.taxonomies = $util.emptyArray; + + /** + * ExportTaxonomiesRequest serializedTaxonomies. + * @member {boolean} serializedTaxonomies + * @memberof google.cloud.datacatalog.v1.ExportTaxonomiesRequest + * @instance + */ + ExportTaxonomiesRequest.prototype.serializedTaxonomies = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportTaxonomiesRequest destination. + * @member {"serializedTaxonomies"|undefined} destination + * @memberof google.cloud.datacatalog.v1.ExportTaxonomiesRequest + * @instance + */ + Object.defineProperty(ExportTaxonomiesRequest.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["serializedTaxonomies"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportTaxonomiesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datacatalog.v1.ExportTaxonomiesRequest + * @static + * @param {google.cloud.datacatalog.v1.IExportTaxonomiesRequest=} [properties] Properties to set + * @returns {google.cloud.datacatalog.v1.ExportTaxonomiesRequest} ExportTaxonomiesRequest instance + */ + ExportTaxonomiesRequest.create = function create(properties) { + return new ExportTaxonomiesRequest(properties); + }; + + /** + * Encodes the specified ExportTaxonomiesRequest message. Does not implicitly {@link google.cloud.datacatalog.v1.ExportTaxonomiesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datacatalog.v1.ExportTaxonomiesRequest + * @static + * @param {google.cloud.datacatalog.v1.IExportTaxonomiesRequest} message ExportTaxonomiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportTaxonomiesRequest.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.taxonomies != null && message.taxonomies.length) + for (var i = 0; i < message.taxonomies.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.taxonomies[i]); + if (message.serializedTaxonomies != null && Object.hasOwnProperty.call(message, "serializedTaxonomies")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.serializedTaxonomies); + return writer; + }; + + /** + * Encodes the specified ExportTaxonomiesRequest message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.ExportTaxonomiesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datacatalog.v1.ExportTaxonomiesRequest + * @static + * @param {google.cloud.datacatalog.v1.IExportTaxonomiesRequest} message ExportTaxonomiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportTaxonomiesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportTaxonomiesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datacatalog.v1.ExportTaxonomiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datacatalog.v1.ExportTaxonomiesRequest} ExportTaxonomiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportTaxonomiesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datacatalog.v1.ExportTaxonomiesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + if (!(message.taxonomies && message.taxonomies.length)) + message.taxonomies = []; + message.taxonomies.push(reader.string()); + break; + case 3: + message.serializedTaxonomies = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportTaxonomiesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datacatalog.v1.ExportTaxonomiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datacatalog.v1.ExportTaxonomiesRequest} ExportTaxonomiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportTaxonomiesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportTaxonomiesRequest message. + * @function verify + * @memberof google.cloud.datacatalog.v1.ExportTaxonomiesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportTaxonomiesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.taxonomies != null && message.hasOwnProperty("taxonomies")) { + if (!Array.isArray(message.taxonomies)) + return "taxonomies: array expected"; + for (var i = 0; i < message.taxonomies.length; ++i) + if (!$util.isString(message.taxonomies[i])) + return "taxonomies: string[] expected"; + } + if (message.serializedTaxonomies != null && message.hasOwnProperty("serializedTaxonomies")) { + properties.destination = 1; + if (typeof message.serializedTaxonomies !== "boolean") + return "serializedTaxonomies: boolean expected"; + } + return null; + }; + + /** + * Creates an ExportTaxonomiesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datacatalog.v1.ExportTaxonomiesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datacatalog.v1.ExportTaxonomiesRequest} ExportTaxonomiesRequest + */ + ExportTaxonomiesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datacatalog.v1.ExportTaxonomiesRequest) + return object; + var message = new $root.google.cloud.datacatalog.v1.ExportTaxonomiesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.taxonomies) { + if (!Array.isArray(object.taxonomies)) + throw TypeError(".google.cloud.datacatalog.v1.ExportTaxonomiesRequest.taxonomies: array expected"); + message.taxonomies = []; + for (var i = 0; i < object.taxonomies.length; ++i) + message.taxonomies[i] = String(object.taxonomies[i]); + } + if (object.serializedTaxonomies != null) + message.serializedTaxonomies = Boolean(object.serializedTaxonomies); + return message; + }; + + /** + * Creates a plain object from an ExportTaxonomiesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datacatalog.v1.ExportTaxonomiesRequest + * @static + * @param {google.cloud.datacatalog.v1.ExportTaxonomiesRequest} message ExportTaxonomiesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportTaxonomiesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.taxonomies = []; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.taxonomies && message.taxonomies.length) { + object.taxonomies = []; + for (var j = 0; j < message.taxonomies.length; ++j) + object.taxonomies[j] = message.taxonomies[j]; + } + if (message.serializedTaxonomies != null && message.hasOwnProperty("serializedTaxonomies")) { + object.serializedTaxonomies = message.serializedTaxonomies; + if (options.oneofs) + object.destination = "serializedTaxonomies"; + } + return object; + }; + + /** + * Converts this ExportTaxonomiesRequest to JSON. + * @function toJSON + * @memberof google.cloud.datacatalog.v1.ExportTaxonomiesRequest + * @instance + * @returns {Object.} JSON object + */ + ExportTaxonomiesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExportTaxonomiesRequest; + })(); + + v1.ExportTaxonomiesResponse = (function() { + + /** + * Properties of an ExportTaxonomiesResponse. + * @memberof google.cloud.datacatalog.v1 + * @interface IExportTaxonomiesResponse + * @property {Array.|null} [taxonomies] ExportTaxonomiesResponse taxonomies + */ + + /** + * Constructs a new ExportTaxonomiesResponse. + * @memberof google.cloud.datacatalog.v1 + * @classdesc Represents an ExportTaxonomiesResponse. + * @implements IExportTaxonomiesResponse + * @constructor + * @param {google.cloud.datacatalog.v1.IExportTaxonomiesResponse=} [properties] Properties to set + */ + function ExportTaxonomiesResponse(properties) { + this.taxonomies = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportTaxonomiesResponse taxonomies. + * @member {Array.} taxonomies + * @memberof google.cloud.datacatalog.v1.ExportTaxonomiesResponse + * @instance + */ + ExportTaxonomiesResponse.prototype.taxonomies = $util.emptyArray; + + /** + * Creates a new ExportTaxonomiesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.datacatalog.v1.ExportTaxonomiesResponse + * @static + * @param {google.cloud.datacatalog.v1.IExportTaxonomiesResponse=} [properties] Properties to set + * @returns {google.cloud.datacatalog.v1.ExportTaxonomiesResponse} ExportTaxonomiesResponse instance + */ + ExportTaxonomiesResponse.create = function create(properties) { + return new ExportTaxonomiesResponse(properties); + }; + + /** + * Encodes the specified ExportTaxonomiesResponse message. Does not implicitly {@link google.cloud.datacatalog.v1.ExportTaxonomiesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.datacatalog.v1.ExportTaxonomiesResponse + * @static + * @param {google.cloud.datacatalog.v1.IExportTaxonomiesResponse} message ExportTaxonomiesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportTaxonomiesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.taxonomies != null && message.taxonomies.length) + for (var i = 0; i < message.taxonomies.length; ++i) + $root.google.cloud.datacatalog.v1.SerializedTaxonomy.encode(message.taxonomies[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportTaxonomiesResponse message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.ExportTaxonomiesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datacatalog.v1.ExportTaxonomiesResponse + * @static + * @param {google.cloud.datacatalog.v1.IExportTaxonomiesResponse} message ExportTaxonomiesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportTaxonomiesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportTaxonomiesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datacatalog.v1.ExportTaxonomiesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datacatalog.v1.ExportTaxonomiesResponse} ExportTaxonomiesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportTaxonomiesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datacatalog.v1.ExportTaxonomiesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.taxonomies && message.taxonomies.length)) + message.taxonomies = []; + message.taxonomies.push($root.google.cloud.datacatalog.v1.SerializedTaxonomy.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportTaxonomiesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datacatalog.v1.ExportTaxonomiesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datacatalog.v1.ExportTaxonomiesResponse} ExportTaxonomiesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportTaxonomiesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportTaxonomiesResponse message. + * @function verify + * @memberof google.cloud.datacatalog.v1.ExportTaxonomiesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportTaxonomiesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.taxonomies != null && message.hasOwnProperty("taxonomies")) { + if (!Array.isArray(message.taxonomies)) + return "taxonomies: array expected"; + for (var i = 0; i < message.taxonomies.length; ++i) { + var error = $root.google.cloud.datacatalog.v1.SerializedTaxonomy.verify(message.taxonomies[i]); + if (error) + return "taxonomies." + error; + } + } + return null; + }; + + /** + * Creates an ExportTaxonomiesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datacatalog.v1.ExportTaxonomiesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datacatalog.v1.ExportTaxonomiesResponse} ExportTaxonomiesResponse + */ + ExportTaxonomiesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datacatalog.v1.ExportTaxonomiesResponse) + return object; + var message = new $root.google.cloud.datacatalog.v1.ExportTaxonomiesResponse(); + if (object.taxonomies) { + if (!Array.isArray(object.taxonomies)) + throw TypeError(".google.cloud.datacatalog.v1.ExportTaxonomiesResponse.taxonomies: array expected"); + message.taxonomies = []; + for (var i = 0; i < object.taxonomies.length; ++i) { + if (typeof object.taxonomies[i] !== "object") + throw TypeError(".google.cloud.datacatalog.v1.ExportTaxonomiesResponse.taxonomies: object expected"); + message.taxonomies[i] = $root.google.cloud.datacatalog.v1.SerializedTaxonomy.fromObject(object.taxonomies[i]); + } } return message; }; /** - * Creates a plain object from a FieldType message. Also converts values to other types if specified. + * Creates a plain object from an ExportTaxonomiesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.datacatalog.v1.FieldType + * @memberof google.cloud.datacatalog.v1.ExportTaxonomiesResponse * @static - * @param {google.cloud.datacatalog.v1.FieldType} message FieldType + * @param {google.cloud.datacatalog.v1.ExportTaxonomiesResponse} message ExportTaxonomiesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FieldType.toObject = function toObject(message, options) { + ExportTaxonomiesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.primitiveType != null && message.hasOwnProperty("primitiveType")) { - object.primitiveType = options.enums === String ? $root.google.cloud.datacatalog.v1.FieldType.PrimitiveType[message.primitiveType] : message.primitiveType; - if (options.oneofs) - object.typeDecl = "primitiveType"; - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - object.enumType = $root.google.cloud.datacatalog.v1.FieldType.EnumType.toObject(message.enumType, options); - if (options.oneofs) - object.typeDecl = "enumType"; + if (options.arrays || options.defaults) + object.taxonomies = []; + if (message.taxonomies && message.taxonomies.length) { + object.taxonomies = []; + for (var j = 0; j < message.taxonomies.length; ++j) + object.taxonomies[j] = $root.google.cloud.datacatalog.v1.SerializedTaxonomy.toObject(message.taxonomies[j], options); } return object; }; /** - * Converts this FieldType to JSON. + * Converts this ExportTaxonomiesResponse to JSON. * @function toJSON - * @memberof google.cloud.datacatalog.v1.FieldType + * @memberof google.cloud.datacatalog.v1.ExportTaxonomiesResponse * @instance * @returns {Object.} JSON object */ - FieldType.prototype.toJSON = function toJSON() { + ExportTaxonomiesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - FieldType.EnumType = (function() { - - /** - * Properties of an EnumType. - * @memberof google.cloud.datacatalog.v1.FieldType - * @interface IEnumType - * @property {Array.|null} [allowedValues] EnumType allowedValues - */ - - /** - * Constructs a new EnumType. - * @memberof google.cloud.datacatalog.v1.FieldType - * @classdesc Represents an EnumType. - * @implements IEnumType - * @constructor - * @param {google.cloud.datacatalog.v1.FieldType.IEnumType=} [properties] Properties to set - */ - function EnumType(properties) { - this.allowedValues = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumType allowedValues. - * @member {Array.} allowedValues - * @memberof google.cloud.datacatalog.v1.FieldType.EnumType - * @instance - */ - EnumType.prototype.allowedValues = $util.emptyArray; - - /** - * Creates a new EnumType instance using the specified properties. - * @function create - * @memberof google.cloud.datacatalog.v1.FieldType.EnumType - * @static - * @param {google.cloud.datacatalog.v1.FieldType.IEnumType=} [properties] Properties to set - * @returns {google.cloud.datacatalog.v1.FieldType.EnumType} EnumType instance - */ - EnumType.create = function create(properties) { - return new EnumType(properties); - }; - - /** - * Encodes the specified EnumType message. Does not implicitly {@link google.cloud.datacatalog.v1.FieldType.EnumType.verify|verify} messages. - * @function encode - * @memberof google.cloud.datacatalog.v1.FieldType.EnumType - * @static - * @param {google.cloud.datacatalog.v1.FieldType.IEnumType} message EnumType message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumType.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowedValues != null && message.allowedValues.length) - for (var i = 0; i < message.allowedValues.length; ++i) - $root.google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue.encode(message.allowedValues[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumType message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.FieldType.EnumType.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.datacatalog.v1.FieldType.EnumType - * @static - * @param {google.cloud.datacatalog.v1.FieldType.IEnumType} message EnumType message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumType.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumType message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.datacatalog.v1.FieldType.EnumType - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.datacatalog.v1.FieldType.EnumType} EnumType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumType.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datacatalog.v1.FieldType.EnumType(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.allowedValues && message.allowedValues.length)) - message.allowedValues = []; - message.allowedValues.push($root.google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumType message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.datacatalog.v1.FieldType.EnumType - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.datacatalog.v1.FieldType.EnumType} EnumType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumType.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumType message. - * @function verify - * @memberof google.cloud.datacatalog.v1.FieldType.EnumType - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumType.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowedValues != null && message.hasOwnProperty("allowedValues")) { - if (!Array.isArray(message.allowedValues)) - return "allowedValues: array expected"; - for (var i = 0; i < message.allowedValues.length; ++i) { - var error = $root.google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue.verify(message.allowedValues[i]); - if (error) - return "allowedValues." + error; - } - } - return null; - }; - - /** - * Creates an EnumType message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.datacatalog.v1.FieldType.EnumType - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.datacatalog.v1.FieldType.EnumType} EnumType - */ - EnumType.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.datacatalog.v1.FieldType.EnumType) - return object; - var message = new $root.google.cloud.datacatalog.v1.FieldType.EnumType(); - if (object.allowedValues) { - if (!Array.isArray(object.allowedValues)) - throw TypeError(".google.cloud.datacatalog.v1.FieldType.EnumType.allowedValues: array expected"); - message.allowedValues = []; - for (var i = 0; i < object.allowedValues.length; ++i) { - if (typeof object.allowedValues[i] !== "object") - throw TypeError(".google.cloud.datacatalog.v1.FieldType.EnumType.allowedValues: object expected"); - message.allowedValues[i] = $root.google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue.fromObject(object.allowedValues[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumType message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.datacatalog.v1.FieldType.EnumType - * @static - * @param {google.cloud.datacatalog.v1.FieldType.EnumType} message EnumType - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumType.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.allowedValues = []; - if (message.allowedValues && message.allowedValues.length) { - object.allowedValues = []; - for (var j = 0; j < message.allowedValues.length; ++j) - object.allowedValues[j] = $root.google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue.toObject(message.allowedValues[j], options); - } - return object; - }; - - /** - * Converts this EnumType to JSON. - * @function toJSON - * @memberof google.cloud.datacatalog.v1.FieldType.EnumType - * @instance - * @returns {Object.} JSON object - */ - EnumType.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - EnumType.EnumValue = (function() { - - /** - * Properties of an EnumValue. - * @memberof google.cloud.datacatalog.v1.FieldType.EnumType - * @interface IEnumValue - * @property {string|null} [displayName] EnumValue displayName - */ - - /** - * Constructs a new EnumValue. - * @memberof google.cloud.datacatalog.v1.FieldType.EnumType - * @classdesc Represents an EnumValue. - * @implements IEnumValue - * @constructor - * @param {google.cloud.datacatalog.v1.FieldType.EnumType.IEnumValue=} [properties] Properties to set - */ - function EnumValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValue displayName. - * @member {string} displayName - * @memberof google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue - * @instance - */ - EnumValue.prototype.displayName = ""; - - /** - * Creates a new EnumValue instance using the specified properties. - * @function create - * @memberof google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue - * @static - * @param {google.cloud.datacatalog.v1.FieldType.EnumType.IEnumValue=} [properties] Properties to set - * @returns {google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue} EnumValue instance - */ - EnumValue.create = function create(properties) { - return new EnumValue(properties); - }; - - /** - * Encodes the specified EnumValue message. Does not implicitly {@link google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue.verify|verify} messages. - * @function encode - * @memberof google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue - * @static - * @param {google.cloud.datacatalog.v1.FieldType.EnumType.IEnumValue} message EnumValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); - return writer; - }; - - /** - * Encodes the specified EnumValue message, length delimited. Does not implicitly {@link google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue - * @static - * @param {google.cloud.datacatalog.v1.FieldType.EnumType.IEnumValue} message EnumValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValue message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue} EnumValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValue.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.displayName = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue} EnumValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValue message. - * @function verify - * @memberof google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - return null; - }; - - /** - * Creates an EnumValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue} EnumValue - */ - EnumValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue) - return object; - var message = new $root.google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue(); - if (object.displayName != null) - message.displayName = String(object.displayName); - return message; - }; - - /** - * Creates a plain object from an EnumValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue - * @static - * @param {google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue} message EnumValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.displayName = ""; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - return object; - }; - - /** - * Converts this EnumValue to JSON. - * @function toJSON - * @memberof google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue - * @instance - * @returns {Object.} JSON object - */ - EnumValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EnumValue; - })(); - - return EnumType; - })(); - - /** - * PrimitiveType enum. - * @name google.cloud.datacatalog.v1.FieldType.PrimitiveType - * @enum {number} - * @property {number} PRIMITIVE_TYPE_UNSPECIFIED=0 PRIMITIVE_TYPE_UNSPECIFIED value - * @property {number} DOUBLE=1 DOUBLE value - * @property {number} STRING=2 STRING value - * @property {number} BOOL=3 BOOL value - * @property {number} TIMESTAMP=4 TIMESTAMP value - */ - FieldType.PrimitiveType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PRIMITIVE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DOUBLE"] = 1; - values[valuesById[2] = "STRING"] = 2; - values[valuesById[3] = "BOOL"] = 3; - values[valuesById[4] = "TIMESTAMP"] = 4; - return values; - })(); - - return FieldType; + return ExportTaxonomiesResponse; })(); return v1; @@ -31483,6 +38112,30 @@ */ var api = {}; + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + return values; + })(); + api.Http = (function() { /** @@ -32387,30 +39040,6 @@ return CustomHttpPattern; })(); - /** - * FieldBehavior enum. - * @name google.api.FieldBehavior - * @enum {number} - * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value - * @property {number} OPTIONAL=1 OPTIONAL value - * @property {number} REQUIRED=2 REQUIRED value - * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value - * @property {number} INPUT_ONLY=4 INPUT_ONLY value - * @property {number} IMMUTABLE=5 IMMUTABLE value - * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value - */ - api.FieldBehavior = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; - values[valuesById[1] = "OPTIONAL"] = 1; - values[valuesById[2] = "REQUIRED"] = 2; - values[valuesById[3] = "OUTPUT_ONLY"] = 3; - values[valuesById[4] = "INPUT_ONLY"] = 4; - values[valuesById[5] = "IMMUTABLE"] = 5; - values[valuesById[6] = "UNORDERED_LIST"] = 6; - return values; - })(); - api.ResourceDescriptor = (function() { /** diff --git a/packages/google-cloud-datacatalog/protos/protos.json b/packages/google-cloud-datacatalog/protos/protos.json index a461a7cf795..f4c6db79507 100644 --- a/packages/google-cloud-datacatalog/protos/protos.json +++ b/packages/google-cloud-datacatalog/protos/protos.json @@ -14,14 +14,39 @@ "java_multiple_files": true, "java_package": "com.google.cloud.datacatalog.v1", "php_namespace": "Google\\Cloud\\DataCatalog\\V1", - "ruby_package": "Google::Cloud::DataCatalog::V1" + "ruby_package": "Google::Cloud::DataCatalog::V1", + "java_outer_classname": "PolicyTagManagerSerializationProto", + "(google.api.resource_definition).type": "datacatalog.googleapis.com/TagTemplateFieldEnumValue", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/tagTemplates/{tag_template}/fields/{tag_template_field_id}/enumValues/{enum_value_display_name}" }, "nested": { "IntegratedSystem": { "values": { "INTEGRATED_SYSTEM_UNSPECIFIED": 0, "BIGQUERY": 1, - "CLOUD_PUBSUB": 2 + "CLOUD_PUBSUB": 2, + "DATAPROC_METASTORE": 3 + } + }, + "DataSource": { + "fields": { + "service": { + "type": "Service", + "id": 1 + }, + "resource": { + "type": "string", + "id": 2 + } + }, + "nested": { + "Service": { + "values": { + "SERVICE_UNSPECIFIED": 0, + "CLOUD_STORAGE": 1, + "BIGQUERY": 2 + } + } } }, "DataCatalog": { @@ -403,6 +428,26 @@ } ] }, + "RenameTagTemplateFieldEnumValue": { + "requestType": "RenameTagTemplateFieldEnumValueRequest", + "responseType": "TagTemplateField", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/tagTemplates/*/fields/*/enumValues/*}:rename", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,new_enum_value_display_name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/tagTemplates/*/fields/*/enumValues/*}:rename", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,new_enum_value_display_name" + } + ] + }, "DeleteTagTemplateField": { "requestType": "DeleteTagTemplateFieldRequest", "responseType": "google.protobuf.Empty", @@ -621,7 +666,7 @@ "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OPTIONAL" } }, "pageSize": { @@ -869,7 +914,8 @@ "targetName": { "oneof": [ "linkedResource", - "sqlResource" + "sqlResource", + "fullyQualifiedName" ] } }, @@ -881,6 +927,10 @@ "sqlResource": { "type": "string", "id": 3 + }, + "fullyQualifiedName": { + "type": "string", + "id": 5 } } }, @@ -908,6 +958,11 @@ "bigqueryTableSpec", "bigqueryDateShardedSpec" ] + }, + "spec": { + "oneof": [ + "databaseTableSpec" + ] } }, "fields": { @@ -915,6 +970,7 @@ "type": "string", "id": 1, "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", "(google.api.resource_reference).type": "datacatalog.googleapis.com/EntryGroup" } }, @@ -922,6 +978,10 @@ "type": "string", "id": 9 }, + "fullyQualifiedName": { + "type": "string", + "id": 29 + }, "type": { "type": "EntryType", "id": 2 @@ -953,6 +1013,10 @@ "type": "BigQueryDateShardedSpec", "id": 15 }, + "databaseTableSpec": { + "type": "DatabaseTableSpec", + "id": 24 + }, "displayName": { "type": "string", "id": 3 @@ -968,6 +1032,30 @@ "sourceSystemTimestamps": { "type": "SystemTimestamps", "id": 7 + }, + "dataSource": { + "type": "DataSource", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "DatabaseTableSpec": { + "fields": { + "type": { + "type": "TableType", + "id": 1 + } + }, + "nested": { + "TableType": { + "values": { + "TABLE_TYPE_UNSPECIFIED": 0, + "NATIVE": 1, + "EXTERNAL": 2 + } } } }, @@ -1187,6 +1275,25 @@ } } }, + "RenameTagTemplateFieldEnumValueRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datacatalog.googleapis.com/TagTemplateFieldEnumValue" + } + }, + "newEnumValueDisplayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, "DeleteTagTemplateFieldRequest": { "fields": { "name": { @@ -1282,7 +1389,9 @@ "TABLE": 2, "MODEL": 5, "DATA_STREAM": 3, - "FILESET": 4 + "FILESET": 4, + "DATABASE": 7, + "SERVICE": 14 } }, "GcsFilesetSpec": { @@ -1354,10 +1463,7 @@ "columns": { "rule": "repeated", "type": "ColumnSchema", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } + "id": 2 } } }, @@ -1427,6 +1533,10 @@ "type": "string", "id": 4 }, + "modifyTime": { + "type": "google.protobuf.Timestamp", + "id": 7 + }, "integratedSystem": { "type": "IntegratedSystem", "id": 8, @@ -1437,6 +1547,10 @@ "userSpecifiedSystem": { "type": "string", "id": 9 + }, + "fullyQualifiedName": { + "type": "string", + "id": 10 } } }, @@ -1479,7 +1593,8 @@ "values": { "TABLE_SOURCE_TYPE_UNSPECIFIED": 0, "BIGQUERY_VIEW": 2, - "BIGQUERY_TABLE": 5 + "BIGQUERY_TABLE": 5, + "BIGQUERY_MATERIALIZED_VIEW": 7 } }, "ViewSpec": { @@ -1522,227 +1637,949 @@ "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "shardCount": { - "type": "int64", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } + "shardCount": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Tag": { + "options": { + "(google.api.resource).type": "datacatalog.googleapis.com/Tag", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}/tags/{tag}" + }, + "oneofs": { + "scope": { + "oneof": [ + "column" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "template": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "templateDisplayName": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "column": { + "type": "string", + "id": 4 + }, + "fields": { + "keyType": "string", + "type": "TagField", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TagField": { + "oneofs": { + "kind": { + "oneof": [ + "doubleValue", + "stringValue", + "boolValue", + "timestampValue", + "enumValue" + ] + } + }, + "fields": { + "displayName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "doubleValue": { + "type": "double", + "id": 2 + }, + "stringValue": { + "type": "string", + "id": 3 + }, + "boolValue": { + "type": "bool", + "id": 4 + }, + "timestampValue": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "enumValue": { + "type": "EnumValue", + "id": 6 + }, + "order": { + "type": "int32", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "EnumValue": { + "fields": { + "displayName": { + "type": "string", + "id": 1 + } + } + } + } + }, + "TagTemplate": { + "options": { + "(google.api.resource).type": "datacatalog.googleapis.com/TagTemplate", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/tagTemplates/{tag_template}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "fields": { + "keyType": "string", + "type": "TagTemplateField", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TagTemplateField": { + "options": { + "(google.api.resource).type": "datacatalog.googleapis.com/TagTemplateField", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/tagTemplates/{tag_template}/fields/{field}" + }, + "fields": { + "name": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 1 + }, + "type": { + "type": "FieldType", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "isRequired": { + "type": "bool", + "id": 3 + }, + "description": { + "type": "string", + "id": 4 + }, + "order": { + "type": "int32", + "id": 5 + } + } + }, + "FieldType": { + "oneofs": { + "typeDecl": { + "oneof": [ + "primitiveType", + "enumType" + ] + } + }, + "fields": { + "primitiveType": { + "type": "PrimitiveType", + "id": 1 + }, + "enumType": { + "type": "EnumType", + "id": 2 + } + }, + "nested": { + "EnumType": { + "fields": { + "allowedValues": { + "rule": "repeated", + "type": "EnumValue", + "id": 1 + } + }, + "nested": { + "EnumValue": { + "fields": { + "displayName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "PrimitiveType": { + "values": { + "PRIMITIVE_TYPE_UNSPECIFIED": 0, + "DOUBLE": 1, + "STRING": 2, + "BOOL": 3, + "TIMESTAMP": 4 + } + } + } + }, + "PolicyTagManager": { + "options": { + "(google.api.default_host)": "datacatalog.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateTaxonomy": { + "requestType": "CreateTaxonomyRequest", + "responseType": "Taxonomy", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/taxonomies", + "(google.api.http).body": "taxonomy", + "(google.api.method_signature)": "parent,taxonomy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/taxonomies", + "body": "taxonomy" + } + }, + { + "(google.api.method_signature)": "parent,taxonomy" + } + ] + }, + "DeleteTaxonomy": { + "requestType": "DeleteTaxonomyRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/taxonomies/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/taxonomies/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateTaxonomy": { + "requestType": "UpdateTaxonomyRequest", + "responseType": "Taxonomy", + "options": { + "(google.api.http).patch": "/v1/{taxonomy.name=projects/*/locations/*/taxonomies/*}", + "(google.api.http).body": "taxonomy", + "(google.api.method_signature)": "taxonomy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{taxonomy.name=projects/*/locations/*/taxonomies/*}", + "body": "taxonomy" + } + }, + { + "(google.api.method_signature)": "taxonomy" + } + ] + }, + "ListTaxonomies": { + "requestType": "ListTaxonomiesRequest", + "responseType": "ListTaxonomiesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/taxonomies", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/taxonomies" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetTaxonomy": { + "requestType": "GetTaxonomyRequest", + "responseType": "Taxonomy", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/taxonomies/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/taxonomies/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreatePolicyTag": { + "requestType": "CreatePolicyTagRequest", + "responseType": "PolicyTag", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/taxonomies/*}/policyTags", + "(google.api.http).body": "policy_tag", + "(google.api.method_signature)": "parent,policy_tag" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/taxonomies/*}/policyTags", + "body": "policy_tag" + } + }, + { + "(google.api.method_signature)": "parent,policy_tag" + } + ] + }, + "DeletePolicyTag": { + "requestType": "DeletePolicyTagRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/taxonomies/*/policyTags/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/taxonomies/*/policyTags/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdatePolicyTag": { + "requestType": "UpdatePolicyTagRequest", + "responseType": "PolicyTag", + "options": { + "(google.api.http).patch": "/v1/{policy_tag.name=projects/*/locations/*/taxonomies/*/policyTags/*}", + "(google.api.http).body": "policy_tag", + "(google.api.method_signature)": "policy_tag" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{policy_tag.name=projects/*/locations/*/taxonomies/*/policyTags/*}", + "body": "policy_tag" + } + }, + { + "(google.api.method_signature)": "policy_tag" + } + ] + }, + "ListPolicyTags": { + "requestType": "ListPolicyTagsRequest", + "responseType": "ListPolicyTagsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/taxonomies/*}/policyTags", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/taxonomies/*}/policyTags" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetPolicyTag": { + "requestType": "GetPolicyTagRequest", + "responseType": "PolicyTag", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/taxonomies/*/policyTags/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/taxonomies/*/policyTags/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetIamPolicy": { + "requestType": "google.iam.v1.GetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v1/{resource=projects/*/locations/*/taxonomies/*}:getIamPolicy", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{resource=projects/*/locations/*/taxonomies/*/policyTags/*}:getIamPolicy", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=projects/*/locations/*/taxonomies/*}:getIamPolicy", + "body": "*", + "additional_bindings": { + "post": "/v1/{resource=projects/*/locations/*/taxonomies/*/policyTags/*}:getIamPolicy", + "body": "*" + } + } + } + ] + }, + "SetIamPolicy": { + "requestType": "google.iam.v1.SetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v1/{resource=projects/*/locations/*/taxonomies/*}:setIamPolicy", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{resource=projects/*/locations/*/taxonomies/*/policyTags/*}:setIamPolicy", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=projects/*/locations/*/taxonomies/*}:setIamPolicy", + "body": "*", + "additional_bindings": { + "post": "/v1/{resource=projects/*/locations/*/taxonomies/*/policyTags/*}:setIamPolicy", + "body": "*" + } + } + } + ] + }, + "TestIamPermissions": { + "requestType": "google.iam.v1.TestIamPermissionsRequest", + "responseType": "google.iam.v1.TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v1/{resource=projects/*/locations/*/taxonomies/*}:testIamPermissions", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{resource=projects/*/locations/*/taxonomies/*/policyTags/*}:testIamPermissions", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=projects/*/locations/*/taxonomies/*}:testIamPermissions", + "body": "*", + "additional_bindings": { + "post": "/v1/{resource=projects/*/locations/*/taxonomies/*/policyTags/*}:testIamPermissions", + "body": "*" + } + } + } + ] + } + } + }, + "Taxonomy": { + "options": { + "(google.api.resource).type": "datacatalog.googleapis.com/Taxonomy", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/taxonomies/{taxonomy}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "policyTagCount": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "taxonomyTimestamps": { + "type": "SystemTimestamps", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "activatedPolicyTypes": { + "rule": "repeated", + "type": "PolicyType", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "PolicyType": { + "values": { + "POLICY_TYPE_UNSPECIFIED": 0, + "FINE_GRAINED_ACCESS_CONTROL": 1 + } + } + } + }, + "PolicyTag": { + "options": { + "(google.api.resource).type": "datacatalog.googleapis.com/PolicyTag", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/taxonomies/{taxonomy}/policyTags/{policy_tag}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3 + }, + "parentPolicyTag": { + "type": "string", + "id": 4 + }, + "childPolicyTags": { + "rule": "repeated", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "CreateTaxonomyRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "datacatalog.googleapis.com/Taxonomy" + } + }, + "taxonomy": { + "type": "Taxonomy", + "id": 2 + } + } + }, + "DeleteTaxonomyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datacatalog.googleapis.com/Taxonomy" + } + } + } + }, + "UpdateTaxonomyRequest": { + "fields": { + "taxonomy": { + "type": "Taxonomy", + "id": 1 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "ListTaxonomiesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "datacatalog.googleapis.com/Taxonomy" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListTaxonomiesResponse": { + "fields": { + "taxonomies": { + "rule": "repeated", + "type": "Taxonomy", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetTaxonomyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datacatalog.googleapis.com/Taxonomy" + } + } + } + }, + "CreatePolicyTagRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "datacatalog.googleapis.com/PolicyTag" + } + }, + "policyTag": { + "type": "PolicyTag", + "id": 2 + } + } + }, + "DeletePolicyTagRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datacatalog.googleapis.com/PolicyTag" + } + } + } + }, + "UpdatePolicyTagRequest": { + "fields": { + "policyTag": { + "type": "PolicyTag", + "id": 1 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "ListPolicyTagsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "datacatalog.googleapis.com/PolicyTag" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListPolicyTagsResponse": { + "fields": { + "policyTags": { + "rule": "repeated", + "type": "PolicyTag", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetPolicyTagRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datacatalog.googleapis.com/PolicyTag" + } + } + } + }, + "PolicyTagManagerSerialization": { + "options": { + "(google.api.default_host)": "datacatalog.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ImportTaxonomies": { + "requestType": "ImportTaxonomiesRequest", + "responseType": "ImportTaxonomiesResponse", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/taxonomies:import", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/taxonomies:import", + "body": "*" + } + } + ] + }, + "ExportTaxonomies": { + "requestType": "ExportTaxonomiesRequest", + "responseType": "ExportTaxonomiesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/taxonomies:export" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/taxonomies:export" + } + } + ] + } + } + }, + "SerializedTaxonomy": { + "fields": { + "displayName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 2 + }, + "policyTags": { + "rule": "repeated", + "type": "SerializedPolicyTag", + "id": 3 + }, + "activatedPolicyTypes": { + "rule": "repeated", + "type": "Taxonomy.PolicyType", + "id": 4 } } }, - "Tag": { - "options": { - "(google.api.resource).type": "datacatalog.googleapis.com/Tag", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}/tags/{tag}" - }, - "oneofs": { - "scope": { - "oneof": [ - "column" - ] - } - }, + "SerializedPolicyTag": { "fields": { - "name": { + "policyTag": { "type": "string", "id": 1 }, - "template": { + "displayName": { "type": "string", "id": 2, "options": { "(google.api.field_behavior)": "REQUIRED" } }, - "templateDisplayName": { + "description": { "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } + "id": 3 }, - "column": { - "type": "string", + "childPolicyTags": { + "rule": "repeated", + "type": "SerializedPolicyTag", "id": 4 - }, - "fields": { - "keyType": "string", - "type": "TagField", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } } } }, - "TagField": { + "ImportTaxonomiesRequest": { "oneofs": { - "kind": { + "source": { "oneof": [ - "doubleValue", - "stringValue", - "boolValue", - "timestampValue", - "enumValue" + "inlineSource", + "crossRegionalSource" ] } }, "fields": { - "displayName": { + "parent": { "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "datacatalog.googleapis.com/Taxonomy" } }, - "doubleValue": { - "type": "double", + "inlineSource": { + "type": "InlineSource", "id": 2 }, - "stringValue": { - "type": "string", + "crossRegionalSource": { + "type": "CrossRegionalSource", "id": 3 - }, - "boolValue": { - "type": "bool", - "id": 4 - }, - "timestampValue": { - "type": "google.protobuf.Timestamp", - "id": 5 - }, - "enumValue": { - "type": "EnumValue", - "id": 6 - }, - "order": { - "type": "int32", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } } - }, - "nested": { - "EnumValue": { - "fields": { - "displayName": { - "type": "string", - "id": 1 - } + } + }, + "InlineSource": { + "fields": { + "taxonomies": { + "rule": "repeated", + "type": "SerializedTaxonomy", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" } } } }, - "TagTemplate": { - "options": { - "(google.api.resource).type": "datacatalog.googleapis.com/TagTemplate", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/tagTemplates/{tag_template}" - }, + "CrossRegionalSource": { "fields": { - "name": { - "type": "string", - "id": 1 - }, - "displayName": { + "taxonomy": { "type": "string", - "id": 2 - }, - "fields": { - "keyType": "string", - "type": "TagTemplateField", - "id": 3, + "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datacatalog.googleapis.com/Taxonomy" } } } }, - "TagTemplateField": { - "options": { - "(google.api.resource).type": "datacatalog.googleapis.com/TagTemplateField", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/tagTemplates/{tag_template}/fields/{field}" + "ImportTaxonomiesResponse": { + "fields": { + "taxonomies": { + "rule": "repeated", + "type": "Taxonomy", + "id": 1 + } + } + }, + "ExportTaxonomiesRequest": { + "oneofs": { + "destination": { + "oneof": [ + "serializedTaxonomies" + ] + } }, "fields": { - "name": { + "parent": { "type": "string", - "id": 6, + "id": 1, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "datacatalog.googleapis.com/Taxonomy" } }, - "displayName": { + "taxonomies": { + "rule": "repeated", "type": "string", - "id": 1 - }, - "type": { - "type": "FieldType", "id": 2, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datacatalog.googleapis.com/Taxonomy" } }, - "isRequired": { + "serializedTaxonomies": { "type": "bool", "id": 3 - }, - "order": { - "type": "int32", - "id": 5 } } }, - "FieldType": { - "oneofs": { - "typeDecl": { - "oneof": [ - "primitiveType", - "enumType" - ] - } - }, + "ExportTaxonomiesResponse": { "fields": { - "primitiveType": { - "type": "PrimitiveType", + "taxonomies": { + "rule": "repeated", + "type": "SerializedTaxonomy", "id": 1 - }, - "enumType": { - "type": "EnumType", - "id": 2 - } - }, - "nested": { - "EnumType": { - "fields": { - "allowedValues": { - "rule": "repeated", - "type": "EnumValue", - "id": 1 - } - }, - "nested": { - "EnumValue": { - "fields": { - "displayName": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - } - } - }, - "PrimitiveType": { - "values": { - "PRIMITIVE_TYPE_UNSPECIFIED": 0, - "DOUBLE": 1, - "STRING": 2, - "BOOL": 3, - "TIMESTAMP": 4 - } } } } @@ -4154,6 +4991,23 @@ "cc_enable_arenas": true }, "nested": { + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6 + } + }, "http": { "type": "HttpRule", "id": 72295728, @@ -4257,23 +5111,6 @@ "id": 1050, "extend": "google.protobuf.ServiceOptions" }, - "fieldBehavior": { - "rule": "repeated", - "type": "google.api.FieldBehavior", - "id": 1052, - "extend": "google.protobuf.FieldOptions" - }, - "FieldBehavior": { - "values": { - "FIELD_BEHAVIOR_UNSPECIFIED": 0, - "OPTIONAL": 1, - "REQUIRED": 2, - "OUTPUT_ONLY": 3, - "INPUT_ONLY": 4, - "IMMUTABLE": 5, - "UNORDERED_LIST": 6 - } - }, "resourceReference": { "type": "google.api.ResourceReference", "id": 1055, diff --git a/packages/google-cloud-datacatalog/src/index.ts b/packages/google-cloud-datacatalog/src/index.ts index 71ebd84dd04..860dc65a893 100644 --- a/packages/google-cloud-datacatalog/src/index.ts +++ b/packages/google-cloud-datacatalog/src/index.ts @@ -21,11 +21,12 @@ import * as v1beta1 from './v1beta1'; const DataCatalogClient = v1.DataCatalogClient; type DataCatalogClient = v1.DataCatalogClient; -const PolicyTagManagerClient = v1beta1.PolicyTagManagerClient; -type PolicyTagManagerClient = v1beta1.PolicyTagManagerClient; +const PolicyTagManagerClient = v1.PolicyTagManagerClient; +type PolicyTagManagerClient = v1.PolicyTagManagerClient; const PolicyTagManagerSerializationClient = - v1beta1.PolicyTagManagerSerializationClient; -type PolicyTagManagerSerializationClient = v1beta1.PolicyTagManagerSerializationClient; + v1.PolicyTagManagerSerializationClient; +type PolicyTagManagerSerializationClient = v1.PolicyTagManagerSerializationClient; + export { v1, v1beta1, diff --git a/packages/google-cloud-datacatalog/src/v1/data_catalog_client.ts b/packages/google-cloud-datacatalog/src/v1/data_catalog_client.ts index 238a9826899..770b1d6fc89 100644 --- a/packages/google-cloud-datacatalog/src/v1/data_catalog_client.ts +++ b/packages/google-cloud-datacatalog/src/v1/data_catalog_client.ts @@ -176,6 +176,9 @@ export class DataCatalogClient { locationPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}' ), + policyTagPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/taxonomies/{taxonomy}/policyTags/{policy_tag}' + ), projectPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}' ), @@ -188,6 +191,12 @@ export class DataCatalogClient { tagTemplateFieldPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/tagTemplates/{tag_template}/fields/{field}' ), + tagTemplateFieldEnumValuePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tagTemplates/{tag_template}/fields/{tag_template_field_id}/enumValues/{enum_value_display_name}' + ), + taxonomyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/taxonomies/{taxonomy}' + ), }; // Some of the methods on this service return "paged" results, @@ -281,6 +290,7 @@ export class DataCatalogClient { 'createTagTemplateField', 'updateTagTemplateField', 'renameTagTemplateField', + 'renameTagTemplateFieldEnumValue', 'deleteTagTemplateField', 'createTag', 'updateTag', @@ -425,16 +435,18 @@ export class DataCatalogClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The name of the project this entry group is in. Example: + * Required. The name of the project this entry group belongs to. Example: * - * * projects/{project_id}/locations/{location} + * `projects/{project_id}/locations/{location}` * - * Note that this EntryGroup and its child resources may not actually be - * stored in the location in this name. + * Note: The entry group itself and its child resources might not be + * stored in the location specified in its name. * @param {string} request.entryGroupId - * Required. The id of the entry group to create. - * The id must begin with a letter or underscore, contain only English - * letters, numbers and underscores, and be at most 64 characters. + * Required. The ID of the entry group to create. + * + * The ID must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and must start with a letter or underscore. + * The maximum size is 64 bytes when encoded in UTF-8. * @param {google.cloud.datacatalog.v1.EntryGroup} request.entryGroup * The entry group to create. Defaults to an empty entry group. * @param {object} [options] @@ -629,8 +641,11 @@ export class DataCatalogClient { * @param {google.cloud.datacatalog.v1.EntryGroup} request.entryGroup * Required. The updated entry group. "name" field must be set. * @param {google.protobuf.FieldMask} request.updateMask - * The fields to update on the entry group. If absent or empty, all modifiable - * fields are updated. + * Names of fields whose values to overwrite on an entry group. + * + * If this parameter is absent or empty, all modifiable fields + * are overwritten. If such fields are non-required and omitted in the + * request body, their values are emptied. * @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. @@ -812,8 +827,8 @@ export class DataCatalogClient { > ): void; /** - * Creates an entry. Only entries of 'FILESET' type or user-specified type can - * be created. + * Creates an entry. Only entries of types 'FILESET', 'CLUSTER', 'DATA_STREAM' + * or with a user-specified type can be created. * * Users should enable the Data Catalog API in the project identified by * the `parent` parameter (see [Data Catalog Resource Project] @@ -825,14 +840,18 @@ export class DataCatalogClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The name of the entry group this entry is in. Example: + * Required. The name of the entry group this entry belongs to. Example: * - * * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id} + * `projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}` * - * Note that this Entry and its child resources may not actually be stored in - * the location in this name. + * Note: The entry itself and its child resources might not be stored in + * the location specified in its name. * @param {string} request.entryId - * Required. The id of the entry to create. + * Required. The ID of the entry to create. + * + * The ID must contain only letters (a-z, A-Z), numbers (0-9), + * and underscores (_). + * The maximum size is 64 bytes when encoded in UTF-8. * @param {google.cloud.datacatalog.v1.Entry} request.entry * Required. The entry to create. * @param {object} [options] @@ -926,26 +945,30 @@ export class DataCatalogClient { * @param {google.cloud.datacatalog.v1.Entry} request.entry * Required. The updated entry. The "name" field must be set. * @param {google.protobuf.FieldMask} request.updateMask - * The fields to update on the entry. If absent or empty, all modifiable - * fields are updated. + * Names of fields whose values to overwrite on an entry. + * + * If this parameter is absent or empty, all modifiable fields + * are overwritten. If such fields are non-required and omitted in the + * request body, their values are emptied. * * The following fields are modifiable: + * * * For entries with type `DATA_STREAM`: * * `schema` - * * For entries with type `FILESET` + * * For entries with type `FILESET`: * * `schema` * * `display_name` * * `description` * * `gcs_fileset_spec` * * `gcs_fileset_spec.file_patterns` - * * For entries with `user_specified_type` + * * For entries with `user_specified_type`: * * `schema` * * `display_name` * * `description` - * * user_specified_type - * * user_specified_system - * * linked_resource - * * source_system_timestamps + * * `user_specified_type` + * * `user_specified_system` + * * `linked_resource` + * * `source_system_timestamps` * @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. @@ -1235,8 +1258,24 @@ export class DataCatalogClient { * * `bigquery.dataset.project_id.dataset_id` * * `datacatalog.entry.project_id.location_id.entry_group_id.entry_id` * - * `*_id`s shoud satisfy the standard SQL rules for identifiers. + * `*_id`s should satisfy the standard SQL rules for identifiers. * https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical. + * @param {string} request.fullyQualifiedName + * Fully qualified name (FQN) of the resource. + * + * FQNs take two forms: + * + * * For non-regionalized resources: + * + * `{SYSTEM}:{PROJECT}.{PATH_TO_RESOURCE_SEPARATED_WITH_DOTS}` + * + * * For regionalized resources: + * + * `{SYSTEM}:{PROJECT}.{LOCATION_ID}.{PATH_TO_RESOURCE_SEPARATED_WITH_DOTS}` + * + * Example for a DPMS table: + * + * `dataproc_metastore:project_id.location_id.instance_id.database_id.table_id` * @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. @@ -1330,7 +1369,11 @@ export class DataCatalogClient { * * * projects/{project_id}/locations/us-central1 * @param {string} request.tagTemplateId - * Required. The id of the tag template to create. + * Required. The ID of the tag template to create. + * + * The ID must contain only lowercase letters (a-z), numbers (0-9), + * or underscores (_), and must start with a letter or underscore. + * The maximum size is 64 bytes when encoded in UTF-8. * @param {google.cloud.datacatalog.v1.TagTemplate} request.tagTemplate * Required. The tag template to create. * @param {object} [options] @@ -1526,13 +1569,12 @@ export class DataCatalogClient { * @param {google.cloud.datacatalog.v1.TagTemplate} request.tagTemplate * Required. The template to update. The "name" field must be set. * @param {google.protobuf.FieldMask} request.updateMask - * The field mask specifies the parts of the template to overwrite. - * - * Allowed fields: + * Names of fields whose values to overwrite on a tag template. Currently, + * only `display_name` can be overwritten. * - * * `display_name` - * - * If absent or empty, all of the allowed fields above will be updated. + * In general, if this parameter is absent or empty, all modifiable fields + * are overwritten. If such fields are non-required and omitted in the + * request body, their values are emptied. * @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. @@ -1741,7 +1783,10 @@ export class DataCatalogClient { * * projects/{project_id}/locations/us-central1/tagTemplates/{tag_template_id} * @param {string} request.tagTemplateFieldId * Required. The ID of the tag template field to create. - * Field ids can contain letters (both uppercase and lowercase), numbers + * + * Note: Adding a required field to an existing template is *not* allowed. + * + * Field IDs can contain letters (both uppercase and lowercase), numbers * (0-9), underscores (_) and dashes (-). Field IDs must be at least 1 * character long and at most 128 characters long. Field IDs must also be * unique within their template. @@ -1858,20 +1903,22 @@ export class DataCatalogClient { * @param {google.cloud.datacatalog.v1.TagTemplateField} request.tagTemplateField * Required. The template to update. * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. The field mask specifies the parts of the template to be updated. - * Allowed fields: + * Optional. Names of fields whose values to overwrite on an individual field of a tag + * template. The following fields are modifiable: * * * `display_name` * * `type.enum_type` * * `is_required` * - * If `update_mask` is not set or empty, all of the allowed fields above will - * be updated. + * If this parameter is absent or empty, all modifiable fields + * are overwritten. If such fields are non-required and omitted in the request + * body, their values are emptied with one exception: when updating an enum + * type, the provided values are merged with the existing values. Therefore, + * enum values can only be added, existing enum values cannot be deleted or + * renamed. * - * When updating an enum type, the provided values will be merged with the - * existing values. Therefore, enum values can only be added, existing enum - * values cannot be deleted nor renamed. Updating a template field from - * optional to required is NOT allowed. + * Additionally, updating a template field from optional to required is + * *not* allowed. * @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. @@ -1981,8 +2028,7 @@ export class DataCatalogClient { * * * projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}/fields/{tag_template_field_id} * @param {string} request.newTagTemplateFieldId - * Required. The new ID of this tag template field. For example, - * `my_new_field`. + * Required. The new ID of this tag template field. For example, `my_new_field`. * @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. @@ -2044,6 +2090,113 @@ export class DataCatalogClient { callback ); } + renameTagTemplateFieldEnumValue( + request: protos.google.cloud.datacatalog.v1.IRenameTagTemplateFieldEnumValueRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datacatalog.v1.ITagTemplateField, + ( + | protos.google.cloud.datacatalog.v1.IRenameTagTemplateFieldEnumValueRequest + | undefined + ), + {} | undefined + ] + >; + renameTagTemplateFieldEnumValue( + request: protos.google.cloud.datacatalog.v1.IRenameTagTemplateFieldEnumValueRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.datacatalog.v1.ITagTemplateField, + | protos.google.cloud.datacatalog.v1.IRenameTagTemplateFieldEnumValueRequest + | null + | undefined, + {} | null | undefined + > + ): void; + renameTagTemplateFieldEnumValue( + request: protos.google.cloud.datacatalog.v1.IRenameTagTemplateFieldEnumValueRequest, + callback: Callback< + protos.google.cloud.datacatalog.v1.ITagTemplateField, + | protos.google.cloud.datacatalog.v1.IRenameTagTemplateFieldEnumValueRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Renames an enum value in a tag template. The enum values have to be unique + * within one enum field. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the enum field value. Example: + * + * * projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}/fields/{tag_template_field_id}/enumValues/{enum_value_display_name} + * @param {string} request.newEnumValueDisplayName + * Required. The new display name of the enum value. For example, `my_new_enum_value`. + * @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 [TagTemplateField]{@link google.cloud.datacatalog.v1.TagTemplateField}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.renameTagTemplateFieldEnumValue(request); + */ + renameTagTemplateFieldEnumValue( + request: protos.google.cloud.datacatalog.v1.IRenameTagTemplateFieldEnumValueRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.datacatalog.v1.ITagTemplateField, + | protos.google.cloud.datacatalog.v1.IRenameTagTemplateFieldEnumValueRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.datacatalog.v1.ITagTemplateField, + | protos.google.cloud.datacatalog.v1.IRenameTagTemplateFieldEnumValueRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.datacatalog.v1.ITagTemplateField, + ( + | protos.google.cloud.datacatalog.v1.IRenameTagTemplateFieldEnumValueRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.renameTagTemplateFieldEnumValue( + request, + options, + callback + ); + } deleteTagTemplateField( request: protos.google.cloud.datacatalog.v1.IDeleteTagTemplateFieldRequest, options?: CallOptions @@ -2195,13 +2348,13 @@ export class DataCatalogClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The name of the resource to attach this tag to. Tags can be - * attached to Entries. Example: + * Required. The name of the resource to attach this tag to. Tags can be attached to + * entries. An entry can have up to 1000 attached tags. Example: * - * * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id} + * `projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}` * - * Note that this Tag and its child resources may not actually be stored in - * the location in this name. + * Note: The tag and its child resources might not be stored in + * the location specified in its name. * @param {google.cloud.datacatalog.v1.Tag} request.tag * Required. The tag to create. * @param {object} [options] @@ -2291,8 +2444,12 @@ export class DataCatalogClient { * @param {google.cloud.datacatalog.v1.Tag} request.tag * Required. The updated tag. The "name" field must be set. * @param {google.protobuf.FieldMask} request.updateMask - * The fields to update on the Tag. If absent or empty, all modifiable fields - * are updated. Currently the only modifiable field is the field `fields`. + * Names of fields whose values to overwrite on a tag. Currently, a tag has + * the only modifiable field with the name `fields`. + * + * In general, if this parameter is absent or empty, all modifiable fields + * are overwritten. If such fields are non-required and omitted in the + * request body, their values are emptied. * @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. @@ -2780,7 +2937,7 @@ export class DataCatalogClient { * This is a custom method * (https://cloud.google.com/apis/design/custom_methods) and does not return * the complete resource, only the resource identifier and high level - * fields. Clients can subsequentally call `Get` methods. + * fields. Clients can subsequently call `Get` methods. * * Note that Data Catalog search queries do not guarantee full recall. Query * results that match your query may not be returned, even in subsequent @@ -2798,9 +2955,9 @@ export class DataCatalogClient { * `include_org_ids`, `include_project_ids` AND false * `include_gcp_public_datasets` is considered invalid. Data Catalog will * return an error in such a case. - * @param {string} request.query - * Required. The query string in search query syntax. The query must be - * non-empty. + * @param {string} [request.query] + * Optional. The query string in search query syntax. An empty query string will result + * in all data assets (in the specified scope) that the user has access to. * * Query strings can be simple as "x" or more qualified as: * @@ -2817,8 +2974,8 @@ export class DataCatalogClient { * for page_size is 1000. Throws an invalid argument for page_size > 1000. * @param {string} [request.pageToken] * Optional. Pagination token returned in an earlier - * {@link google.cloud.datacatalog.v1.SearchCatalogResponse.next_page_token|SearchCatalogResponse.next_page_token}, - * which indicates that this is a continuation of a prior + * {@link google.cloud.datacatalog.v1.SearchCatalogResponse.next_page_token|SearchCatalogResponse.next_page_token}, which + * indicates that this is a continuation of a prior * {@link google.cloud.datacatalog.v1.DataCatalog.SearchCatalog|SearchCatalogRequest} * call, and that the system should return the next page of data. If empty, * the first page is returned. @@ -2891,9 +3048,9 @@ export class DataCatalogClient { * `include_org_ids`, `include_project_ids` AND false * `include_gcp_public_datasets` is considered invalid. Data Catalog will * return an error in such a case. - * @param {string} request.query - * Required. The query string in search query syntax. The query must be - * non-empty. + * @param {string} [request.query] + * Optional. The query string in search query syntax. An empty query string will result + * in all data assets (in the specified scope) that the user has access to. * * Query strings can be simple as "x" or more qualified as: * @@ -2910,8 +3067,8 @@ export class DataCatalogClient { * for page_size is 1000. Throws an invalid argument for page_size > 1000. * @param {string} [request.pageToken] * Optional. Pagination token returned in an earlier - * {@link google.cloud.datacatalog.v1.SearchCatalogResponse.next_page_token|SearchCatalogResponse.next_page_token}, - * which indicates that this is a continuation of a prior + * {@link google.cloud.datacatalog.v1.SearchCatalogResponse.next_page_token|SearchCatalogResponse.next_page_token}, which + * indicates that this is a continuation of a prior * {@link google.cloud.datacatalog.v1.DataCatalog.SearchCatalog|SearchCatalogRequest} * call, and that the system should return the next page of data. If empty, * the first page is returned. @@ -2962,9 +3119,9 @@ export class DataCatalogClient { * `include_org_ids`, `include_project_ids` AND false * `include_gcp_public_datasets` is considered invalid. Data Catalog will * return an error in such a case. - * @param {string} request.query - * Required. The query string in search query syntax. The query must be - * non-empty. + * @param {string} [request.query] + * Optional. The query string in search query syntax. An empty query string will result + * in all data assets (in the specified scope) that the user has access to. * * Query strings can be simple as "x" or more qualified as: * @@ -2981,8 +3138,8 @@ export class DataCatalogClient { * for page_size is 1000. Throws an invalid argument for page_size > 1000. * @param {string} [request.pageToken] * Optional. Pagination token returned in an earlier - * {@link google.cloud.datacatalog.v1.SearchCatalogResponse.next_page_token|SearchCatalogResponse.next_page_token}, - * which indicates that this is a continuation of a prior + * {@link google.cloud.datacatalog.v1.SearchCatalogResponse.next_page_token|SearchCatalogResponse.next_page_token}, which + * indicates that this is a continuation of a prior * {@link google.cloud.datacatalog.v1.DataCatalog.SearchCatalog|SearchCatalogRequest} * call, and that the system should return the next page of data. If empty, * the first page is returned. @@ -3063,16 +3220,16 @@ export class DataCatalogClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The name of the location that contains the entry groups, which - * can be provided in URL format. Example: + * Required. The name of the location that contains the entry groups, which can be + * provided in URL format. Example: * * * projects/{project_id}/locations/{location} * @param {number} [request.pageSize] - * Optional. The maximum number of items to return. Default is 10. Max limit - * is 1000. Throws an invalid argument for `page_size > 1000`. + * Optional. The maximum number of items to return. Default is 10. Max limit is 1000. + * Throws an invalid argument for `page_size > 1000`. * @param {string} [request.pageToken] - * Optional. Token that specifies which page is requested. If empty, the first - * page is returned. + * Optional. Token that specifies which page is requested. If empty, the first page is + * returned. * @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. @@ -3136,16 +3293,16 @@ export class DataCatalogClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The name of the location that contains the entry groups, which - * can be provided in URL format. Example: + * Required. The name of the location that contains the entry groups, which can be + * provided in URL format. Example: * * * projects/{project_id}/locations/{location} * @param {number} [request.pageSize] - * Optional. The maximum number of items to return. Default is 10. Max limit - * is 1000. Throws an invalid argument for `page_size > 1000`. + * Optional. The maximum number of items to return. Default is 10. Max limit is 1000. + * Throws an invalid argument for `page_size > 1000`. * @param {string} [request.pageToken] - * Optional. Token that specifies which page is requested. If empty, the first - * page is returned. + * Optional. Token that specifies which page is requested. If empty, the first page is + * returned. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} @@ -3187,16 +3344,16 @@ export class DataCatalogClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The name of the location that contains the entry groups, which - * can be provided in URL format. Example: + * Required. The name of the location that contains the entry groups, which can be + * provided in URL format. Example: * * * projects/{project_id}/locations/{location} * @param {number} [request.pageSize] - * Optional. The maximum number of items to return. Default is 10. Max limit - * is 1000. Throws an invalid argument for `page_size > 1000`. + * Optional. The maximum number of items to return. Default is 10. Max limit is 1000. + * Throws an invalid argument for `page_size > 1000`. * @param {string} [request.pageToken] - * Optional. Token that specifies which page is requested. If empty, the first - * page is returned. + * Optional. Token that specifies which page is requested. If empty, the first page is + * returned. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} @@ -3492,8 +3649,8 @@ export class DataCatalogClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The name of the Data Catalog resource to list the tags of. The - * resource could be an {@link google.cloud.datacatalog.v1.Entry|Entry} or an + * Required. The name of the Data Catalog resource to list the tags of. The resource + * could be an {@link google.cloud.datacatalog.v1.Entry|Entry} or an * {@link google.cloud.datacatalog.v1.EntryGroup|EntryGroup}. * * Examples: @@ -3566,8 +3723,8 @@ export class DataCatalogClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The name of the Data Catalog resource to list the tags of. The - * resource could be an {@link google.cloud.datacatalog.v1.Entry|Entry} or an + * Required. The name of the Data Catalog resource to list the tags of. The resource + * could be an {@link google.cloud.datacatalog.v1.Entry|Entry} or an * {@link google.cloud.datacatalog.v1.EntryGroup|EntryGroup}. * * Examples: @@ -3620,8 +3777,8 @@ export class DataCatalogClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The name of the Data Catalog resource to list the tags of. The - * resource could be an {@link google.cloud.datacatalog.v1.Entry|Entry} or an + * Required. The name of the Data Catalog resource to list the tags of. The resource + * could be an {@link google.cloud.datacatalog.v1.Entry|Entry} or an * {@link google.cloud.datacatalog.v1.EntryGroup|EntryGroup}. * * Examples: @@ -3830,6 +3987,77 @@ export class DataCatalogClient { return this.pathTemplates.locationPathTemplate.match(locationName).location; } + /** + * Return a fully-qualified policyTag resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} taxonomy + * @param {string} policy_tag + * @returns {string} Resource name string. + */ + policyTagPath( + project: string, + location: string, + taxonomy: string, + policyTag: string + ) { + return this.pathTemplates.policyTagPathTemplate.render({ + project: project, + location: location, + taxonomy: taxonomy, + policy_tag: policyTag, + }); + } + + /** + * Parse the project from PolicyTag resource. + * + * @param {string} policyTagName + * A fully-qualified path representing PolicyTag resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPolicyTagName(policyTagName: string) { + return this.pathTemplates.policyTagPathTemplate.match(policyTagName) + .project; + } + + /** + * Parse the location from PolicyTag resource. + * + * @param {string} policyTagName + * A fully-qualified path representing PolicyTag resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPolicyTagName(policyTagName: string) { + return this.pathTemplates.policyTagPathTemplate.match(policyTagName) + .location; + } + + /** + * Parse the taxonomy from PolicyTag resource. + * + * @param {string} policyTagName + * A fully-qualified path representing PolicyTag resource. + * @returns {string} A string representing the taxonomy. + */ + matchTaxonomyFromPolicyTagName(policyTagName: string) { + return this.pathTemplates.policyTagPathTemplate.match(policyTagName) + .taxonomy; + } + + /** + * Parse the policy_tag from PolicyTag resource. + * + * @param {string} policyTagName + * A fully-qualified path representing PolicyTag resource. + * @returns {string} A string representing the policy_tag. + */ + matchPolicyTagFromPolicyTagName(policyTagName: string) { + return this.pathTemplates.policyTagPathTemplate.match(policyTagName) + .policy_tag; + } + /** * Return a fully-qualified project resource name string. * @@ -4061,6 +4289,156 @@ export class DataCatalogClient { ).field; } + /** + * Return a fully-qualified tagTemplateFieldEnumValue resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tag_template + * @param {string} tag_template_field_id + * @param {string} enum_value_display_name + * @returns {string} Resource name string. + */ + tagTemplateFieldEnumValuePath( + project: string, + location: string, + tagTemplate: string, + tagTemplateFieldId: string, + enumValueDisplayName: string + ) { + return this.pathTemplates.tagTemplateFieldEnumValuePathTemplate.render({ + project: project, + location: location, + tag_template: tagTemplate, + tag_template_field_id: tagTemplateFieldId, + enum_value_display_name: enumValueDisplayName, + }); + } + + /** + * Parse the project from TagTemplateFieldEnumValue resource. + * + * @param {string} tagTemplateFieldEnumValueName + * A fully-qualified path representing TagTemplateFieldEnumValue resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTagTemplateFieldEnumValueName( + tagTemplateFieldEnumValueName: string + ) { + return this.pathTemplates.tagTemplateFieldEnumValuePathTemplate.match( + tagTemplateFieldEnumValueName + ).project; + } + + /** + * Parse the location from TagTemplateFieldEnumValue resource. + * + * @param {string} tagTemplateFieldEnumValueName + * A fully-qualified path representing TagTemplateFieldEnumValue resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTagTemplateFieldEnumValueName( + tagTemplateFieldEnumValueName: string + ) { + return this.pathTemplates.tagTemplateFieldEnumValuePathTemplate.match( + tagTemplateFieldEnumValueName + ).location; + } + + /** + * Parse the tag_template from TagTemplateFieldEnumValue resource. + * + * @param {string} tagTemplateFieldEnumValueName + * A fully-qualified path representing TagTemplateFieldEnumValue resource. + * @returns {string} A string representing the tag_template. + */ + matchTagTemplateFromTagTemplateFieldEnumValueName( + tagTemplateFieldEnumValueName: string + ) { + return this.pathTemplates.tagTemplateFieldEnumValuePathTemplate.match( + tagTemplateFieldEnumValueName + ).tag_template; + } + + /** + * Parse the tag_template_field_id from TagTemplateFieldEnumValue resource. + * + * @param {string} tagTemplateFieldEnumValueName + * A fully-qualified path representing TagTemplateFieldEnumValue resource. + * @returns {string} A string representing the tag_template_field_id. + */ + matchTagTemplateFieldIdFromTagTemplateFieldEnumValueName( + tagTemplateFieldEnumValueName: string + ) { + return this.pathTemplates.tagTemplateFieldEnumValuePathTemplate.match( + tagTemplateFieldEnumValueName + ).tag_template_field_id; + } + + /** + * Parse the enum_value_display_name from TagTemplateFieldEnumValue resource. + * + * @param {string} tagTemplateFieldEnumValueName + * A fully-qualified path representing TagTemplateFieldEnumValue resource. + * @returns {string} A string representing the enum_value_display_name. + */ + matchEnumValueDisplayNameFromTagTemplateFieldEnumValueName( + tagTemplateFieldEnumValueName: string + ) { + return this.pathTemplates.tagTemplateFieldEnumValuePathTemplate.match( + tagTemplateFieldEnumValueName + ).enum_value_display_name; + } + + /** + * Return a fully-qualified taxonomy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} taxonomy + * @returns {string} Resource name string. + */ + taxonomyPath(project: string, location: string, taxonomy: string) { + return this.pathTemplates.taxonomyPathTemplate.render({ + project: project, + location: location, + taxonomy: taxonomy, + }); + } + + /** + * Parse the project from Taxonomy resource. + * + * @param {string} taxonomyName + * A fully-qualified path representing Taxonomy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTaxonomyName(taxonomyName: string) { + return this.pathTemplates.taxonomyPathTemplate.match(taxonomyName).project; + } + + /** + * Parse the location from Taxonomy resource. + * + * @param {string} taxonomyName + * A fully-qualified path representing Taxonomy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTaxonomyName(taxonomyName: string) { + return this.pathTemplates.taxonomyPathTemplate.match(taxonomyName).location; + } + + /** + * Parse the taxonomy from Taxonomy resource. + * + * @param {string} taxonomyName + * A fully-qualified path representing Taxonomy resource. + * @returns {string} A string representing the taxonomy. + */ + matchTaxonomyFromTaxonomyName(taxonomyName: string) { + return this.pathTemplates.taxonomyPathTemplate.match(taxonomyName).taxonomy; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-datacatalog/src/v1/data_catalog_client_config.json b/packages/google-cloud-datacatalog/src/v1/data_catalog_client_config.json index 1c44c4a1df4..04753f5f287 100644 --- a/packages/google-cloud-datacatalog/src/v1/data_catalog_client_config.json +++ b/packages/google-cloud-datacatalog/src/v1/data_catalog_client_config.json @@ -118,6 +118,11 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "RenameTagTemplateFieldEnumValue": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "DeleteTagTemplateField": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", diff --git a/packages/google-cloud-datacatalog/src/v1/data_catalog_proto_list.json b/packages/google-cloud-datacatalog/src/v1/data_catalog_proto_list.json index dc79f844521..dfaea9a6173 100644 --- a/packages/google-cloud-datacatalog/src/v1/data_catalog_proto_list.json +++ b/packages/google-cloud-datacatalog/src/v1/data_catalog_proto_list.json @@ -1,7 +1,10 @@ [ "../../protos/google/cloud/datacatalog/v1/common.proto", + "../../protos/google/cloud/datacatalog/v1/data_source.proto", "../../protos/google/cloud/datacatalog/v1/datacatalog.proto", "../../protos/google/cloud/datacatalog/v1/gcs_fileset_spec.proto", + "../../protos/google/cloud/datacatalog/v1/policytagmanager.proto", + "../../protos/google/cloud/datacatalog/v1/policytagmanagerserialization.proto", "../../protos/google/cloud/datacatalog/v1/schema.proto", "../../protos/google/cloud/datacatalog/v1/search.proto", "../../protos/google/cloud/datacatalog/v1/table_spec.proto", diff --git a/packages/google-cloud-datacatalog/src/v1/gapic_metadata.json b/packages/google-cloud-datacatalog/src/v1/gapic_metadata.json index af97109cb30..1ede223f2b9 100644 --- a/packages/google-cloud-datacatalog/src/v1/gapic_metadata.json +++ b/packages/google-cloud-datacatalog/src/v1/gapic_metadata.json @@ -90,6 +90,11 @@ "renameTagTemplateField" ] }, + "RenameTagTemplateFieldEnumValue": { + "methods": [ + "renameTagTemplateFieldEnumValue" + ] + }, "DeleteTagTemplateField": { "methods": [ "deleteTagTemplateField" @@ -238,6 +243,11 @@ "renameTagTemplateField" ] }, + "RenameTagTemplateFieldEnumValue": { + "methods": [ + "renameTagTemplateFieldEnumValue" + ] + }, "DeleteTagTemplateField": { "methods": [ "deleteTagTemplateField" @@ -304,6 +314,192 @@ } } } + }, + "PolicyTagManager": { + "clients": { + "grpc": { + "libraryClient": "PolicyTagManagerClient", + "rpcs": { + "CreateTaxonomy": { + "methods": [ + "createTaxonomy" + ] + }, + "DeleteTaxonomy": { + "methods": [ + "deleteTaxonomy" + ] + }, + "UpdateTaxonomy": { + "methods": [ + "updateTaxonomy" + ] + }, + "GetTaxonomy": { + "methods": [ + "getTaxonomy" + ] + }, + "CreatePolicyTag": { + "methods": [ + "createPolicyTag" + ] + }, + "DeletePolicyTag": { + "methods": [ + "deletePolicyTag" + ] + }, + "UpdatePolicyTag": { + "methods": [ + "updatePolicyTag" + ] + }, + "GetPolicyTag": { + "methods": [ + "getPolicyTag" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "ListTaxonomies": { + "methods": [ + "listTaxonomies", + "listTaxonomiesStream", + "listTaxonomiesAsync" + ] + }, + "ListPolicyTags": { + "methods": [ + "listPolicyTags", + "listPolicyTagsStream", + "listPolicyTagsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "PolicyTagManagerClient", + "rpcs": { + "CreateTaxonomy": { + "methods": [ + "createTaxonomy" + ] + }, + "DeleteTaxonomy": { + "methods": [ + "deleteTaxonomy" + ] + }, + "UpdateTaxonomy": { + "methods": [ + "updateTaxonomy" + ] + }, + "GetTaxonomy": { + "methods": [ + "getTaxonomy" + ] + }, + "CreatePolicyTag": { + "methods": [ + "createPolicyTag" + ] + }, + "DeletePolicyTag": { + "methods": [ + "deletePolicyTag" + ] + }, + "UpdatePolicyTag": { + "methods": [ + "updatePolicyTag" + ] + }, + "GetPolicyTag": { + "methods": [ + "getPolicyTag" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "ListTaxonomies": { + "methods": [ + "listTaxonomies", + "listTaxonomiesStream", + "listTaxonomiesAsync" + ] + }, + "ListPolicyTags": { + "methods": [ + "listPolicyTags", + "listPolicyTagsStream", + "listPolicyTagsAsync" + ] + } + } + } + } + }, + "PolicyTagManagerSerialization": { + "clients": { + "grpc": { + "libraryClient": "PolicyTagManagerSerializationClient", + "rpcs": { + "ImportTaxonomies": { + "methods": [ + "importTaxonomies" + ] + }, + "ExportTaxonomies": { + "methods": [ + "exportTaxonomies" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "PolicyTagManagerSerializationClient", + "rpcs": { + "ImportTaxonomies": { + "methods": [ + "importTaxonomies" + ] + }, + "ExportTaxonomies": { + "methods": [ + "exportTaxonomies" + ] + } + } + } + } } } } diff --git a/packages/google-cloud-datacatalog/src/v1/index.ts b/packages/google-cloud-datacatalog/src/v1/index.ts index 5851c96e32c..0750c98b2b0 100644 --- a/packages/google-cloud-datacatalog/src/v1/index.ts +++ b/packages/google-cloud-datacatalog/src/v1/index.ts @@ -17,3 +17,5 @@ // ** All changes to this file may be overwritten. ** export {DataCatalogClient} from './data_catalog_client'; +export {PolicyTagManagerClient} from './policy_tag_manager_client'; +export {PolicyTagManagerSerializationClient} from './policy_tag_manager_serialization_client'; diff --git a/packages/google-cloud-datacatalog/src/v1/policy_tag_manager_client.ts b/packages/google-cloud-datacatalog/src/v1/policy_tag_manager_client.ts new file mode 100644 index 00000000000..6bdbc1e57d5 --- /dev/null +++ b/packages/google-cloud-datacatalog/src/v1/policy_tag_manager_client.ts @@ -0,0 +1,2317 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import * as path from 'path'; + +import {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v1/policy_tag_manager_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './policy_tag_manager_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Policy Tag Manager API service allows clients to manage their policy tags and + * taxonomies. + * + * Policy tags are used to tag BigQuery columns and apply additional access + * control policies. A taxonomy is a hierarchical grouping of policy tags that + * classify data along a common axis. + * @class + * @memberof v1 + */ +export class PolicyTagManagerClient { + private _terminated = false; + private _opts: ClientOptions; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + policyTagManagerStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of PolicyTagManagerClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof PolicyTagManagerClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + this._protos = this._gaxGrpc.loadProto( + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + entryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}' + ), + entryGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/entryGroups/{entry_group}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + policyTagPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/taxonomies/{taxonomy}/policyTags/{policy_tag}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + tagPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}/tags/{tag}' + ), + tagTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tagTemplates/{tag_template}' + ), + tagTemplateFieldPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tagTemplates/{tag_template}/fields/{field}' + ), + taxonomyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/taxonomies/{taxonomy}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listTaxonomies: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'taxonomies' + ), + listPolicyTags: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'policyTags' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.datacatalog.v1.PolicyTagManager', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.policyTagManagerStub) { + return this.policyTagManagerStub; + } + + // Put together the "service stub" for + // google.cloud.datacatalog.v1.PolicyTagManager. + this.policyTagManagerStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.datacatalog.v1.PolicyTagManager' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.datacatalog.v1.PolicyTagManager, + this._opts + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const policyTagManagerStubMethods = [ + 'createTaxonomy', + 'deleteTaxonomy', + 'updateTaxonomy', + 'listTaxonomies', + 'getTaxonomy', + 'createPolicyTag', + 'deletePolicyTag', + 'updatePolicyTag', + 'listPolicyTags', + 'getPolicyTag', + 'getIamPolicy', + 'setIamPolicy', + 'testIamPermissions', + ]; + for (const methodName of policyTagManagerStubMethods) { + const callPromise = this.policyTagManagerStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.page[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.policyTagManagerStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'datacatalog.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'datacatalog.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + 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 -- + // ------------------- + createTaxonomy( + request: protos.google.cloud.datacatalog.v1.ICreateTaxonomyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datacatalog.v1.ITaxonomy, + protos.google.cloud.datacatalog.v1.ICreateTaxonomyRequest | undefined, + {} | undefined + ] + >; + createTaxonomy( + request: protos.google.cloud.datacatalog.v1.ICreateTaxonomyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.datacatalog.v1.ITaxonomy, + | protos.google.cloud.datacatalog.v1.ICreateTaxonomyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createTaxonomy( + request: protos.google.cloud.datacatalog.v1.ICreateTaxonomyRequest, + callback: Callback< + protos.google.cloud.datacatalog.v1.ITaxonomy, + | protos.google.cloud.datacatalog.v1.ICreateTaxonomyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a taxonomy in a specified project. The taxonomy is initially empty, + * i.e., does not contain policy tags. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the project that the taxonomy will belong to. + * @param {google.cloud.datacatalog.v1.Taxonomy} request.taxonomy + * The taxonomy to be created. + * @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 [Taxonomy]{@link google.cloud.datacatalog.v1.Taxonomy}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.createTaxonomy(request); + */ + createTaxonomy( + request: protos.google.cloud.datacatalog.v1.ICreateTaxonomyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.datacatalog.v1.ITaxonomy, + | protos.google.cloud.datacatalog.v1.ICreateTaxonomyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.datacatalog.v1.ITaxonomy, + | protos.google.cloud.datacatalog.v1.ICreateTaxonomyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.datacatalog.v1.ITaxonomy, + protos.google.cloud.datacatalog.v1.ICreateTaxonomyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createTaxonomy(request, options, callback); + } + deleteTaxonomy( + request: protos.google.cloud.datacatalog.v1.IDeleteTaxonomyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.datacatalog.v1.IDeleteTaxonomyRequest | undefined, + {} | undefined + ] + >; + deleteTaxonomy( + request: protos.google.cloud.datacatalog.v1.IDeleteTaxonomyRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.datacatalog.v1.IDeleteTaxonomyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteTaxonomy( + request: protos.google.cloud.datacatalog.v1.IDeleteTaxonomyRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.datacatalog.v1.IDeleteTaxonomyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes a taxonomy. This method will also delete all policy tags in this + * taxonomy, their associated policies, and the policy tags references from + * BigQuery columns. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the taxonomy to be deleted. All policy tags in + * this taxonomy will also be deleted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.deleteTaxonomy(request); + */ + deleteTaxonomy( + request: protos.google.cloud.datacatalog.v1.IDeleteTaxonomyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.datacatalog.v1.IDeleteTaxonomyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.datacatalog.v1.IDeleteTaxonomyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.datacatalog.v1.IDeleteTaxonomyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteTaxonomy(request, options, callback); + } + updateTaxonomy( + request: protos.google.cloud.datacatalog.v1.IUpdateTaxonomyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datacatalog.v1.ITaxonomy, + protos.google.cloud.datacatalog.v1.IUpdateTaxonomyRequest | undefined, + {} | undefined + ] + >; + updateTaxonomy( + request: protos.google.cloud.datacatalog.v1.IUpdateTaxonomyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.datacatalog.v1.ITaxonomy, + | protos.google.cloud.datacatalog.v1.IUpdateTaxonomyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateTaxonomy( + request: protos.google.cloud.datacatalog.v1.IUpdateTaxonomyRequest, + callback: Callback< + protos.google.cloud.datacatalog.v1.ITaxonomy, + | protos.google.cloud.datacatalog.v1.IUpdateTaxonomyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates a taxonomy. This method can update the taxonomy's display name, + * description, and activated policy types. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.datacatalog.v1.Taxonomy} request.taxonomy + * The taxonomy to update. Only description, display_name, and activated + * policy types can be updated. + * @param {google.protobuf.FieldMask} request.updateMask + * The update mask applies to the resource. For the `FieldMask` definition, + * see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * If not set, defaults to all of the fields that are allowed to update. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Taxonomy]{@link google.cloud.datacatalog.v1.Taxonomy}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.updateTaxonomy(request); + */ + updateTaxonomy( + request: protos.google.cloud.datacatalog.v1.IUpdateTaxonomyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.datacatalog.v1.ITaxonomy, + | protos.google.cloud.datacatalog.v1.IUpdateTaxonomyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.datacatalog.v1.ITaxonomy, + | protos.google.cloud.datacatalog.v1.IUpdateTaxonomyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.datacatalog.v1.ITaxonomy, + protos.google.cloud.datacatalog.v1.IUpdateTaxonomyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'taxonomy.name': request.taxonomy!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateTaxonomy(request, options, callback); + } + getTaxonomy( + request: protos.google.cloud.datacatalog.v1.IGetTaxonomyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datacatalog.v1.ITaxonomy, + protos.google.cloud.datacatalog.v1.IGetTaxonomyRequest | undefined, + {} | undefined + ] + >; + getTaxonomy( + request: protos.google.cloud.datacatalog.v1.IGetTaxonomyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.datacatalog.v1.ITaxonomy, + protos.google.cloud.datacatalog.v1.IGetTaxonomyRequest | null | undefined, + {} | null | undefined + > + ): void; + getTaxonomy( + request: protos.google.cloud.datacatalog.v1.IGetTaxonomyRequest, + callback: Callback< + protos.google.cloud.datacatalog.v1.ITaxonomy, + protos.google.cloud.datacatalog.v1.IGetTaxonomyRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Gets a taxonomy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the requested taxonomy. + * @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 [Taxonomy]{@link google.cloud.datacatalog.v1.Taxonomy}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getTaxonomy(request); + */ + getTaxonomy( + request: protos.google.cloud.datacatalog.v1.IGetTaxonomyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.datacatalog.v1.ITaxonomy, + | protos.google.cloud.datacatalog.v1.IGetTaxonomyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.datacatalog.v1.ITaxonomy, + protos.google.cloud.datacatalog.v1.IGetTaxonomyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.datacatalog.v1.ITaxonomy, + protos.google.cloud.datacatalog.v1.IGetTaxonomyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getTaxonomy(request, options, callback); + } + createPolicyTag( + request: protos.google.cloud.datacatalog.v1.ICreatePolicyTagRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datacatalog.v1.IPolicyTag, + protos.google.cloud.datacatalog.v1.ICreatePolicyTagRequest | undefined, + {} | undefined + ] + >; + createPolicyTag( + request: protos.google.cloud.datacatalog.v1.ICreatePolicyTagRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.datacatalog.v1.IPolicyTag, + | protos.google.cloud.datacatalog.v1.ICreatePolicyTagRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createPolicyTag( + request: protos.google.cloud.datacatalog.v1.ICreatePolicyTagRequest, + callback: Callback< + protos.google.cloud.datacatalog.v1.IPolicyTag, + | protos.google.cloud.datacatalog.v1.ICreatePolicyTagRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a policy tag in a taxonomy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the taxonomy that the policy tag will belong to. + * @param {google.cloud.datacatalog.v1.PolicyTag} request.policyTag + * The policy tag to be created. + * @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 [PolicyTag]{@link google.cloud.datacatalog.v1.PolicyTag}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.createPolicyTag(request); + */ + createPolicyTag( + request: protos.google.cloud.datacatalog.v1.ICreatePolicyTagRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.datacatalog.v1.IPolicyTag, + | protos.google.cloud.datacatalog.v1.ICreatePolicyTagRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.datacatalog.v1.IPolicyTag, + | protos.google.cloud.datacatalog.v1.ICreatePolicyTagRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.datacatalog.v1.IPolicyTag, + protos.google.cloud.datacatalog.v1.ICreatePolicyTagRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createPolicyTag(request, options, callback); + } + deletePolicyTag( + request: protos.google.cloud.datacatalog.v1.IDeletePolicyTagRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.datacatalog.v1.IDeletePolicyTagRequest | undefined, + {} | undefined + ] + >; + deletePolicyTag( + request: protos.google.cloud.datacatalog.v1.IDeletePolicyTagRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.datacatalog.v1.IDeletePolicyTagRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deletePolicyTag( + request: protos.google.cloud.datacatalog.v1.IDeletePolicyTagRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.datacatalog.v1.IDeletePolicyTagRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes a policy tag. This method also deletes: + * + * * all of its descendant policy tags, if any + * * the policies associated with the policy tag and its descendants + * * references from BigQuery table schema of the policy tag and its + * descendants. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the policy tag to be deleted. All of its descendant + * policy tags will also be deleted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.deletePolicyTag(request); + */ + deletePolicyTag( + request: protos.google.cloud.datacatalog.v1.IDeletePolicyTagRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.datacatalog.v1.IDeletePolicyTagRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.datacatalog.v1.IDeletePolicyTagRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.datacatalog.v1.IDeletePolicyTagRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deletePolicyTag(request, options, callback); + } + updatePolicyTag( + request: protos.google.cloud.datacatalog.v1.IUpdatePolicyTagRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datacatalog.v1.IPolicyTag, + protos.google.cloud.datacatalog.v1.IUpdatePolicyTagRequest | undefined, + {} | undefined + ] + >; + updatePolicyTag( + request: protos.google.cloud.datacatalog.v1.IUpdatePolicyTagRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.datacatalog.v1.IPolicyTag, + | protos.google.cloud.datacatalog.v1.IUpdatePolicyTagRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updatePolicyTag( + request: protos.google.cloud.datacatalog.v1.IUpdatePolicyTagRequest, + callback: Callback< + protos.google.cloud.datacatalog.v1.IPolicyTag, + | protos.google.cloud.datacatalog.v1.IUpdatePolicyTagRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates a policy tag. This method can update the policy tag's display + * name, description, and parent policy tag. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.datacatalog.v1.PolicyTag} request.policyTag + * The policy tag to update. Only the description, display_name, and + * parent_policy_tag fields can be updated. + * @param {google.protobuf.FieldMask} request.updateMask + * The update mask applies to the resource. Only display_name, description and + * parent_policy_tag can be updated and thus can be listed in the mask. If + * update_mask is not provided, all allowed fields (i.e. display_name, + * description and parent) will be updated. For more information including the + * `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * If not set, defaults to all of the fields that are allowed to update. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [PolicyTag]{@link google.cloud.datacatalog.v1.PolicyTag}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.updatePolicyTag(request); + */ + updatePolicyTag( + request: protos.google.cloud.datacatalog.v1.IUpdatePolicyTagRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.datacatalog.v1.IPolicyTag, + | protos.google.cloud.datacatalog.v1.IUpdatePolicyTagRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.datacatalog.v1.IPolicyTag, + | protos.google.cloud.datacatalog.v1.IUpdatePolicyTagRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.datacatalog.v1.IPolicyTag, + protos.google.cloud.datacatalog.v1.IUpdatePolicyTagRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'policy_tag.name': request.policyTag!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updatePolicyTag(request, options, callback); + } + getPolicyTag( + request: protos.google.cloud.datacatalog.v1.IGetPolicyTagRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datacatalog.v1.IPolicyTag, + protos.google.cloud.datacatalog.v1.IGetPolicyTagRequest | undefined, + {} | undefined + ] + >; + getPolicyTag( + request: protos.google.cloud.datacatalog.v1.IGetPolicyTagRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.datacatalog.v1.IPolicyTag, + | protos.google.cloud.datacatalog.v1.IGetPolicyTagRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getPolicyTag( + request: protos.google.cloud.datacatalog.v1.IGetPolicyTagRequest, + callback: Callback< + protos.google.cloud.datacatalog.v1.IPolicyTag, + | protos.google.cloud.datacatalog.v1.IGetPolicyTagRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets a policy tag. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the requested policy tag. + * @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 [PolicyTag]{@link google.cloud.datacatalog.v1.PolicyTag}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getPolicyTag(request); + */ + getPolicyTag( + request: protos.google.cloud.datacatalog.v1.IGetPolicyTagRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.datacatalog.v1.IPolicyTag, + | protos.google.cloud.datacatalog.v1.IGetPolicyTagRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.datacatalog.v1.IPolicyTag, + | protos.google.cloud.datacatalog.v1.IGetPolicyTagRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.datacatalog.v1.IPolicyTag, + protos.google.cloud.datacatalog.v1.IGetPolicyTagRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getPolicyTag(request, options, callback); + } + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + ] + >; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Gets the IAM policy for a policy tag or a taxonomy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.GetPolicyOptions} request.options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * @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 [Policy]{@link google.iam.v1.Policy}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getIamPolicy(request); + */ + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + resource: request.resource || '', + }); + this.initialize(); + return this.innerApiCalls.getIamPolicy(request, options, callback); + } + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + ] + >; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Sets the IAM policy for a policy tag or a taxonomy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.Policy} request.policy + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * @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 [Policy]{@link google.iam.v1.Policy}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.setIamPolicy(request); + */ + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + resource: request.resource || '', + }); + this.initialize(); + return this.innerApiCalls.setIamPolicy(request, options, callback); + } + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + ] + >; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the permissions that a caller has on a specified policy tag or + * taxonomy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @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 [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.testIamPermissions(request); + */ + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + resource: request.resource || '', + }); + this.initialize(); + return this.innerApiCalls.testIamPermissions(request, options, callback); + } + + listTaxonomies( + request: protos.google.cloud.datacatalog.v1.IListTaxonomiesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datacatalog.v1.ITaxonomy[], + protos.google.cloud.datacatalog.v1.IListTaxonomiesRequest | null, + protos.google.cloud.datacatalog.v1.IListTaxonomiesResponse + ] + >; + listTaxonomies( + request: protos.google.cloud.datacatalog.v1.IListTaxonomiesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.datacatalog.v1.IListTaxonomiesRequest, + | protos.google.cloud.datacatalog.v1.IListTaxonomiesResponse + | null + | undefined, + protos.google.cloud.datacatalog.v1.ITaxonomy + > + ): void; + listTaxonomies( + request: protos.google.cloud.datacatalog.v1.IListTaxonomiesRequest, + callback: PaginationCallback< + protos.google.cloud.datacatalog.v1.IListTaxonomiesRequest, + | protos.google.cloud.datacatalog.v1.IListTaxonomiesResponse + | null + | undefined, + protos.google.cloud.datacatalog.v1.ITaxonomy + > + ): void; + /** + * Lists all taxonomies in a project in a particular location that the caller + * has permission to view. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the project to list the taxonomies of. + * @param {number} request.pageSize + * The maximum number of items to return. Must be a value between 1 and 1000. + * If not set, defaults to 50. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request, if any. If + * not set, defaults to an empty string. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Taxonomy]{@link google.cloud.datacatalog.v1.Taxonomy}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listTaxonomiesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTaxonomies( + request: protos.google.cloud.datacatalog.v1.IListTaxonomiesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.datacatalog.v1.IListTaxonomiesRequest, + | protos.google.cloud.datacatalog.v1.IListTaxonomiesResponse + | null + | undefined, + protos.google.cloud.datacatalog.v1.ITaxonomy + >, + callback?: PaginationCallback< + protos.google.cloud.datacatalog.v1.IListTaxonomiesRequest, + | protos.google.cloud.datacatalog.v1.IListTaxonomiesResponse + | null + | undefined, + protos.google.cloud.datacatalog.v1.ITaxonomy + > + ): Promise< + [ + protos.google.cloud.datacatalog.v1.ITaxonomy[], + protos.google.cloud.datacatalog.v1.IListTaxonomiesRequest | null, + protos.google.cloud.datacatalog.v1.IListTaxonomiesResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listTaxonomies(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the project to list the taxonomies of. + * @param {number} request.pageSize + * The maximum number of items to return. Must be a value between 1 and 1000. + * If not set, defaults to 50. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request, if any. If + * not set, defaults to an empty string. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Taxonomy]{@link google.cloud.datacatalog.v1.Taxonomy} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listTaxonomiesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTaxonomiesStream( + request?: protos.google.cloud.datacatalog.v1.IListTaxonomiesRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listTaxonomies.createStream( + this.innerApiCalls.listTaxonomies as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listTaxonomies`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the project to list the taxonomies of. + * @param {number} request.pageSize + * The maximum number of items to return. Must be a value between 1 and 1000. + * If not set, defaults to 50. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request, if any. If + * not set, defaults to an empty string. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Taxonomy]{@link google.cloud.datacatalog.v1.Taxonomy}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.listTaxonomiesAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listTaxonomiesAsync( + request?: protos.google.cloud.datacatalog.v1.IListTaxonomiesRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listTaxonomies.asyncIterate( + this.innerApiCalls['listTaxonomies'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } + listPolicyTags( + request: protos.google.cloud.datacatalog.v1.IListPolicyTagsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datacatalog.v1.IPolicyTag[], + protos.google.cloud.datacatalog.v1.IListPolicyTagsRequest | null, + protos.google.cloud.datacatalog.v1.IListPolicyTagsResponse + ] + >; + listPolicyTags( + request: protos.google.cloud.datacatalog.v1.IListPolicyTagsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.datacatalog.v1.IListPolicyTagsRequest, + | protos.google.cloud.datacatalog.v1.IListPolicyTagsResponse + | null + | undefined, + protos.google.cloud.datacatalog.v1.IPolicyTag + > + ): void; + listPolicyTags( + request: protos.google.cloud.datacatalog.v1.IListPolicyTagsRequest, + callback: PaginationCallback< + protos.google.cloud.datacatalog.v1.IListPolicyTagsRequest, + | protos.google.cloud.datacatalog.v1.IListPolicyTagsResponse + | null + | undefined, + protos.google.cloud.datacatalog.v1.IPolicyTag + > + ): void; + /** + * Lists all policy tags in a taxonomy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the taxonomy to list the policy tags of. + * @param {number} request.pageSize + * The maximum number of items to return. Must be a value between 1 and 1000. + * If not set, defaults to 50. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. If + * not set, defaults to an empty string. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [PolicyTag]{@link google.cloud.datacatalog.v1.PolicyTag}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listPolicyTagsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listPolicyTags( + request: protos.google.cloud.datacatalog.v1.IListPolicyTagsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.datacatalog.v1.IListPolicyTagsRequest, + | protos.google.cloud.datacatalog.v1.IListPolicyTagsResponse + | null + | undefined, + protos.google.cloud.datacatalog.v1.IPolicyTag + >, + callback?: PaginationCallback< + protos.google.cloud.datacatalog.v1.IListPolicyTagsRequest, + | protos.google.cloud.datacatalog.v1.IListPolicyTagsResponse + | null + | undefined, + protos.google.cloud.datacatalog.v1.IPolicyTag + > + ): Promise< + [ + protos.google.cloud.datacatalog.v1.IPolicyTag[], + protos.google.cloud.datacatalog.v1.IListPolicyTagsRequest | null, + protos.google.cloud.datacatalog.v1.IListPolicyTagsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listPolicyTags(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the taxonomy to list the policy tags of. + * @param {number} request.pageSize + * The maximum number of items to return. Must be a value between 1 and 1000. + * If not set, defaults to 50. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. If + * not set, defaults to an empty string. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [PolicyTag]{@link google.cloud.datacatalog.v1.PolicyTag} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listPolicyTagsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listPolicyTagsStream( + request?: protos.google.cloud.datacatalog.v1.IListPolicyTagsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listPolicyTags.createStream( + this.innerApiCalls.listPolicyTags as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listPolicyTags`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the taxonomy to list the policy tags of. + * @param {number} request.pageSize + * The maximum number of items to return. Must be a value between 1 and 1000. + * If not set, defaults to 50. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. If + * not set, defaults to an empty string. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [PolicyTag]{@link google.cloud.datacatalog.v1.PolicyTag}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.listPolicyTagsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listPolicyTagsAsync( + request?: protos.google.cloud.datacatalog.v1.IListPolicyTagsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listPolicyTags.asyncIterate( + this.innerApiCalls['listPolicyTags'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified entry resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} entry_group + * @param {string} entry + * @returns {string} Resource name string. + */ + entryPath( + project: string, + location: string, + entryGroup: string, + entry: string + ) { + return this.pathTemplates.entryPathTemplate.render({ + project: project, + location: location, + entry_group: entryGroup, + entry: entry, + }); + } + + /** + * Parse the project from Entry resource. + * + * @param {string} entryName + * A fully-qualified path representing Entry resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntryName(entryName: string) { + return this.pathTemplates.entryPathTemplate.match(entryName).project; + } + + /** + * Parse the location from Entry resource. + * + * @param {string} entryName + * A fully-qualified path representing Entry resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntryName(entryName: string) { + return this.pathTemplates.entryPathTemplate.match(entryName).location; + } + + /** + * Parse the entry_group from Entry resource. + * + * @param {string} entryName + * A fully-qualified path representing Entry resource. + * @returns {string} A string representing the entry_group. + */ + matchEntryGroupFromEntryName(entryName: string) { + return this.pathTemplates.entryPathTemplate.match(entryName).entry_group; + } + + /** + * Parse the entry from Entry resource. + * + * @param {string} entryName + * A fully-qualified path representing Entry resource. + * @returns {string} A string representing the entry. + */ + matchEntryFromEntryName(entryName: string) { + return this.pathTemplates.entryPathTemplate.match(entryName).entry; + } + + /** + * Return a fully-qualified entryGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} entry_group + * @returns {string} Resource name string. + */ + entryGroupPath(project: string, location: string, entryGroup: string) { + return this.pathTemplates.entryGroupPathTemplate.render({ + project: project, + location: location, + entry_group: entryGroup, + }); + } + + /** + * Parse the project from EntryGroup resource. + * + * @param {string} entryGroupName + * A fully-qualified path representing EntryGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntryGroupName(entryGroupName: string) { + return this.pathTemplates.entryGroupPathTemplate.match(entryGroupName) + .project; + } + + /** + * Parse the location from EntryGroup resource. + * + * @param {string} entryGroupName + * A fully-qualified path representing EntryGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntryGroupName(entryGroupName: string) { + return this.pathTemplates.entryGroupPathTemplate.match(entryGroupName) + .location; + } + + /** + * Parse the entry_group from EntryGroup resource. + * + * @param {string} entryGroupName + * A fully-qualified path representing EntryGroup resource. + * @returns {string} A string representing the entry_group. + */ + matchEntryGroupFromEntryGroupName(entryGroupName: string) { + return this.pathTemplates.entryGroupPathTemplate.match(entryGroupName) + .entry_group; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project: string, location: string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified policyTag resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} taxonomy + * @param {string} policy_tag + * @returns {string} Resource name string. + */ + policyTagPath( + project: string, + location: string, + taxonomy: string, + policyTag: string + ) { + return this.pathTemplates.policyTagPathTemplate.render({ + project: project, + location: location, + taxonomy: taxonomy, + policy_tag: policyTag, + }); + } + + /** + * Parse the project from PolicyTag resource. + * + * @param {string} policyTagName + * A fully-qualified path representing PolicyTag resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPolicyTagName(policyTagName: string) { + return this.pathTemplates.policyTagPathTemplate.match(policyTagName) + .project; + } + + /** + * Parse the location from PolicyTag resource. + * + * @param {string} policyTagName + * A fully-qualified path representing PolicyTag resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPolicyTagName(policyTagName: string) { + return this.pathTemplates.policyTagPathTemplate.match(policyTagName) + .location; + } + + /** + * Parse the taxonomy from PolicyTag resource. + * + * @param {string} policyTagName + * A fully-qualified path representing PolicyTag resource. + * @returns {string} A string representing the taxonomy. + */ + matchTaxonomyFromPolicyTagName(policyTagName: string) { + return this.pathTemplates.policyTagPathTemplate.match(policyTagName) + .taxonomy; + } + + /** + * Parse the policy_tag from PolicyTag resource. + * + * @param {string} policyTagName + * A fully-qualified path representing PolicyTag resource. + * @returns {string} A string representing the policy_tag. + */ + matchPolicyTagFromPolicyTagName(policyTagName: string) { + return this.pathTemplates.policyTagPathTemplate.match(policyTagName) + .policy_tag; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified tag resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} entry_group + * @param {string} entry + * @param {string} tag + * @returns {string} Resource name string. + */ + tagPath( + project: string, + location: string, + entryGroup: string, + entry: string, + tag: string + ) { + return this.pathTemplates.tagPathTemplate.render({ + project: project, + location: location, + entry_group: entryGroup, + entry: entry, + tag: tag, + }); + } + + /** + * Parse the project from Tag resource. + * + * @param {string} tagName + * A fully-qualified path representing Tag resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTagName(tagName: string) { + return this.pathTemplates.tagPathTemplate.match(tagName).project; + } + + /** + * Parse the location from Tag resource. + * + * @param {string} tagName + * A fully-qualified path representing Tag resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTagName(tagName: string) { + return this.pathTemplates.tagPathTemplate.match(tagName).location; + } + + /** + * Parse the entry_group from Tag resource. + * + * @param {string} tagName + * A fully-qualified path representing Tag resource. + * @returns {string} A string representing the entry_group. + */ + matchEntryGroupFromTagName(tagName: string) { + return this.pathTemplates.tagPathTemplate.match(tagName).entry_group; + } + + /** + * Parse the entry from Tag resource. + * + * @param {string} tagName + * A fully-qualified path representing Tag resource. + * @returns {string} A string representing the entry. + */ + matchEntryFromTagName(tagName: string) { + return this.pathTemplates.tagPathTemplate.match(tagName).entry; + } + + /** + * Parse the tag from Tag resource. + * + * @param {string} tagName + * A fully-qualified path representing Tag resource. + * @returns {string} A string representing the tag. + */ + matchTagFromTagName(tagName: string) { + return this.pathTemplates.tagPathTemplate.match(tagName).tag; + } + + /** + * Return a fully-qualified tagTemplate resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tag_template + * @returns {string} Resource name string. + */ + tagTemplatePath(project: string, location: string, tagTemplate: string) { + return this.pathTemplates.tagTemplatePathTemplate.render({ + project: project, + location: location, + tag_template: tagTemplate, + }); + } + + /** + * Parse the project from TagTemplate resource. + * + * @param {string} tagTemplateName + * A fully-qualified path representing TagTemplate resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTagTemplateName(tagTemplateName: string) { + return this.pathTemplates.tagTemplatePathTemplate.match(tagTemplateName) + .project; + } + + /** + * Parse the location from TagTemplate resource. + * + * @param {string} tagTemplateName + * A fully-qualified path representing TagTemplate resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTagTemplateName(tagTemplateName: string) { + return this.pathTemplates.tagTemplatePathTemplate.match(tagTemplateName) + .location; + } + + /** + * Parse the tag_template from TagTemplate resource. + * + * @param {string} tagTemplateName + * A fully-qualified path representing TagTemplate resource. + * @returns {string} A string representing the tag_template. + */ + matchTagTemplateFromTagTemplateName(tagTemplateName: string) { + return this.pathTemplates.tagTemplatePathTemplate.match(tagTemplateName) + .tag_template; + } + + /** + * Return a fully-qualified tagTemplateField resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tag_template + * @param {string} field + * @returns {string} Resource name string. + */ + tagTemplateFieldPath( + project: string, + location: string, + tagTemplate: string, + field: string + ) { + return this.pathTemplates.tagTemplateFieldPathTemplate.render({ + project: project, + location: location, + tag_template: tagTemplate, + field: field, + }); + } + + /** + * Parse the project from TagTemplateField resource. + * + * @param {string} tagTemplateFieldName + * A fully-qualified path representing TagTemplateField resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTagTemplateFieldName(tagTemplateFieldName: string) { + return this.pathTemplates.tagTemplateFieldPathTemplate.match( + tagTemplateFieldName + ).project; + } + + /** + * Parse the location from TagTemplateField resource. + * + * @param {string} tagTemplateFieldName + * A fully-qualified path representing TagTemplateField resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTagTemplateFieldName(tagTemplateFieldName: string) { + return this.pathTemplates.tagTemplateFieldPathTemplate.match( + tagTemplateFieldName + ).location; + } + + /** + * Parse the tag_template from TagTemplateField resource. + * + * @param {string} tagTemplateFieldName + * A fully-qualified path representing TagTemplateField resource. + * @returns {string} A string representing the tag_template. + */ + matchTagTemplateFromTagTemplateFieldName(tagTemplateFieldName: string) { + return this.pathTemplates.tagTemplateFieldPathTemplate.match( + tagTemplateFieldName + ).tag_template; + } + + /** + * Parse the field from TagTemplateField resource. + * + * @param {string} tagTemplateFieldName + * A fully-qualified path representing TagTemplateField resource. + * @returns {string} A string representing the field. + */ + matchFieldFromTagTemplateFieldName(tagTemplateFieldName: string) { + return this.pathTemplates.tagTemplateFieldPathTemplate.match( + tagTemplateFieldName + ).field; + } + + /** + * Return a fully-qualified taxonomy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} taxonomy + * @returns {string} Resource name string. + */ + taxonomyPath(project: string, location: string, taxonomy: string) { + return this.pathTemplates.taxonomyPathTemplate.render({ + project: project, + location: location, + taxonomy: taxonomy, + }); + } + + /** + * Parse the project from Taxonomy resource. + * + * @param {string} taxonomyName + * A fully-qualified path representing Taxonomy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTaxonomyName(taxonomyName: string) { + return this.pathTemplates.taxonomyPathTemplate.match(taxonomyName).project; + } + + /** + * Parse the location from Taxonomy resource. + * + * @param {string} taxonomyName + * A fully-qualified path representing Taxonomy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTaxonomyName(taxonomyName: string) { + return this.pathTemplates.taxonomyPathTemplate.match(taxonomyName).location; + } + + /** + * Parse the taxonomy from Taxonomy resource. + * + * @param {string} taxonomyName + * A fully-qualified path representing Taxonomy resource. + * @returns {string} A string representing the taxonomy. + */ + matchTaxonomyFromTaxonomyName(taxonomyName: string) { + return this.pathTemplates.taxonomyPathTemplate.match(taxonomyName).taxonomy; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + this.initialize(); + if (!this._terminated) { + return this.policyTagManagerStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-datacatalog/src/v1/policy_tag_manager_client_config.json b/packages/google-cloud-datacatalog/src/v1/policy_tag_manager_client_config.json new file mode 100644 index 00000000000..03093f81c44 --- /dev/null +++ b/packages/google-cloud-datacatalog/src/v1/policy_tag_manager_client_config.json @@ -0,0 +1,91 @@ +{ + "interfaces": { + "google.cloud.datacatalog.v1.PolicyTagManager": { + "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": { + "CreateTaxonomy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteTaxonomy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateTaxonomy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListTaxonomies": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetTaxonomy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreatePolicyTag": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeletePolicyTag": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdatePolicyTag": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListPolicyTags": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetPolicyTag": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-datacatalog/src/v1/policy_tag_manager_proto_list.json b/packages/google-cloud-datacatalog/src/v1/policy_tag_manager_proto_list.json new file mode 100644 index 00000000000..dfaea9a6173 --- /dev/null +++ b/packages/google-cloud-datacatalog/src/v1/policy_tag_manager_proto_list.json @@ -0,0 +1,13 @@ +[ + "../../protos/google/cloud/datacatalog/v1/common.proto", + "../../protos/google/cloud/datacatalog/v1/data_source.proto", + "../../protos/google/cloud/datacatalog/v1/datacatalog.proto", + "../../protos/google/cloud/datacatalog/v1/gcs_fileset_spec.proto", + "../../protos/google/cloud/datacatalog/v1/policytagmanager.proto", + "../../protos/google/cloud/datacatalog/v1/policytagmanagerserialization.proto", + "../../protos/google/cloud/datacatalog/v1/schema.proto", + "../../protos/google/cloud/datacatalog/v1/search.proto", + "../../protos/google/cloud/datacatalog/v1/table_spec.proto", + "../../protos/google/cloud/datacatalog/v1/tags.proto", + "../../protos/google/cloud/datacatalog/v1/timestamps.proto" +] diff --git a/packages/google-cloud-datacatalog/src/v1/policy_tag_manager_serialization_client.ts b/packages/google-cloud-datacatalog/src/v1/policy_tag_manager_serialization_client.ts new file mode 100644 index 00000000000..06bf342deea --- /dev/null +++ b/packages/google-cloud-datacatalog/src/v1/policy_tag_manager_serialization_client.ts @@ -0,0 +1,1055 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; +import * as path from 'path'; + +import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v1/policy_tag_manager_serialization_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './policy_tag_manager_serialization_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Policy Tag Manager serialization API service allows clients to manipulate + * their policy tags and taxonomies in serialized format, where taxonomy is a + * hierarchical group of policy tags. + * @class + * @memberof v1 + */ +export class PolicyTagManagerSerializationClient { + private _terminated = false; + private _opts: ClientOptions; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + policyTagManagerSerializationStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of PolicyTagManagerSerializationClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this + .constructor as typeof PolicyTagManagerSerializationClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + this._protos = this._gaxGrpc.loadProto( + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + entryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}' + ), + entryGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/entryGroups/{entry_group}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + policyTagPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/taxonomies/{taxonomy}/policyTags/{policy_tag}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + tagPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}/tags/{tag}' + ), + tagTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tagTemplates/{tag_template}' + ), + tagTemplateFieldPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tagTemplates/{tag_template}/fields/{field}' + ), + taxonomyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/taxonomies/{taxonomy}' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.datacatalog.v1.PolicyTagManagerSerialization', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.policyTagManagerSerializationStub) { + return this.policyTagManagerSerializationStub; + } + + // Put together the "service stub" for + // google.cloud.datacatalog.v1.PolicyTagManagerSerialization. + this.policyTagManagerSerializationStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.datacatalog.v1.PolicyTagManagerSerialization' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.datacatalog.v1 + .PolicyTagManagerSerialization, + this._opts + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const policyTagManagerSerializationStubMethods = [ + 'importTaxonomies', + 'exportTaxonomies', + ]; + for (const methodName of policyTagManagerSerializationStubMethods) { + const callPromise = this.policyTagManagerSerializationStub.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.innerApiCalls[methodName] = apiCall; + } + + return this.policyTagManagerSerializationStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'datacatalog.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'datacatalog.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + 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 -- + // ------------------- + importTaxonomies( + request: protos.google.cloud.datacatalog.v1.IImportTaxonomiesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datacatalog.v1.IImportTaxonomiesResponse, + protos.google.cloud.datacatalog.v1.IImportTaxonomiesRequest | undefined, + {} | undefined + ] + >; + importTaxonomies( + request: protos.google.cloud.datacatalog.v1.IImportTaxonomiesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.datacatalog.v1.IImportTaxonomiesResponse, + | protos.google.cloud.datacatalog.v1.IImportTaxonomiesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + importTaxonomies( + request: protos.google.cloud.datacatalog.v1.IImportTaxonomiesRequest, + callback: Callback< + protos.google.cloud.datacatalog.v1.IImportTaxonomiesResponse, + | protos.google.cloud.datacatalog.v1.IImportTaxonomiesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates new taxonomies (including their policy tags) by importing from + * inlined source or cross-regional source. New taxonomies will be created in + * a given parent project. + * + * If using the cross-regional source, a new taxonomy is created by copying + * from a source in another region. + * + * If using the inlined source, this method provides a way to bulk create + * taxonomies and policy tags using nested proto structure. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of project that the imported taxonomies will belong to. + * @param {google.cloud.datacatalog.v1.InlineSource} request.inlineSource + * Inline source used for taxonomies import. + * @param {google.cloud.datacatalog.v1.CrossRegionalSource} request.crossRegionalSource + * Cross-regional source taxonomy to be imported. + * @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 [ImportTaxonomiesResponse]{@link google.cloud.datacatalog.v1.ImportTaxonomiesResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.importTaxonomies(request); + */ + importTaxonomies( + request: protos.google.cloud.datacatalog.v1.IImportTaxonomiesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.datacatalog.v1.IImportTaxonomiesResponse, + | protos.google.cloud.datacatalog.v1.IImportTaxonomiesRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.datacatalog.v1.IImportTaxonomiesResponse, + | protos.google.cloud.datacatalog.v1.IImportTaxonomiesRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.datacatalog.v1.IImportTaxonomiesResponse, + protos.google.cloud.datacatalog.v1.IImportTaxonomiesRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.importTaxonomies(request, options, callback); + } + exportTaxonomies( + request: protos.google.cloud.datacatalog.v1.IExportTaxonomiesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datacatalog.v1.IExportTaxonomiesResponse, + protos.google.cloud.datacatalog.v1.IExportTaxonomiesRequest | undefined, + {} | undefined + ] + >; + exportTaxonomies( + request: protos.google.cloud.datacatalog.v1.IExportTaxonomiesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.datacatalog.v1.IExportTaxonomiesResponse, + | protos.google.cloud.datacatalog.v1.IExportTaxonomiesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + exportTaxonomies( + request: protos.google.cloud.datacatalog.v1.IExportTaxonomiesRequest, + callback: Callback< + protos.google.cloud.datacatalog.v1.IExportTaxonomiesResponse, + | protos.google.cloud.datacatalog.v1.IExportTaxonomiesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Exports taxonomies as the requested type and returns the taxonomies + * including their policy tags. The requested taxonomies must belong to one + * project. + * + * SerializedTaxonomy protos with nested policy tags that are generated by + * this method can be used as input for future ImportTaxonomies calls. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the project that the exported taxonomies belong to. + * @param {string[]} request.taxonomies + * Required. Resource names of the taxonomies to be exported. + * @param {boolean} request.serializedTaxonomies + * Export taxonomies as serialized taxonomies, which contain all the policy + * tags as nested protos. + * @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 [ExportTaxonomiesResponse]{@link google.cloud.datacatalog.v1.ExportTaxonomiesResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.exportTaxonomies(request); + */ + exportTaxonomies( + request: protos.google.cloud.datacatalog.v1.IExportTaxonomiesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.datacatalog.v1.IExportTaxonomiesResponse, + | protos.google.cloud.datacatalog.v1.IExportTaxonomiesRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.datacatalog.v1.IExportTaxonomiesResponse, + | protos.google.cloud.datacatalog.v1.IExportTaxonomiesRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.datacatalog.v1.IExportTaxonomiesResponse, + protos.google.cloud.datacatalog.v1.IExportTaxonomiesRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.exportTaxonomies(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified entry resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} entry_group + * @param {string} entry + * @returns {string} Resource name string. + */ + entryPath( + project: string, + location: string, + entryGroup: string, + entry: string + ) { + return this.pathTemplates.entryPathTemplate.render({ + project: project, + location: location, + entry_group: entryGroup, + entry: entry, + }); + } + + /** + * Parse the project from Entry resource. + * + * @param {string} entryName + * A fully-qualified path representing Entry resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntryName(entryName: string) { + return this.pathTemplates.entryPathTemplate.match(entryName).project; + } + + /** + * Parse the location from Entry resource. + * + * @param {string} entryName + * A fully-qualified path representing Entry resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntryName(entryName: string) { + return this.pathTemplates.entryPathTemplate.match(entryName).location; + } + + /** + * Parse the entry_group from Entry resource. + * + * @param {string} entryName + * A fully-qualified path representing Entry resource. + * @returns {string} A string representing the entry_group. + */ + matchEntryGroupFromEntryName(entryName: string) { + return this.pathTemplates.entryPathTemplate.match(entryName).entry_group; + } + + /** + * Parse the entry from Entry resource. + * + * @param {string} entryName + * A fully-qualified path representing Entry resource. + * @returns {string} A string representing the entry. + */ + matchEntryFromEntryName(entryName: string) { + return this.pathTemplates.entryPathTemplate.match(entryName).entry; + } + + /** + * Return a fully-qualified entryGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} entry_group + * @returns {string} Resource name string. + */ + entryGroupPath(project: string, location: string, entryGroup: string) { + return this.pathTemplates.entryGroupPathTemplate.render({ + project: project, + location: location, + entry_group: entryGroup, + }); + } + + /** + * Parse the project from EntryGroup resource. + * + * @param {string} entryGroupName + * A fully-qualified path representing EntryGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntryGroupName(entryGroupName: string) { + return this.pathTemplates.entryGroupPathTemplate.match(entryGroupName) + .project; + } + + /** + * Parse the location from EntryGroup resource. + * + * @param {string} entryGroupName + * A fully-qualified path representing EntryGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntryGroupName(entryGroupName: string) { + return this.pathTemplates.entryGroupPathTemplate.match(entryGroupName) + .location; + } + + /** + * Parse the entry_group from EntryGroup resource. + * + * @param {string} entryGroupName + * A fully-qualified path representing EntryGroup resource. + * @returns {string} A string representing the entry_group. + */ + matchEntryGroupFromEntryGroupName(entryGroupName: string) { + return this.pathTemplates.entryGroupPathTemplate.match(entryGroupName) + .entry_group; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project: string, location: string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified policyTag resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} taxonomy + * @param {string} policy_tag + * @returns {string} Resource name string. + */ + policyTagPath( + project: string, + location: string, + taxonomy: string, + policyTag: string + ) { + return this.pathTemplates.policyTagPathTemplate.render({ + project: project, + location: location, + taxonomy: taxonomy, + policy_tag: policyTag, + }); + } + + /** + * Parse the project from PolicyTag resource. + * + * @param {string} policyTagName + * A fully-qualified path representing PolicyTag resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPolicyTagName(policyTagName: string) { + return this.pathTemplates.policyTagPathTemplate.match(policyTagName) + .project; + } + + /** + * Parse the location from PolicyTag resource. + * + * @param {string} policyTagName + * A fully-qualified path representing PolicyTag resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPolicyTagName(policyTagName: string) { + return this.pathTemplates.policyTagPathTemplate.match(policyTagName) + .location; + } + + /** + * Parse the taxonomy from PolicyTag resource. + * + * @param {string} policyTagName + * A fully-qualified path representing PolicyTag resource. + * @returns {string} A string representing the taxonomy. + */ + matchTaxonomyFromPolicyTagName(policyTagName: string) { + return this.pathTemplates.policyTagPathTemplate.match(policyTagName) + .taxonomy; + } + + /** + * Parse the policy_tag from PolicyTag resource. + * + * @param {string} policyTagName + * A fully-qualified path representing PolicyTag resource. + * @returns {string} A string representing the policy_tag. + */ + matchPolicyTagFromPolicyTagName(policyTagName: string) { + return this.pathTemplates.policyTagPathTemplate.match(policyTagName) + .policy_tag; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified tag resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} entry_group + * @param {string} entry + * @param {string} tag + * @returns {string} Resource name string. + */ + tagPath( + project: string, + location: string, + entryGroup: string, + entry: string, + tag: string + ) { + return this.pathTemplates.tagPathTemplate.render({ + project: project, + location: location, + entry_group: entryGroup, + entry: entry, + tag: tag, + }); + } + + /** + * Parse the project from Tag resource. + * + * @param {string} tagName + * A fully-qualified path representing Tag resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTagName(tagName: string) { + return this.pathTemplates.tagPathTemplate.match(tagName).project; + } + + /** + * Parse the location from Tag resource. + * + * @param {string} tagName + * A fully-qualified path representing Tag resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTagName(tagName: string) { + return this.pathTemplates.tagPathTemplate.match(tagName).location; + } + + /** + * Parse the entry_group from Tag resource. + * + * @param {string} tagName + * A fully-qualified path representing Tag resource. + * @returns {string} A string representing the entry_group. + */ + matchEntryGroupFromTagName(tagName: string) { + return this.pathTemplates.tagPathTemplate.match(tagName).entry_group; + } + + /** + * Parse the entry from Tag resource. + * + * @param {string} tagName + * A fully-qualified path representing Tag resource. + * @returns {string} A string representing the entry. + */ + matchEntryFromTagName(tagName: string) { + return this.pathTemplates.tagPathTemplate.match(tagName).entry; + } + + /** + * Parse the tag from Tag resource. + * + * @param {string} tagName + * A fully-qualified path representing Tag resource. + * @returns {string} A string representing the tag. + */ + matchTagFromTagName(tagName: string) { + return this.pathTemplates.tagPathTemplate.match(tagName).tag; + } + + /** + * Return a fully-qualified tagTemplate resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tag_template + * @returns {string} Resource name string. + */ + tagTemplatePath(project: string, location: string, tagTemplate: string) { + return this.pathTemplates.tagTemplatePathTemplate.render({ + project: project, + location: location, + tag_template: tagTemplate, + }); + } + + /** + * Parse the project from TagTemplate resource. + * + * @param {string} tagTemplateName + * A fully-qualified path representing TagTemplate resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTagTemplateName(tagTemplateName: string) { + return this.pathTemplates.tagTemplatePathTemplate.match(tagTemplateName) + .project; + } + + /** + * Parse the location from TagTemplate resource. + * + * @param {string} tagTemplateName + * A fully-qualified path representing TagTemplate resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTagTemplateName(tagTemplateName: string) { + return this.pathTemplates.tagTemplatePathTemplate.match(tagTemplateName) + .location; + } + + /** + * Parse the tag_template from TagTemplate resource. + * + * @param {string} tagTemplateName + * A fully-qualified path representing TagTemplate resource. + * @returns {string} A string representing the tag_template. + */ + matchTagTemplateFromTagTemplateName(tagTemplateName: string) { + return this.pathTemplates.tagTemplatePathTemplate.match(tagTemplateName) + .tag_template; + } + + /** + * Return a fully-qualified tagTemplateField resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tag_template + * @param {string} field + * @returns {string} Resource name string. + */ + tagTemplateFieldPath( + project: string, + location: string, + tagTemplate: string, + field: string + ) { + return this.pathTemplates.tagTemplateFieldPathTemplate.render({ + project: project, + location: location, + tag_template: tagTemplate, + field: field, + }); + } + + /** + * Parse the project from TagTemplateField resource. + * + * @param {string} tagTemplateFieldName + * A fully-qualified path representing TagTemplateField resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTagTemplateFieldName(tagTemplateFieldName: string) { + return this.pathTemplates.tagTemplateFieldPathTemplate.match( + tagTemplateFieldName + ).project; + } + + /** + * Parse the location from TagTemplateField resource. + * + * @param {string} tagTemplateFieldName + * A fully-qualified path representing TagTemplateField resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTagTemplateFieldName(tagTemplateFieldName: string) { + return this.pathTemplates.tagTemplateFieldPathTemplate.match( + tagTemplateFieldName + ).location; + } + + /** + * Parse the tag_template from TagTemplateField resource. + * + * @param {string} tagTemplateFieldName + * A fully-qualified path representing TagTemplateField resource. + * @returns {string} A string representing the tag_template. + */ + matchTagTemplateFromTagTemplateFieldName(tagTemplateFieldName: string) { + return this.pathTemplates.tagTemplateFieldPathTemplate.match( + tagTemplateFieldName + ).tag_template; + } + + /** + * Parse the field from TagTemplateField resource. + * + * @param {string} tagTemplateFieldName + * A fully-qualified path representing TagTemplateField resource. + * @returns {string} A string representing the field. + */ + matchFieldFromTagTemplateFieldName(tagTemplateFieldName: string) { + return this.pathTemplates.tagTemplateFieldPathTemplate.match( + tagTemplateFieldName + ).field; + } + + /** + * Return a fully-qualified taxonomy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} taxonomy + * @returns {string} Resource name string. + */ + taxonomyPath(project: string, location: string, taxonomy: string) { + return this.pathTemplates.taxonomyPathTemplate.render({ + project: project, + location: location, + taxonomy: taxonomy, + }); + } + + /** + * Parse the project from Taxonomy resource. + * + * @param {string} taxonomyName + * A fully-qualified path representing Taxonomy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTaxonomyName(taxonomyName: string) { + return this.pathTemplates.taxonomyPathTemplate.match(taxonomyName).project; + } + + /** + * Parse the location from Taxonomy resource. + * + * @param {string} taxonomyName + * A fully-qualified path representing Taxonomy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTaxonomyName(taxonomyName: string) { + return this.pathTemplates.taxonomyPathTemplate.match(taxonomyName).location; + } + + /** + * Parse the taxonomy from Taxonomy resource. + * + * @param {string} taxonomyName + * A fully-qualified path representing Taxonomy resource. + * @returns {string} A string representing the taxonomy. + */ + matchTaxonomyFromTaxonomyName(taxonomyName: string) { + return this.pathTemplates.taxonomyPathTemplate.match(taxonomyName).taxonomy; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + this.initialize(); + if (!this._terminated) { + return this.policyTagManagerSerializationStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-datacatalog/src/v1/policy_tag_manager_serialization_client_config.json b/packages/google-cloud-datacatalog/src/v1/policy_tag_manager_serialization_client_config.json new file mode 100644 index 00000000000..3b3dca5d925 --- /dev/null +++ b/packages/google-cloud-datacatalog/src/v1/policy_tag_manager_serialization_client_config.json @@ -0,0 +1,36 @@ +{ + "interfaces": { + "google.cloud.datacatalog.v1.PolicyTagManagerSerialization": { + "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": { + "ImportTaxonomies": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ExportTaxonomies": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-datacatalog/src/v1/policy_tag_manager_serialization_proto_list.json b/packages/google-cloud-datacatalog/src/v1/policy_tag_manager_serialization_proto_list.json new file mode 100644 index 00000000000..dfaea9a6173 --- /dev/null +++ b/packages/google-cloud-datacatalog/src/v1/policy_tag_manager_serialization_proto_list.json @@ -0,0 +1,13 @@ +[ + "../../protos/google/cloud/datacatalog/v1/common.proto", + "../../protos/google/cloud/datacatalog/v1/data_source.proto", + "../../protos/google/cloud/datacatalog/v1/datacatalog.proto", + "../../protos/google/cloud/datacatalog/v1/gcs_fileset_spec.proto", + "../../protos/google/cloud/datacatalog/v1/policytagmanager.proto", + "../../protos/google/cloud/datacatalog/v1/policytagmanagerserialization.proto", + "../../protos/google/cloud/datacatalog/v1/schema.proto", + "../../protos/google/cloud/datacatalog/v1/search.proto", + "../../protos/google/cloud/datacatalog/v1/table_spec.proto", + "../../protos/google/cloud/datacatalog/v1/tags.proto", + "../../protos/google/cloud/datacatalog/v1/timestamps.proto" +] diff --git a/packages/google-cloud-datacatalog/synth.metadata b/packages/google-cloud-datacatalog/synth.metadata index 0bef1b37533..11f49071e0f 100644 --- a/packages/google-cloud-datacatalog/synth.metadata +++ b/packages/google-cloud-datacatalog/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-datacatalog.git", - "sha": "8b1f4404e4635b70659063c6c5b1877e83f8cfaa" + "sha": "b71d34e5f7f12dc4716949e1ba09ab1e1defe3b7" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "5477122b3e8037a1dc5bc920536158edbd151dc4", - "internalRef": "361273630" + "sha": "91eee3d039fbdbadee008393504900287bbc6f43", + "internalRef": "368687296" } }, { diff --git a/packages/google-cloud-datacatalog/test/gapic_data_catalog_v1.ts b/packages/google-cloud-datacatalog/test/gapic_data_catalog_v1.ts index a16f6e91fbb..59080a0b7ac 100644 --- a/packages/google-cloud-datacatalog/test/gapic_data_catalog_v1.ts +++ b/packages/google-cloud-datacatalog/test/gapic_data_catalog_v1.ts @@ -1983,6 +1983,123 @@ describe('v1.DataCatalogClient', () => { }); }); + describe('renameTagTemplateFieldEnumValue', () => { + it('invokes renameTagTemplateFieldEnumValue without error', async () => { + const client = new datacatalogModule.v1.DataCatalogClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.RenameTagTemplateFieldEnumValueRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.TagTemplateField() + ); + client.innerApiCalls.renameTagTemplateFieldEnumValue = stubSimpleCall( + expectedResponse + ); + const [response] = await client.renameTagTemplateFieldEnumValue(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.renameTagTemplateFieldEnumValue as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes renameTagTemplateFieldEnumValue without error using callback', async () => { + const client = new datacatalogModule.v1.DataCatalogClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.RenameTagTemplateFieldEnumValueRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.TagTemplateField() + ); + client.innerApiCalls.renameTagTemplateFieldEnumValue = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.renameTagTemplateFieldEnumValue( + request, + ( + err?: Error | null, + result?: protos.google.cloud.datacatalog.v1.ITagTemplateField | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.renameTagTemplateFieldEnumValue as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes renameTagTemplateFieldEnumValue with error', async () => { + const client = new datacatalogModule.v1.DataCatalogClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.RenameTagTemplateFieldEnumValueRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.renameTagTemplateFieldEnumValue = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.renameTagTemplateFieldEnumValue(request), + expectedError + ); + assert( + (client.innerApiCalls.renameTagTemplateFieldEnumValue as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('deleteTagTemplateField', () => { it('invokes deleteTagTemplateField without error', async () => { const client = new datacatalogModule.v1.DataCatalogClient({ @@ -4099,6 +4216,82 @@ describe('v1.DataCatalogClient', () => { }); }); + describe('policyTag', () => { + const fakePath = '/rendered/path/policyTag'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + taxonomy: 'taxonomyValue', + policy_tag: 'policyTagValue', + }; + const client = new datacatalogModule.v1.DataCatalogClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.policyTagPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.policyTagPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('policyTagPath', () => { + const result = client.policyTagPath( + 'projectValue', + 'locationValue', + 'taxonomyValue', + 'policyTagValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.policyTagPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromPolicyTagName', () => { + const result = client.matchProjectFromPolicyTagName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.policyTagPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromPolicyTagName', () => { + const result = client.matchLocationFromPolicyTagName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.policyTagPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTaxonomyFromPolicyTagName', () => { + const result = client.matchTaxonomyFromPolicyTagName(fakePath); + assert.strictEqual(result, 'taxonomyValue'); + assert( + (client.pathTemplates.policyTagPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPolicyTagFromPolicyTagName', () => { + const result = client.matchPolicyTagFromPolicyTagName(fakePath); + assert.strictEqual(result, 'policyTagValue'); + assert( + (client.pathTemplates.policyTagPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('project', () => { const fakePath = '/rendered/path/project'; const expectedParameters = { @@ -4367,5 +4560,173 @@ describe('v1.DataCatalogClient', () => { ); }); }); + + describe('tagTemplateFieldEnumValue', () => { + const fakePath = '/rendered/path/tagTemplateFieldEnumValue'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tag_template: 'tagTemplateValue', + tag_template_field_id: 'tagTemplateFieldIdValue', + enum_value_display_name: 'enumValueDisplayNameValue', + }; + const client = new datacatalogModule.v1.DataCatalogClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tagTemplateFieldEnumValuePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tagTemplateFieldEnumValuePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tagTemplateFieldEnumValuePath', () => { + const result = client.tagTemplateFieldEnumValuePath( + 'projectValue', + 'locationValue', + 'tagTemplateValue', + 'tagTemplateFieldIdValue', + 'enumValueDisplayNameValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tagTemplateFieldEnumValuePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTagTemplateFieldEnumValueName', () => { + const result = client.matchProjectFromTagTemplateFieldEnumValueName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tagTemplateFieldEnumValuePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTagTemplateFieldEnumValueName', () => { + const result = client.matchLocationFromTagTemplateFieldEnumValueName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tagTemplateFieldEnumValuePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTagTemplateFromTagTemplateFieldEnumValueName', () => { + const result = client.matchTagTemplateFromTagTemplateFieldEnumValueName( + fakePath + ); + assert.strictEqual(result, 'tagTemplateValue'); + assert( + (client.pathTemplates.tagTemplateFieldEnumValuePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTagTemplateFieldIdFromTagTemplateFieldEnumValueName', () => { + const result = client.matchTagTemplateFieldIdFromTagTemplateFieldEnumValueName( + fakePath + ); + assert.strictEqual(result, 'tagTemplateFieldIdValue'); + assert( + (client.pathTemplates.tagTemplateFieldEnumValuePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnumValueDisplayNameFromTagTemplateFieldEnumValueName', () => { + const result = client.matchEnumValueDisplayNameFromTagTemplateFieldEnumValueName( + fakePath + ); + assert.strictEqual(result, 'enumValueDisplayNameValue'); + assert( + (client.pathTemplates.tagTemplateFieldEnumValuePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('taxonomy', () => { + const fakePath = '/rendered/path/taxonomy'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + taxonomy: 'taxonomyValue', + }; + const client = new datacatalogModule.v1.DataCatalogClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.taxonomyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.taxonomyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('taxonomyPath', () => { + const result = client.taxonomyPath( + 'projectValue', + 'locationValue', + 'taxonomyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.taxonomyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTaxonomyName', () => { + const result = client.matchProjectFromTaxonomyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.taxonomyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTaxonomyName', () => { + const result = client.matchLocationFromTaxonomyName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.taxonomyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTaxonomyFromTaxonomyName', () => { + const result = client.matchTaxonomyFromTaxonomyName(fakePath); + assert.strictEqual(result, 'taxonomyValue'); + assert( + (client.pathTemplates.taxonomyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-datacatalog/test/gapic_policy_tag_manager_serialization_v1.ts b/packages/google-cloud-datacatalog/test/gapic_policy_tag_manager_serialization_v1.ts new file mode 100644 index 00000000000..07b654df2d4 --- /dev/null +++ b/packages/google-cloud-datacatalog/test/gapic_policy_tag_manager_serialization_v1.ts @@ -0,0 +1,1003 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as policytagmanagerserializationModule from '../src'; + +import {protobuf} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message).toObject( + instance as protobuf.Message, + {defaults: true} + ); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +describe('v1.PolicyTagManagerSerializationClient', () => { + it('has servicePath', () => { + const servicePath = + policytagmanagerserializationModule.v1.PolicyTagManagerSerializationClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + policytagmanagerserializationModule.v1.PolicyTagManagerSerializationClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + policytagmanagerserializationModule.v1.PolicyTagManagerSerializationClient + .port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new policytagmanagerserializationModule.v1.PolicyTagManagerSerializationClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new policytagmanagerserializationModule.v1.PolicyTagManagerSerializationClient( + { + fallback: true, + } + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new policytagmanagerserializationModule.v1.PolicyTagManagerSerializationClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.policyTagManagerSerializationStub, undefined); + await client.initialize(); + assert(client.policyTagManagerSerializationStub); + }); + + it('has close method', () => { + const client = new policytagmanagerserializationModule.v1.PolicyTagManagerSerializationClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new policytagmanagerserializationModule.v1.PolicyTagManagerSerializationClient( + { + 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 policytagmanagerserializationModule.v1.PolicyTagManagerSerializationClient( + { + 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('importTaxonomies', () => { + it('invokes importTaxonomies without error', async () => { + const client = new policytagmanagerserializationModule.v1.PolicyTagManagerSerializationClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.ImportTaxonomiesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.ImportTaxonomiesResponse() + ); + client.innerApiCalls.importTaxonomies = stubSimpleCall(expectedResponse); + const [response] = await client.importTaxonomies(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.importTaxonomies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes importTaxonomies without error using callback', async () => { + const client = new policytagmanagerserializationModule.v1.PolicyTagManagerSerializationClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.ImportTaxonomiesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.ImportTaxonomiesResponse() + ); + client.innerApiCalls.importTaxonomies = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.importTaxonomies( + request, + ( + err?: Error | null, + result?: protos.google.cloud.datacatalog.v1.IImportTaxonomiesResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.importTaxonomies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes importTaxonomies with error', async () => { + const client = new policytagmanagerserializationModule.v1.PolicyTagManagerSerializationClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.ImportTaxonomiesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.importTaxonomies = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.importTaxonomies(request), expectedError); + assert( + (client.innerApiCalls.importTaxonomies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('exportTaxonomies', () => { + it('invokes exportTaxonomies without error', async () => { + const client = new policytagmanagerserializationModule.v1.PolicyTagManagerSerializationClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.ExportTaxonomiesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.ExportTaxonomiesResponse() + ); + client.innerApiCalls.exportTaxonomies = stubSimpleCall(expectedResponse); + const [response] = await client.exportTaxonomies(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.exportTaxonomies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes exportTaxonomies without error using callback', async () => { + const client = new policytagmanagerserializationModule.v1.PolicyTagManagerSerializationClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.ExportTaxonomiesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.ExportTaxonomiesResponse() + ); + client.innerApiCalls.exportTaxonomies = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.exportTaxonomies( + request, + ( + err?: Error | null, + result?: protos.google.cloud.datacatalog.v1.IExportTaxonomiesResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.exportTaxonomies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes exportTaxonomies with error', async () => { + const client = new policytagmanagerserializationModule.v1.PolicyTagManagerSerializationClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.ExportTaxonomiesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.exportTaxonomies = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.exportTaxonomies(request), expectedError); + assert( + (client.innerApiCalls.exportTaxonomies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('Path templates', () => { + describe('entry', () => { + const fakePath = '/rendered/path/entry'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + entry_group: 'entryGroupValue', + entry: 'entryValue', + }; + const client = new policytagmanagerserializationModule.v1.PolicyTagManagerSerializationClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.entryPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entryPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entryPath', () => { + const result = client.entryPath( + 'projectValue', + 'locationValue', + 'entryGroupValue', + 'entryValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entryPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEntryName', () => { + const result = client.matchProjectFromEntryName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromEntryName', () => { + const result = client.matchLocationFromEntryName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntryGroupFromEntryName', () => { + const result = client.matchEntryGroupFromEntryName(fakePath); + assert.strictEqual(result, 'entryGroupValue'); + assert( + (client.pathTemplates.entryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntryFromEntryName', () => { + const result = client.matchEntryFromEntryName(fakePath); + assert.strictEqual(result, 'entryValue'); + assert( + (client.pathTemplates.entryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('entryGroup', () => { + const fakePath = '/rendered/path/entryGroup'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + entry_group: 'entryGroupValue', + }; + const client = new policytagmanagerserializationModule.v1.PolicyTagManagerSerializationClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.entryGroupPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entryGroupPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entryGroupPath', () => { + const result = client.entryGroupPath( + 'projectValue', + 'locationValue', + 'entryGroupValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entryGroupPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEntryGroupName', () => { + const result = client.matchProjectFromEntryGroupName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entryGroupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromEntryGroupName', () => { + const result = client.matchLocationFromEntryGroupName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entryGroupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntryGroupFromEntryGroupName', () => { + const result = client.matchEntryGroupFromEntryGroupName(fakePath); + assert.strictEqual(result, 'entryGroupValue'); + assert( + (client.pathTemplates.entryGroupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new policytagmanagerserializationModule.v1.PolicyTagManagerSerializationClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('policyTag', () => { + const fakePath = '/rendered/path/policyTag'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + taxonomy: 'taxonomyValue', + policy_tag: 'policyTagValue', + }; + const client = new policytagmanagerserializationModule.v1.PolicyTagManagerSerializationClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.policyTagPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.policyTagPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('policyTagPath', () => { + const result = client.policyTagPath( + 'projectValue', + 'locationValue', + 'taxonomyValue', + 'policyTagValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.policyTagPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromPolicyTagName', () => { + const result = client.matchProjectFromPolicyTagName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.policyTagPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromPolicyTagName', () => { + const result = client.matchLocationFromPolicyTagName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.policyTagPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTaxonomyFromPolicyTagName', () => { + const result = client.matchTaxonomyFromPolicyTagName(fakePath); + assert.strictEqual(result, 'taxonomyValue'); + assert( + (client.pathTemplates.policyTagPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPolicyTagFromPolicyTagName', () => { + const result = client.matchPolicyTagFromPolicyTagName(fakePath); + assert.strictEqual(result, 'policyTagValue'); + assert( + (client.pathTemplates.policyTagPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new policytagmanagerserializationModule.v1.PolicyTagManagerSerializationClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tag', () => { + const fakePath = '/rendered/path/tag'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + entry_group: 'entryGroupValue', + entry: 'entryValue', + tag: 'tagValue', + }; + const client = new policytagmanagerserializationModule.v1.PolicyTagManagerSerializationClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.tagPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tagPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tagPath', () => { + const result = client.tagPath( + 'projectValue', + 'locationValue', + 'entryGroupValue', + 'entryValue', + 'tagValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tagPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTagName', () => { + const result = client.matchProjectFromTagName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tagPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTagName', () => { + const result = client.matchLocationFromTagName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tagPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntryGroupFromTagName', () => { + const result = client.matchEntryGroupFromTagName(fakePath); + assert.strictEqual(result, 'entryGroupValue'); + assert( + (client.pathTemplates.tagPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntryFromTagName', () => { + const result = client.matchEntryFromTagName(fakePath); + assert.strictEqual(result, 'entryValue'); + assert( + (client.pathTemplates.tagPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTagFromTagName', () => { + const result = client.matchTagFromTagName(fakePath); + assert.strictEqual(result, 'tagValue'); + assert( + (client.pathTemplates.tagPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tagTemplate', () => { + const fakePath = '/rendered/path/tagTemplate'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tag_template: 'tagTemplateValue', + }; + const client = new policytagmanagerserializationModule.v1.PolicyTagManagerSerializationClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.tagTemplatePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tagTemplatePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tagTemplatePath', () => { + const result = client.tagTemplatePath( + 'projectValue', + 'locationValue', + 'tagTemplateValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tagTemplatePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTagTemplateName', () => { + const result = client.matchProjectFromTagTemplateName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tagTemplatePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTagTemplateName', () => { + const result = client.matchLocationFromTagTemplateName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tagTemplatePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTagTemplateFromTagTemplateName', () => { + const result = client.matchTagTemplateFromTagTemplateName(fakePath); + assert.strictEqual(result, 'tagTemplateValue'); + assert( + (client.pathTemplates.tagTemplatePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tagTemplateField', () => { + const fakePath = '/rendered/path/tagTemplateField'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tag_template: 'tagTemplateValue', + field: 'fieldValue', + }; + const client = new policytagmanagerserializationModule.v1.PolicyTagManagerSerializationClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.tagTemplateFieldPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tagTemplateFieldPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tagTemplateFieldPath', () => { + const result = client.tagTemplateFieldPath( + 'projectValue', + 'locationValue', + 'tagTemplateValue', + 'fieldValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tagTemplateFieldPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTagTemplateFieldName', () => { + const result = client.matchProjectFromTagTemplateFieldName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tagTemplateFieldPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTagTemplateFieldName', () => { + const result = client.matchLocationFromTagTemplateFieldName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tagTemplateFieldPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTagTemplateFromTagTemplateFieldName', () => { + const result = client.matchTagTemplateFromTagTemplateFieldName( + fakePath + ); + assert.strictEqual(result, 'tagTemplateValue'); + assert( + (client.pathTemplates.tagTemplateFieldPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFieldFromTagTemplateFieldName', () => { + const result = client.matchFieldFromTagTemplateFieldName(fakePath); + assert.strictEqual(result, 'fieldValue'); + assert( + (client.pathTemplates.tagTemplateFieldPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('taxonomy', () => { + const fakePath = '/rendered/path/taxonomy'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + taxonomy: 'taxonomyValue', + }; + const client = new policytagmanagerserializationModule.v1.PolicyTagManagerSerializationClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.taxonomyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.taxonomyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('taxonomyPath', () => { + const result = client.taxonomyPath( + 'projectValue', + 'locationValue', + 'taxonomyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.taxonomyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTaxonomyName', () => { + const result = client.matchProjectFromTaxonomyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.taxonomyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTaxonomyName', () => { + const result = client.matchLocationFromTaxonomyName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.taxonomyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTaxonomyFromTaxonomyName', () => { + const result = client.matchTaxonomyFromTaxonomyName(fakePath); + assert.strictEqual(result, 'taxonomyValue'); + assert( + (client.pathTemplates.taxonomyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-datacatalog/test/gapic_policy_tag_manager_v1.ts b/packages/google-cloud-datacatalog/test/gapic_policy_tag_manager_v1.ts new file mode 100644 index 00000000000..3b1f3c251d5 --- /dev/null +++ b/packages/google-cloud-datacatalog/test/gapic_policy_tag_manager_v1.ts @@ -0,0 +1,2666 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as policytagmanagerModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message).toObject( + instance as protobuf.Message, + {defaults: true} + ); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.PolicyTagManagerClient', () => { + it('has servicePath', () => { + const servicePath = + policytagmanagerModule.v1.PolicyTagManagerClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + policytagmanagerModule.v1.PolicyTagManagerClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = policytagmanagerModule.v1.PolicyTagManagerClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.policyTagManagerStub, undefined); + await client.initialize(); + assert(client.policyTagManagerStub); + }); + + it('has close method', () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + 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 policytagmanagerModule.v1.PolicyTagManagerClient({ + 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('createTaxonomy', () => { + it('invokes createTaxonomy without error', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.CreateTaxonomyRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.Taxonomy() + ); + client.innerApiCalls.createTaxonomy = stubSimpleCall(expectedResponse); + const [response] = await client.createTaxonomy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createTaxonomy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createTaxonomy without error using callback', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.CreateTaxonomyRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.Taxonomy() + ); + client.innerApiCalls.createTaxonomy = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createTaxonomy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.datacatalog.v1.ITaxonomy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createTaxonomy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createTaxonomy with error', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.CreateTaxonomyRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createTaxonomy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createTaxonomy(request), expectedError); + assert( + (client.innerApiCalls.createTaxonomy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('deleteTaxonomy', () => { + it('invokes deleteTaxonomy without error', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.DeleteTaxonomyRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteTaxonomy = stubSimpleCall(expectedResponse); + const [response] = await client.deleteTaxonomy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteTaxonomy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteTaxonomy without error using callback', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.DeleteTaxonomyRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteTaxonomy = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.deleteTaxonomy( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteTaxonomy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteTaxonomy with error', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.DeleteTaxonomyRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTaxonomy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteTaxonomy(request), expectedError); + assert( + (client.innerApiCalls.deleteTaxonomy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateTaxonomy', () => { + it('invokes updateTaxonomy without error', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.UpdateTaxonomyRequest() + ); + request.taxonomy = {}; + request.taxonomy.name = ''; + const expectedHeaderRequestParams = 'taxonomy.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.Taxonomy() + ); + client.innerApiCalls.updateTaxonomy = stubSimpleCall(expectedResponse); + const [response] = await client.updateTaxonomy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateTaxonomy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateTaxonomy without error using callback', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.UpdateTaxonomyRequest() + ); + request.taxonomy = {}; + request.taxonomy.name = ''; + const expectedHeaderRequestParams = 'taxonomy.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.Taxonomy() + ); + client.innerApiCalls.updateTaxonomy = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateTaxonomy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.datacatalog.v1.ITaxonomy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateTaxonomy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateTaxonomy with error', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.UpdateTaxonomyRequest() + ); + request.taxonomy = {}; + request.taxonomy.name = ''; + const expectedHeaderRequestParams = 'taxonomy.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTaxonomy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateTaxonomy(request), expectedError); + assert( + (client.innerApiCalls.updateTaxonomy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getTaxonomy', () => { + it('invokes getTaxonomy without error', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.GetTaxonomyRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.Taxonomy() + ); + client.innerApiCalls.getTaxonomy = stubSimpleCall(expectedResponse); + const [response] = await client.getTaxonomy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getTaxonomy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getTaxonomy without error using callback', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.GetTaxonomyRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.Taxonomy() + ); + client.innerApiCalls.getTaxonomy = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getTaxonomy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.datacatalog.v1.ITaxonomy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getTaxonomy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getTaxonomy with error', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.GetTaxonomyRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getTaxonomy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getTaxonomy(request), expectedError); + assert( + (client.innerApiCalls.getTaxonomy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('createPolicyTag', () => { + it('invokes createPolicyTag without error', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.CreatePolicyTagRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.PolicyTag() + ); + client.innerApiCalls.createPolicyTag = stubSimpleCall(expectedResponse); + const [response] = await client.createPolicyTag(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createPolicyTag as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createPolicyTag without error using callback', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.CreatePolicyTagRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.PolicyTag() + ); + client.innerApiCalls.createPolicyTag = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createPolicyTag( + request, + ( + err?: Error | null, + result?: protos.google.cloud.datacatalog.v1.IPolicyTag | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createPolicyTag as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createPolicyTag with error', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.CreatePolicyTagRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createPolicyTag = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createPolicyTag(request), expectedError); + assert( + (client.innerApiCalls.createPolicyTag as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('deletePolicyTag', () => { + it('invokes deletePolicyTag without error', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.DeletePolicyTagRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deletePolicyTag = stubSimpleCall(expectedResponse); + const [response] = await client.deletePolicyTag(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deletePolicyTag as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deletePolicyTag without error using callback', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.DeletePolicyTagRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deletePolicyTag = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.deletePolicyTag( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deletePolicyTag as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deletePolicyTag with error', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.DeletePolicyTagRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePolicyTag = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deletePolicyTag(request), expectedError); + assert( + (client.innerApiCalls.deletePolicyTag as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updatePolicyTag', () => { + it('invokes updatePolicyTag without error', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.UpdatePolicyTagRequest() + ); + request.policyTag = {}; + request.policyTag.name = ''; + const expectedHeaderRequestParams = 'policy_tag.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.PolicyTag() + ); + client.innerApiCalls.updatePolicyTag = stubSimpleCall(expectedResponse); + const [response] = await client.updatePolicyTag(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updatePolicyTag as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updatePolicyTag without error using callback', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.UpdatePolicyTagRequest() + ); + request.policyTag = {}; + request.policyTag.name = ''; + const expectedHeaderRequestParams = 'policy_tag.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.PolicyTag() + ); + client.innerApiCalls.updatePolicyTag = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updatePolicyTag( + request, + ( + err?: Error | null, + result?: protos.google.cloud.datacatalog.v1.IPolicyTag | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updatePolicyTag as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updatePolicyTag with error', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.UpdatePolicyTagRequest() + ); + request.policyTag = {}; + request.policyTag.name = ''; + const expectedHeaderRequestParams = 'policy_tag.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updatePolicyTag = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updatePolicyTag(request), expectedError); + assert( + (client.innerApiCalls.updatePolicyTag as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getPolicyTag', () => { + it('invokes getPolicyTag without error', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.GetPolicyTagRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.PolicyTag() + ); + client.innerApiCalls.getPolicyTag = stubSimpleCall(expectedResponse); + const [response] = await client.getPolicyTag(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getPolicyTag as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getPolicyTag without error using callback', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.GetPolicyTagRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.PolicyTag() + ); + client.innerApiCalls.getPolicyTag = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getPolicyTag( + request, + ( + err?: Error | null, + result?: protos.google.cloud.datacatalog.v1.IPolicyTag | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getPolicyTag as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getPolicyTag with error', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.GetPolicyTagRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getPolicyTag = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getPolicyTag(request), expectedError); + assert( + (client.innerApiCalls.getPolicyTag as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getIamPolicy without error using callback', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getIamPolicy with error', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getIamPolicy(request), expectedError); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setIamPolicy without error using callback', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setIamPolicy with error', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setIamPolicy(request), expectedError); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + expectedResponse + ); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.ITestIamPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes testIamPermissions with error', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.testIamPermissions(request), expectedError); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('listTaxonomies', () => { + it('invokes listTaxonomies without error', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.ListTaxonomiesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datacatalog.v1.Taxonomy() + ), + generateSampleMessage( + new protos.google.cloud.datacatalog.v1.Taxonomy() + ), + generateSampleMessage( + new protos.google.cloud.datacatalog.v1.Taxonomy() + ), + ]; + client.innerApiCalls.listTaxonomies = stubSimpleCall(expectedResponse); + const [response] = await client.listTaxonomies(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listTaxonomies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listTaxonomies without error using callback', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.ListTaxonomiesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datacatalog.v1.Taxonomy() + ), + generateSampleMessage( + new protos.google.cloud.datacatalog.v1.Taxonomy() + ), + generateSampleMessage( + new protos.google.cloud.datacatalog.v1.Taxonomy() + ), + ]; + client.innerApiCalls.listTaxonomies = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listTaxonomies( + request, + ( + err?: Error | null, + result?: protos.google.cloud.datacatalog.v1.ITaxonomy[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listTaxonomies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listTaxonomies with error', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.ListTaxonomiesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listTaxonomies = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listTaxonomies(request), expectedError); + assert( + (client.innerApiCalls.listTaxonomies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listTaxonomiesStream without error', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.ListTaxonomiesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datacatalog.v1.Taxonomy() + ), + generateSampleMessage( + new protos.google.cloud.datacatalog.v1.Taxonomy() + ), + generateSampleMessage( + new protos.google.cloud.datacatalog.v1.Taxonomy() + ), + ]; + client.descriptors.page.listTaxonomies.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listTaxonomiesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datacatalog.v1.Taxonomy[] = []; + stream.on( + 'data', + (response: protos.google.cloud.datacatalog.v1.Taxonomy) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listTaxonomies.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTaxonomies, request) + ); + assert.strictEqual( + (client.descriptors.page.listTaxonomies + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes listTaxonomiesStream with error', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.ListTaxonomiesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listTaxonomies.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listTaxonomiesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datacatalog.v1.Taxonomy[] = []; + stream.on( + 'data', + (response: protos.google.cloud.datacatalog.v1.Taxonomy) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listTaxonomies.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTaxonomies, request) + ); + assert.strictEqual( + (client.descriptors.page.listTaxonomies + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listTaxonomies without error', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.ListTaxonomiesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datacatalog.v1.Taxonomy() + ), + generateSampleMessage( + new protos.google.cloud.datacatalog.v1.Taxonomy() + ), + generateSampleMessage( + new protos.google.cloud.datacatalog.v1.Taxonomy() + ), + ]; + client.descriptors.page.listTaxonomies.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.datacatalog.v1.ITaxonomy[] = []; + const iterable = client.listTaxonomiesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listTaxonomies + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listTaxonomies + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listTaxonomies with error', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.ListTaxonomiesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listTaxonomies.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listTaxonomiesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.datacatalog.v1.ITaxonomy[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listTaxonomies + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listTaxonomies + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('listPolicyTags', () => { + it('invokes listPolicyTags without error', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.ListPolicyTagsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datacatalog.v1.PolicyTag() + ), + generateSampleMessage( + new protos.google.cloud.datacatalog.v1.PolicyTag() + ), + generateSampleMessage( + new protos.google.cloud.datacatalog.v1.PolicyTag() + ), + ]; + client.innerApiCalls.listPolicyTags = stubSimpleCall(expectedResponse); + const [response] = await client.listPolicyTags(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listPolicyTags as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listPolicyTags without error using callback', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.ListPolicyTagsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datacatalog.v1.PolicyTag() + ), + generateSampleMessage( + new protos.google.cloud.datacatalog.v1.PolicyTag() + ), + generateSampleMessage( + new protos.google.cloud.datacatalog.v1.PolicyTag() + ), + ]; + client.innerApiCalls.listPolicyTags = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listPolicyTags( + request, + ( + err?: Error | null, + result?: protos.google.cloud.datacatalog.v1.IPolicyTag[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listPolicyTags as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listPolicyTags with error', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.ListPolicyTagsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listPolicyTags = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listPolicyTags(request), expectedError); + assert( + (client.innerApiCalls.listPolicyTags as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listPolicyTagsStream without error', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.ListPolicyTagsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datacatalog.v1.PolicyTag() + ), + generateSampleMessage( + new protos.google.cloud.datacatalog.v1.PolicyTag() + ), + generateSampleMessage( + new protos.google.cloud.datacatalog.v1.PolicyTag() + ), + ]; + client.descriptors.page.listPolicyTags.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listPolicyTagsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datacatalog.v1.PolicyTag[] = []; + stream.on( + 'data', + (response: protos.google.cloud.datacatalog.v1.PolicyTag) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listPolicyTags.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listPolicyTags, request) + ); + assert.strictEqual( + (client.descriptors.page.listPolicyTags + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes listPolicyTagsStream with error', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.ListPolicyTagsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listPolicyTags.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listPolicyTagsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datacatalog.v1.PolicyTag[] = []; + stream.on( + 'data', + (response: protos.google.cloud.datacatalog.v1.PolicyTag) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listPolicyTags.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listPolicyTags, request) + ); + assert.strictEqual( + (client.descriptors.page.listPolicyTags + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listPolicyTags without error', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.ListPolicyTagsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datacatalog.v1.PolicyTag() + ), + generateSampleMessage( + new protos.google.cloud.datacatalog.v1.PolicyTag() + ), + generateSampleMessage( + new protos.google.cloud.datacatalog.v1.PolicyTag() + ), + ]; + client.descriptors.page.listPolicyTags.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.datacatalog.v1.IPolicyTag[] = []; + const iterable = client.listPolicyTagsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listPolicyTags + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listPolicyTags + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listPolicyTags with error', async () => { + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datacatalog.v1.ListPolicyTagsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listPolicyTags.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listPolicyTagsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.datacatalog.v1.IPolicyTag[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listPolicyTags + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listPolicyTags + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + describe('entry', () => { + const fakePath = '/rendered/path/entry'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + entry_group: 'entryGroupValue', + entry: 'entryValue', + }; + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entryPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entryPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entryPath', () => { + const result = client.entryPath( + 'projectValue', + 'locationValue', + 'entryGroupValue', + 'entryValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entryPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEntryName', () => { + const result = client.matchProjectFromEntryName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromEntryName', () => { + const result = client.matchLocationFromEntryName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntryGroupFromEntryName', () => { + const result = client.matchEntryGroupFromEntryName(fakePath); + assert.strictEqual(result, 'entryGroupValue'); + assert( + (client.pathTemplates.entryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntryFromEntryName', () => { + const result = client.matchEntryFromEntryName(fakePath); + assert.strictEqual(result, 'entryValue'); + assert( + (client.pathTemplates.entryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('entryGroup', () => { + const fakePath = '/rendered/path/entryGroup'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + entry_group: 'entryGroupValue', + }; + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entryGroupPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entryGroupPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entryGroupPath', () => { + const result = client.entryGroupPath( + 'projectValue', + 'locationValue', + 'entryGroupValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entryGroupPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEntryGroupName', () => { + const result = client.matchProjectFromEntryGroupName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entryGroupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromEntryGroupName', () => { + const result = client.matchLocationFromEntryGroupName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entryGroupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntryGroupFromEntryGroupName', () => { + const result = client.matchEntryGroupFromEntryGroupName(fakePath); + assert.strictEqual(result, 'entryGroupValue'); + assert( + (client.pathTemplates.entryGroupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('policyTag', () => { + const fakePath = '/rendered/path/policyTag'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + taxonomy: 'taxonomyValue', + policy_tag: 'policyTagValue', + }; + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.policyTagPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.policyTagPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('policyTagPath', () => { + const result = client.policyTagPath( + 'projectValue', + 'locationValue', + 'taxonomyValue', + 'policyTagValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.policyTagPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromPolicyTagName', () => { + const result = client.matchProjectFromPolicyTagName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.policyTagPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromPolicyTagName', () => { + const result = client.matchLocationFromPolicyTagName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.policyTagPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTaxonomyFromPolicyTagName', () => { + const result = client.matchTaxonomyFromPolicyTagName(fakePath); + assert.strictEqual(result, 'taxonomyValue'); + assert( + (client.pathTemplates.policyTagPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPolicyTagFromPolicyTagName', () => { + const result = client.matchPolicyTagFromPolicyTagName(fakePath); + assert.strictEqual(result, 'policyTagValue'); + assert( + (client.pathTemplates.policyTagPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tag', () => { + const fakePath = '/rendered/path/tag'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + entry_group: 'entryGroupValue', + entry: 'entryValue', + tag: 'tagValue', + }; + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tagPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tagPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tagPath', () => { + const result = client.tagPath( + 'projectValue', + 'locationValue', + 'entryGroupValue', + 'entryValue', + 'tagValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tagPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTagName', () => { + const result = client.matchProjectFromTagName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tagPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTagName', () => { + const result = client.matchLocationFromTagName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tagPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntryGroupFromTagName', () => { + const result = client.matchEntryGroupFromTagName(fakePath); + assert.strictEqual(result, 'entryGroupValue'); + assert( + (client.pathTemplates.tagPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntryFromTagName', () => { + const result = client.matchEntryFromTagName(fakePath); + assert.strictEqual(result, 'entryValue'); + assert( + (client.pathTemplates.tagPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTagFromTagName', () => { + const result = client.matchTagFromTagName(fakePath); + assert.strictEqual(result, 'tagValue'); + assert( + (client.pathTemplates.tagPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tagTemplate', () => { + const fakePath = '/rendered/path/tagTemplate'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tag_template: 'tagTemplateValue', + }; + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tagTemplatePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tagTemplatePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tagTemplatePath', () => { + const result = client.tagTemplatePath( + 'projectValue', + 'locationValue', + 'tagTemplateValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tagTemplatePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTagTemplateName', () => { + const result = client.matchProjectFromTagTemplateName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tagTemplatePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTagTemplateName', () => { + const result = client.matchLocationFromTagTemplateName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tagTemplatePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTagTemplateFromTagTemplateName', () => { + const result = client.matchTagTemplateFromTagTemplateName(fakePath); + assert.strictEqual(result, 'tagTemplateValue'); + assert( + (client.pathTemplates.tagTemplatePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tagTemplateField', () => { + const fakePath = '/rendered/path/tagTemplateField'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tag_template: 'tagTemplateValue', + field: 'fieldValue', + }; + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tagTemplateFieldPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tagTemplateFieldPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tagTemplateFieldPath', () => { + const result = client.tagTemplateFieldPath( + 'projectValue', + 'locationValue', + 'tagTemplateValue', + 'fieldValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tagTemplateFieldPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTagTemplateFieldName', () => { + const result = client.matchProjectFromTagTemplateFieldName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tagTemplateFieldPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTagTemplateFieldName', () => { + const result = client.matchLocationFromTagTemplateFieldName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tagTemplateFieldPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTagTemplateFromTagTemplateFieldName', () => { + const result = client.matchTagTemplateFromTagTemplateFieldName( + fakePath + ); + assert.strictEqual(result, 'tagTemplateValue'); + assert( + (client.pathTemplates.tagTemplateFieldPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFieldFromTagTemplateFieldName', () => { + const result = client.matchFieldFromTagTemplateFieldName(fakePath); + assert.strictEqual(result, 'fieldValue'); + assert( + (client.pathTemplates.tagTemplateFieldPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('taxonomy', () => { + const fakePath = '/rendered/path/taxonomy'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + taxonomy: 'taxonomyValue', + }; + const client = new policytagmanagerModule.v1.PolicyTagManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.taxonomyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.taxonomyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('taxonomyPath', () => { + const result = client.taxonomyPath( + 'projectValue', + 'locationValue', + 'taxonomyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.taxonomyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTaxonomyName', () => { + const result = client.matchProjectFromTaxonomyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.taxonomyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTaxonomyName', () => { + const result = client.matchLocationFromTaxonomyName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.taxonomyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTaxonomyFromTaxonomyName', () => { + const result = client.matchTaxonomyFromTaxonomyName(fakePath); + assert.strictEqual(result, 'taxonomyValue'); + assert( + (client.pathTemplates.taxonomyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +});