diff --git a/packages/google-cloud-asset/.jsdoc.js b/packages/google-cloud-asset/.jsdoc.js index e662e8e8ea1..970aa2e9594 100644 --- a/packages/google-cloud-asset/.jsdoc.js +++ b/packages/google-cloud-asset/.jsdoc.js @@ -31,7 +31,7 @@ module.exports = { source: { excludePattern: '(^|\\/|\\\\)[._]', include: [ - 'src' + 'build/src' ], includePattern: '\\.js$' }, diff --git a/packages/google-cloud-asset/README.md b/packages/google-cloud-asset/README.md index 145e26c615e..380d1e3aa20 100644 --- a/packages/google-cloud-asset/README.md +++ b/packages/google-cloud-asset/README.md @@ -62,7 +62,7 @@ npm install @google-cloud/asset async function quickstart() { const projectId = await client.getProjectId(); - const projectResource = client.projectPath(projectId); + const projectResource = `projects/${projectId}`; // TODO(developer): Choose asset names, such as //storage.googleapis.com/[YOUR_BUCKET_NAME]. // const assetNames = ['ASSET_NAME1', 'ASSET_NAME2', ...]; diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index 9b8af00a5a8..a6a79b15b4c 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -8,12 +8,10 @@ "node": ">=8.10.0" }, "repository": "googleapis/nodejs-asset", - "main": "src/index.js", + "main": "build/src/index.js", "files": [ - "protos", - "src", - "AUTHORS", - "COPYING" + "build/src", + "build/protos" ], "keywords": [ "google apis client", @@ -29,34 +27,47 @@ "Cloud Asset API" ], "scripts": { - "docs": "jsdoc -c .jsdoc.js", - "lint": "eslint '**/*.js'", "samples-test": "c8 npm run samples-test-suite", "samples-test-suite": "cd samples/ && npm link ../ && npm test && cd ../", - "system-test": "mocha system-test/*.js smoke-test/*.js --timeout 600000", - "test": "c8 mocha", - "fix": "eslint --fix '**/*.js'", + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", "docs-test": "linkinator docs", - "predocs-test": "npm run docs" + "fix": "gts fix", + "lint": "gts check", + "predocs-test": "npm run docs", + "prepare": "npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^1.7.5", + "google-gax": "^1.14.1", "protobufjs": "^6.8.0" }, "devDependencies": { + "@types/mocha": "^5.2.5", + "@types/node": "^12.0.0", + "c8": "^7.0.1", "codecov": "^3.0.4", "eslint": "^6.0.0", "eslint-config-prettier": "^6.0.0", "eslint-plugin-node": "^11.0.0", "eslint-plugin-prettier": "^3.0.0", + "gts": "^1.0.0", "intelli-espower-loader": "^1.0.1", "jsdoc": "^3.6.2", "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", "linkinator": "^1.5.0", "mocha": "^7.0.0", - "c8": "^7.0.0", + "null-loader": "^3.0.0", + "pack-n-play": "^1.0.0-2", "power-assert": "^1.6.0", - "prettier": "^1.13.7" + "prettier": "^1.13.7", + "ts-loader": "^6.2.1", + "typescript": "~3.6.4", + "webpack": "^4.41.2", + "webpack-cli": "^3.3.10" } } diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/asset_service.proto index 8e2d1b0a387..956c6a7677a 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/asset_service.proto @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC. +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,6 +18,9 @@ syntax = "proto3"; package google.cloud.asset.v1beta1; import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; import "google/cloud/asset/v1beta1/assets.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/timestamp.proto"; @@ -31,6 +34,10 @@ option php_namespace = "Google\\Cloud\\Asset\\V1beta1"; // Asset service definition. service AssetService { + option (google.api.default_host) = "cloudasset.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + // Exports assets with time and resource types to a given Cloud Storage // location. The output format is newline-delimited JSON. // This API implements the @@ -49,6 +56,10 @@ service AssetService { body: "*" } }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.asset.v1beta1.ExportAssetsResponse" + metadata_type: "google.cloud.asset.v1beta1.ExportAssetsRequest" + }; } // Batch gets the update history of assets that overlap a time window. @@ -56,6 +67,8 @@ service AssetService { // non-delete or deleted status. // For IAM_POLICY content, this API outputs history when the asset and its // attached IAM POLICY both exist. This can create gaps in the output history. + // If a specified asset does not exist, this API returns an INVALID_ARGUMENT + // error. rpc BatchGetAssetsHistory(BatchGetAssetsHistoryRequest) returns (BatchGetAssetsHistoryResponse) { option (google.api.http) = { @@ -73,7 +86,12 @@ message ExportAssetsRequest { // organization number (such as "organizations/123"), a project ID (such as // "projects/my-project-id"), a project number (such as "projects/12345"), or // a folder number (such as "folders/123"). - string parent = 1; + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudasset.googleapis.com/Asset" + } + ]; // Timestamp to take an asset snapshot. This can only be set to a timestamp // between 2018-10-02 UTC (inclusive) and the current time. If not specified, @@ -95,7 +113,7 @@ message ExportAssetsRequest { // Required. Output configuration indicating where the results will be output // to. All results will be in newline delimited JSON format. - OutputConfig output_config = 5; + OutputConfig output_config = 5 [(google.api.field_behavior) = REQUIRED]; } // The export asset response. This message is returned by the @@ -117,7 +135,12 @@ message BatchGetAssetsHistoryRequest { // Required. The relative name of the root asset. It can only be an // organization number (such as "organizations/123"), a project ID (such as // "projects/my-project-id")", or a project number (such as "projects/12345"). - string parent = 1; + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudasset.googleapis.com/Asset" + } + ]; // A list of the full names of the assets. For example: // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. @@ -129,8 +152,8 @@ message BatchGetAssetsHistoryRequest { // size of the asset name list is 100 in one request. repeated string asset_names = 2; - // Required. The content type. - ContentType content_type = 3; + // Optional. The content type. + ContentType content_type = 3 [(google.api.field_behavior) = OPTIONAL]; // Optional. The time window for the asset history. Both start_time and // end_time are optional and if set, it must be after 2018-10-02 UTC. If @@ -138,7 +161,7 @@ message BatchGetAssetsHistoryRequest { // not set, the snapshot of the assets at end_time will be returned. The // returned results contain all temporal assets whose time window overlap with // read_time_window. - TimeWindow read_time_window = 4; + TimeWindow read_time_window = 4 [(google.api.field_behavior) = OPTIONAL]; } // Batch get assets history response. @@ -166,6 +189,16 @@ message GcsDestination { // Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) // for more information. string uri = 1; + + // The uri prefix of all generated Cloud Storage objects. For example: + // "gs://bucket_name/object_name_prefix". Each object uri is in format: + // "gs://bucket_name/object_name_prefix// and only + // contains assets for that type. starts from 0. For example: + // "gs://bucket_name/object_name_prefix/google.compute.disk/0" is the first + // shard of output objects containing all google.compute.disk assets. + // An INVALID_ARGUMENT error will be returned if file with the same name + // "gs://bucket_name/object_name_prefix" already exists. + string uri_prefix = 2; } } diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/assets.proto index 84db977b97d..4bb1438c8d7 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/assets.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1beta1/assets.proto @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC. +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,11 +18,13 @@ syntax = "proto3"; package google.cloud.asset.v1beta1; import "google/api/annotations.proto"; +import "google/api/resource.proto"; import "google/iam/v1/policy.proto"; import "google/protobuf/any.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; +option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.Asset.V1Beta1"; option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1beta1;asset"; option java_multiple_files = true; @@ -56,6 +58,11 @@ message TimeWindow { // Cloud asset. This includes all Google Cloud Platform resources, // Cloud IAM policies, and other non-GCP assets. message Asset { + option (google.api.resource) = { + type: "cloudasset.googleapis.com/Asset" + pattern: "*" + }; + // The full name of the asset. For example: // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. // See [Resource diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/asset_service.proto new file mode 100644 index 00000000000..025adb27fe1 --- /dev/null +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/asset_service.proto @@ -0,0 +1,234 @@ +// Copyright 2019 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.asset.v1p1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/cloud/asset/v1p1beta1/assets.proto"; + +option csharp_namespace = "Google.Cloud.Asset.V1P1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1p1beta1;asset"; +option java_multiple_files = true; +option java_outer_classname = "AssetServiceProto"; +option java_package = "com.google.cloud.asset.v1p1beta1"; +option php_namespace = "Google\\Cloud\\Asset\\V1p1beta1"; + +// Asset service definition. +service AssetService { + option (google.api.default_host) = "cloudasset.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Searches resources which are accessible with .get permission. + rpc SearchResources(SearchResourcesRequest) returns (SearchResourcesResponse) { + option (google.api.http) = { + get: "/v1p1beta1/resources:search" + }; + option (google.api.method_signature) = "scope,query,asset_types"; + } + + // Searches IAM policies which are accessible with .getIamPolicy permission. + rpc SearchIamPolicies(SearchIamPoliciesRequest) returns (SearchIamPoliciesResponse) { + option (google.api.http) = { + get: "/v1p1beta1/iamPolicies:search" + }; + option (google.api.method_signature) = "scope,query"; + } + + // Searches all the resources under a given accessible CRM scope + // (project/folder/organization). This RPC gives callers + // especially admins the ability to search all the resources under a scope, + // even if they don't have .get permission of all the resources. Callers + // should have cloud.assets.SearchAllResources permission on the requested + // scope, otherwise it will be rejected. + rpc SearchAllResources(SearchAllResourcesRequest) returns (SearchAllResourcesResponse) { + option (google.api.http) = { + get: "/v1p1beta1/{scope=*/*}/resources:searchAll" + }; + option (google.api.method_signature) = "scope,query,asset_types"; + } + + // Searches all the IAM policies under a given accessible CRM scope + // (project/folder/organization). This RPC gives callers + // especially admins the ability to search all the IAM policies under a scope, + // even if they don't have .getIamPolicy permission of all the IAM policies. + // Callers should have cloud.assets.SearchAllIamPolicies permission on the + // requested scope, otherwise it will be rejected. + rpc SearchAllIamPolicies(SearchAllIamPoliciesRequest) returns (SearchAllIamPoliciesResponse) { + option (google.api.http) = { + get: "/v1p1beta1/{scope=*/*}/iamPolicies:searchAll" + }; + option (google.api.method_signature) = "scope,query"; + } +} + +// Search resource request. +message SearchResourcesRequest { + // Required. The relative name of an asset. The search is limited to the resources + // within the `scope`. The allowed value must be: + // * Organization number (such as "organizations/123") + // * Folder number(such as "folders/1234") + // * Project number (such as "projects/12345") + string scope = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The query statement. + string query = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of asset types that this request searches for. If empty, it will + // search all the supported asset types. + repeated string asset_types = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The page size for search result pagination. Returned results may be fewer + // than requested. The value of this field is capped at 2000. If set to the + // zero value, server will pick an appropriate default. + int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If present, then retrieve the next batch of results from the preceding call + // to this method. `page_token` must be the value of `next_page_token` from + // the previous response. The values of all other method parameters, must be + // identical to those in the previous call. + string page_token = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Search resource response. +message SearchResourcesResponse { + // A list of resource that match the search query. + repeated StandardResourceMetadata results = 1; + + // If there are more results than those appearing in this response, then + // `next_page_token` is included. To get the next set of results, call this + // method again using the value of `next_page_token` as `page_token`. + string next_page_token = 2; +} + +// Search IAM policies request. +message SearchIamPoliciesRequest { + // Required. The relative name of an asset. The search is limited to the resources + // within the `scope`. The allowed value must be: + // * Organization number (such as "organizations/123") + // * Folder number(such as "folders/1234") + // * Project number (such as "projects/12345") + string scope = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The query statement. + // Examples: + // * "policy:myuser@mydomain.com" + // * "policy:(myuser@mydomain.com viewer)" + string query = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The page size for search result pagination. Returned results may be fewer + // than requested. The maximum is 2000. If set to the zero value, the server + // will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If present, retrieve the next batch of results from the preceding call to + // this method. `page_token` must be the value of `next_page_token` from the + // previous response. The values of all other method parameters must be + // identical to those in the previous call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Search IAM policies response. +message SearchIamPoliciesResponse { + // A list of IamPolicy that match the search query. Related information such + // as the associated resource is returned along with the policy. + repeated IamPolicySearchResult results = 1; + + // Set if there are more results than those appearing in this response; to get + // the next set of results, call this method again, using this value as the + // `page_token`. + string next_page_token = 2; +} + +// Search all resources request. +message SearchAllResourcesRequest { + // Required. The relative name of an asset. The search is limited to the resources + // within the `scope`. The allowed value must be: + // * Organization number (such as "organizations/123") + // * Folder number(such as "folders/1234") + // * Project number (such as "projects/12345") + string scope = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The query statement. + string query = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of asset types that this request searches for. If empty, it will + // search all the supported asset types. + repeated string asset_types = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The page size for search result pagination. Returned results may be fewer + // than requested. The value of this field is capped at 2000. If set to the + // zero value, server will pick an appropriate default. + int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If present, then retrieve the next batch of results from the preceding call + // to this method. `page_token` must be the value of `next_page_token` from + // the previous response. The values of all other method parameters, must be + // identical to those in the previous call. + string page_token = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Search all resources response. +message SearchAllResourcesResponse { + // A list of resource that match the search query. + repeated StandardResourceMetadata results = 1; + + // If there are more results than those appearing in this response, then + // `next_page_token` is included. To get the next set of results, call this + // method again using the value of `next_page_token` as `page_token`. + string next_page_token = 2; +} + +// Search all IAM policies request. +message SearchAllIamPoliciesRequest { + // Required. The relative name of an asset. The search is limited to the resources + // within the `scope`. The allowed value must be: + // * Organization number (such as "organizations/123") + // * Folder number(such as "folders/1234") + // * Project number (such as "projects/12345") + string scope = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The query statement. + // Examples: + // * "policy:myuser@mydomain.com" + // * "policy:(myuser@mydomain.com viewer)" + string query = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The page size for search result pagination. Returned results may be fewer + // than requested. The maximum is 2000. If set to the zero value, the server + // will pick an appropriate default. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If present, retrieve the next batch of results from the preceding call to + // this method. `page_token` must be the value of `next_page_token` from the + // previous response. The values of all other method parameters must be + // identical to those in the previous call. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Search all IAM policies response. +message SearchAllIamPoliciesResponse { + // A list of IamPolicy that match the search query. Related information such + // as the associated resource is returned along with the policy. + repeated IamPolicySearchResult results = 1; + + // Set if there are more results than those appearing in this response; to get + // the next set of results, call this method again, using this value as the + // `page_token`. + string next_page_token = 2; +} diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/assets.proto new file mode 100644 index 00000000000..ff0b927b13a --- /dev/null +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/assets.proto @@ -0,0 +1,78 @@ +// Copyright 2019 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.asset.v1p1beta1; + +import "google/iam/v1/policy.proto"; +import "google/api/annotations.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Asset.V1P1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1p1beta1;asset"; +option java_multiple_files = true; +option java_outer_classname = "AssetProto"; +option java_package = "com.google.cloud.asset.v1p1beta1"; +option php_namespace = "Google\\Cloud\\Asset\\V1p1beta1"; + +// The standard metadata of a cloud resource. +message StandardResourceMetadata { + // The full resource name. For example: + // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + // See [Resource + // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // for more information. + string name = 1; + + // The type of this resource. + // For example: "compute.googleapis.com/Disk". + string asset_type = 2; + + // The project that this resource belongs to, in the form of + // `projects/{project_number}`. + string project = 3; + + // The display name of this resource. + string display_name = 4; + + // One or more paragraphs of text description of this resource. Maximum length + // could be up to 1M bytes. + string description = 5; + + // Additional searchable attributes of this resource. + // Informational only. The exact set of attributes is subject to change. + // For example: project id, DNS name etc. + repeated string additional_attributes = 10; +} + +// The result for a IAM Policy search. +message IamPolicySearchResult { + // The [full resource + // name](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // of the resource associated with this IAM policy. + string resource = 1; + + // The project that the associated GCP resource belongs to, in the form of + // `projects/{project_number}`. If an IAM policy is set on a resource (like VM + // instance, Cloud Storage bucket), the project field will indicate the + // project that contains the resource. If an IAM policy is set on a folder or + // orgnization, the project field will be empty. + string project = 3; + + // Representation of the actual Cloud IAM policy set on a cloud resource. For + // each resource, there must be at most one Cloud IAM policy set on it. + google.iam.v1.Policy policy = 4; +} diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/asset_service.proto index 0d461d0fa81..7925bba6878 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/asset_service.proto @@ -18,12 +18,14 @@ syntax = "proto3"; package google.cloud.asset.v1p2beta1; import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; import "google/cloud/asset/v1p2beta1/assets.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/client.proto"; option csharp_namespace = "Google.Cloud.Asset.V1p2Beta1"; option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1p2beta1;asset"; @@ -37,28 +39,6 @@ service AssetService { option (google.api.default_host) = "cloudasset.googleapis.com"; option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - // Exports assets with time and resource types to a given Cloud Storage - // location. The output format is newline-delimited JSON. - // This API implements the [google.longrunning.Operation][google.longrunning.Operation] API allowing you - // to keep track of the export. - rpc ExportAssets(ExportAssetsRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1p2beta1/{parent=*/*}:exportAssets" - body: "*" - }; - } - - // Batch gets the update history of assets that overlap a time window. - // For RESOURCE content, this API outputs history with asset in both - // non-delete or deleted status. - // For IAM_POLICY content, this API outputs history when the asset and its - // attached IAM POLICY both exist. This can create gaps in the output history. - rpc BatchGetAssetsHistory(BatchGetAssetsHistoryRequest) returns (BatchGetAssetsHistoryResponse) { - option (google.api.http) = { - get: "/v1p2beta1/{parent=*/*}:batchGetAssetsHistory" - }; - } - // Creates a feed in a parent project/folder/organization to listen to its // asset updates. rpc CreateFeed(CreateFeedRequest) returns (Feed) { @@ -66,6 +46,7 @@ service AssetService { post: "/v1p2beta1/{parent=*/*}/feeds" body: "*" }; + option (google.api.method_signature) = "parent"; } // Gets details about an asset feed. @@ -73,6 +54,7 @@ service AssetService { option (google.api.http) = { get: "/v1p2beta1/{name=*/*/feeds/*}" }; + option (google.api.method_signature) = "name"; } // Lists all asset feeds in a parent project/folder/organization. @@ -80,6 +62,7 @@ service AssetService { option (google.api.http) = { get: "/v1p2beta1/{parent=*/*}/feeds" }; + option (google.api.method_signature) = "parent"; } // Updates an asset feed configuration. @@ -88,6 +71,7 @@ service AssetService { patch: "/v1p2beta1/{feed.name=*/*/feeds/*}" body: "*" }; + option (google.api.method_signature) = "feed"; } // Deletes an asset feed. @@ -95,88 +79,10 @@ service AssetService { option (google.api.http) = { delete: "/v1p2beta1/{name=*/*/feeds/*}" }; + option (google.api.method_signature) = "name"; } } -// Export asset request. -message ExportAssetsRequest { - // Required. The relative name of the root asset. This can only be an - // organization number (such as "organizations/123"), a project ID (such as - // "projects/my-project-id"), or a project number (such as "projects/12345"). - string parent = 1; - - // Timestamp to take an asset snapshot. This can only be set to a timestamp - // between 2018-10-02 UTC (inclusive) and the current time. If not specified, - // the current time will be used. Due to delays in resource data collection - // and indexing, there is a volatile window during which running the same - // query may get different results. - google.protobuf.Timestamp read_time = 2; - - // A list of asset types of which to take a snapshot for. For example: - // "compute.googleapis.com/Disk". If specified, only matching assets will be - // returned. See [Introduction to Cloud Asset - // Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) - // for all supported asset types. - repeated string asset_types = 3; - - // Asset content type. If not specified, no content but the asset name will be - // returned. - ContentType content_type = 4; - - // Required. Output configuration indicating where the results will be output - // to. All results will be in newline delimited JSON format. - OutputConfig output_config = 5; -} - -// The export asset response. This message is returned by the -// [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] method in the returned -// [google.longrunning.Operation.response][google.longrunning.Operation.response] field. -message ExportAssetsResponse { - // Time the snapshot was taken. - google.protobuf.Timestamp read_time = 1; - - // Output configuration indicating where the results were output to. - // All results are in JSON format. - OutputConfig output_config = 2; -} - -// Batch get assets history request. -message BatchGetAssetsHistoryRequest { - // Required. The relative name of the root asset. It can only be an - // organization number (such as "organizations/123"), a project ID (such as - // "projects/my-project-id")", or a project number (such as "projects/12345"). - string parent = 1; - - // A list of the full names of the assets. For example: - // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. - // See [Resource - // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) - // and [Resource Name - // Format](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/resource-name-format) - // for more info. - // - // The request becomes a no-op if the asset name list is empty, and the max - // size of the asset name list is 100 in one request. - repeated string asset_names = 2; - - // Required. The content type. - ContentType content_type = 3; - - // Optional. The time window for the asset history. Both start_time and - // end_time are optional and if set, it must be after 2018-10-02 UTC. If - // end_time is not set, it is default to current timestamp. If start_time is - // not set, the snapshot of the assets at end_time will be returned. The - // returned results contain all temporal assets whose time window overlap with - // read_time_window. - TimeWindow read_time_window = 4; -} - -// Batch get assets history response. -message BatchGetAssetsHistoryResponse { - // A list of assets with valid time windows. - repeated TemporalAsset assets = 1; -} - // Create asset feed request. message CreateFeedRequest { // Required. The name of the project/folder/organization where this feed @@ -184,27 +90,32 @@ message CreateFeedRequest { // "organizations/123"), a folder number (such as "folders/123"), a project ID // (such as "projects/my-project-id")", or a project number (such as // "projects/12345"). - string parent = 1; + string parent = 1 [(google.api.field_behavior) = REQUIRED]; // Required. This is the client-assigned asset feed identifier and it needs to // be unique under a specific parent project/folder/organization. - string feed_id = 2; + string feed_id = 2 [(google.api.field_behavior) = REQUIRED]; - // The feed details. The field `name` must be empty and it will be generated + // Required. The feed details. The field `name` must be empty and it will be generated // in the format of: // projects/project_number/feeds/feed_id // folders/folder_number/feeds/feed_id // organizations/organization_number/feeds/feed_id - Feed feed = 3; + Feed feed = 3 [(google.api.field_behavior) = REQUIRED]; } // Get asset feed request. message GetFeedRequest { - // The name of the Feed and it must be in the format of: + // Required. The name of the Feed and it must be in the format of: // projects/project_number/feeds/feed_id // folders/folder_number/feeds/feed_id // organizations/organization_number/feeds/feed_id - string name = 1; + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudasset.googleapis.com/Feed" + } + ]; } // List asset feeds request. @@ -212,10 +123,9 @@ message ListFeedsRequest { // Required. The parent project/folder/organization whose feeds are to be // listed. It can only be using project/folder/organization number (such as // "folders/12345")", or a project ID (such as "projects/my-project-id"). - string parent = 1; + string parent = 1 [(google.api.field_behavior) = REQUIRED]; } -// List asset feeds response. message ListFeedsResponse { // A list of feeds. repeated Feed feeds = 1; @@ -223,26 +133,30 @@ message ListFeedsResponse { // Update asset feed request. message UpdateFeedRequest { - // The new values of feed details. It must match an existing feed and the + // Required. The new values of feed details. It must match an existing feed and the // field `name` must be in the format of: // projects/project_number/feeds/feed_id or // folders/folder_number/feeds/feed_id or // organizations/organization_number/feeds/feed_id. - Feed feed = 1; + Feed feed = 1 [(google.api.field_behavior) = REQUIRED]; - // Only updates the `feed` fields indicated by this mask. + // Required. Only updates the `feed` fields indicated by this mask. // The field mask must not be empty, and it must not contain fields that // are immutable or only set by the server. - google.protobuf.FieldMask update_mask = 2; + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; } -// Delete asset feed request. message DeleteFeedRequest { - // The name of the feed and it must be in the format of: + // Required. The name of the feed and it must be in the format of: // projects/project_number/feeds/feed_id // folders/folder_number/feeds/feed_id // organizations/organization_number/feeds/feed_id - string name = 1; + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudasset.googleapis.com/Feed" + } + ]; } // Output configuration for export assets destination. @@ -251,12 +165,6 @@ message OutputConfig { oneof destination { // Destination on Cloud Storage. GcsDestination gcs_destination = 1; - - // Destination on Bigquery. The output table stores the fields in asset - // proto as columns in BigQuery. The resource/iam_policy field is converted - // to a record with each field to a column, except metadata to a single JSON - // string. - BigQueryDestination bigquery_destination = 2; } } @@ -270,40 +178,9 @@ message GcsDestination { // Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) // for more information. string uri = 1; - - // The uri prefix of all generated Cloud Storage objects. For example: - // "gs://bucket_name/object_name_prefix". Each object uri is in format: - // "gs://bucket_name/object_name_prefix// and only - // contains assets for that type. starts from 0. For example: - // "gs://bucket_name/object_name_prefix/compute.googleapis.com/Disk/0" is - // the first shard of output objects containing all - // compute.googleapis.com/Disk assets. An INVALID_ARGUMENT error will be - // returned if file with the same name "gs://bucket_name/object_name_prefix" - // already exists. - string uri_prefix = 2; } } -// A Bigquery destination. -message BigQueryDestination { - // Required. The BigQuery dataset in format - // "projects/projectId/datasets/datasetId", to which the snapshot result - // should be exported. If this dataset does not exist, the export call returns - // an error. - string dataset = 1; - - // Required. The BigQuery table to which the snapshot result should be - // written. If this table does not exist, a new table with the given name - // will be created. - string table = 2; - - // If the destination table already exists and this flag is `TRUE`, the - // table will be overwritten by the contents of assets snapshot. If the flag - // is not set and the destination table already exists, the export call - // returns an error. - bool force = 3; -} - // A Cloud Pubsub destination. message PubsubDestination { // The name of the Cloud Pub/Sub topic to publish to. @@ -311,26 +188,6 @@ message PubsubDestination { string topic = 1; } -// Asset content type. -enum ContentType { - // Unspecified content type. - CONTENT_TYPE_UNSPECIFIED = 0; - - // Resource metadata. - RESOURCE = 1; - - // The actual IAM policy set on a resource. - IAM_POLICY = 2; - - // The IAM policy name for the IAM policy set on a resource. - IAM_POLICY_NAME = 3; - - ORG_POLICY = 4; - - // The Cloud Access context mananger Policy set on an asset. - ACCESS_POLICY = 5; -} - // Output configuration for asset feed destination. message FeedOutputConfig { // Asset feed destination. @@ -346,6 +203,14 @@ message FeedOutputConfig { // folder. Supported destinations are: // Cloud Pub/Sub topics. message Feed { + option (google.api.resource) = { + type: "cloudasset.googleapis.com/Feed" + pattern: "projects/{project}/feeds/{feed}" + pattern: "folders/{folder}/feeds/{feed}" + pattern: "organizations/{organization}/feeds/{feed}" + history: ORIGINALLY_SINGLE_PATTERN + }; + // Required. The format will be // projects/{project_number}/feeds/{client-assigned_feed_identifier} or // folders/{folder_number}/feeds/{client-assigned_feed_identifier} or @@ -353,7 +218,7 @@ message Feed { // // The client-assigned feed identifier must be unique within the parent // project/folder/organization. - string name = 1; + string name = 1 [(google.api.field_behavior) = REQUIRED]; // A list of the full names of the assets to receive updates. You must specify // either or both of asset_names and asset_types. Only asset updates matching @@ -380,5 +245,17 @@ message Feed { // Required. Feed output configuration defining where the asset updates are // published to. - FeedOutputConfig feed_output_config = 5; + FeedOutputConfig feed_output_config = 5 [(google.api.field_behavior) = REQUIRED]; +} + +// Asset content type. +enum ContentType { + // Unspecified content type. + CONTENT_TYPE_UNSPECIFIED = 0; + + // Resource metadata. + RESOURCE = 1; + + // The actual IAM policy set on a resource. + IAM_POLICY = 2; } diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/assets.proto index a9cda898a35..8fee229bbc3 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/assets.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/assets.proto @@ -74,15 +74,10 @@ message Asset { // each resource, there must be at most one Cloud IAM policy set on it. google.iam.v1.Policy iam_policy = 4; - // Cloud IAM policy name of the Cloud IAM policy set on a cloud resource. For - // each resource, there must be at most one Cloud IAM policy name associated - // with it. - bytes iam_policy_name = 5; - // Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy, // represented as a list of relative resource names. Ancestry path starts with - // the closest CRM ancestor and ending at a visible root. If the asset is a - // CRM project/ folder/organization, this starts from the asset itself. + // the closest CRM ancestor and ends at root. If the asset is a CRM + // project/folder/organization, this starts from the asset itself. // // Example: ["projects/123456789", "folders/5432", "organizations/1234"] repeated string ancestors = 6; @@ -128,8 +123,4 @@ message Resource { // The content of the resource, in which some sensitive fields are scrubbed // away and may not be present. google.protobuf.Struct data = 6; - - // The actual metadata content for the resource, only visible for internal - // users. - google.protobuf.Any internal_data = 7; } diff --git a/packages/google-cloud-asset/protos/google/cloud/common_resources.proto b/packages/google-cloud-asset/protos/google/cloud/common_resources.proto new file mode 100644 index 00000000000..56c9f800d5e --- /dev/null +++ b/packages/google-cloud-asset/protos/google/cloud/common_resources.proto @@ -0,0 +1,52 @@ +// Copyright 2019 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. + +// This file contains stub messages for common resources in GCP. +// It is not intended to be directly generated, and is instead used by +// other tooling to be able to match common resource patterns. +syntax = "proto3"; + +package google.cloud; + +import "google/api/resource.proto"; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Project" + pattern: "projects/{project}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Organization" + pattern: "organizations/{organization}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Folder" + pattern: "folders/{folder}" +}; + + +option (google.api.resource_definition) = { + type: "cloudbilling.googleapis.com/BillingAccount" + pattern: "billingAccounts/{billing_account}" +}; + +option (google.api.resource_definition) = { + type: "locations.googleapis.com/Location" + pattern: "projects/{project}/locations/{location}" +}; + diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index 4b13f0dd1b1..5c4491999a5 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -26,2176 +26,2176 @@ export namespace google { /** Namespace v1. */ namespace v1 { - /** Represents an AssetService */ - class AssetService extends $protobuf.rpc.Service { + /** Properties of a TemporalAsset. */ + interface ITemporalAsset { - /** - * Constructs a new AssetService 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); + /** TemporalAsset window */ + window?: (google.cloud.asset.v1.ITimeWindow|null); - /** - * Creates new AssetService 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): AssetService; + /** TemporalAsset deleted */ + deleted?: (boolean|null); - /** - * Calls ExportAssets. - * @param request ExportAssetsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public exportAssets(request: google.cloud.asset.v1.IExportAssetsRequest, callback: google.cloud.asset.v1.AssetService.ExportAssetsCallback): void; + /** TemporalAsset asset */ + asset?: (google.cloud.asset.v1.IAsset|null); + } + + /** Represents a TemporalAsset. */ + class TemporalAsset implements ITemporalAsset { /** - * Calls ExportAssets. - * @param request ExportAssetsRequest message or plain object - * @returns Promise + * Constructs a new TemporalAsset. + * @param [properties] Properties to set */ - public exportAssets(request: google.cloud.asset.v1.IExportAssetsRequest): Promise; + constructor(properties?: google.cloud.asset.v1.ITemporalAsset); + + /** TemporalAsset window. */ + public window?: (google.cloud.asset.v1.ITimeWindow|null); + + /** TemporalAsset deleted. */ + public deleted: boolean; + + /** TemporalAsset asset. */ + public asset?: (google.cloud.asset.v1.IAsset|null); /** - * Calls BatchGetAssetsHistory. - * @param request BatchGetAssetsHistoryRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BatchGetAssetsHistoryResponse + * Creates a new TemporalAsset instance using the specified properties. + * @param [properties] Properties to set + * @returns TemporalAsset instance */ - public batchGetAssetsHistory(request: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, callback: google.cloud.asset.v1.AssetService.BatchGetAssetsHistoryCallback): void; + public static create(properties?: google.cloud.asset.v1.ITemporalAsset): google.cloud.asset.v1.TemporalAsset; /** - * Calls BatchGetAssetsHistory. - * @param request BatchGetAssetsHistoryRequest message or plain object - * @returns Promise + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public batchGetAssetsHistory(request: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest): Promise; + public static encode(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls CreateFeed. - * @param request CreateFeedRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Feed + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public createFeed(request: google.cloud.asset.v1.ICreateFeedRequest, callback: google.cloud.asset.v1.AssetService.CreateFeedCallback): void; + public static encodeDelimited(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls CreateFeed. - * @param request CreateFeedRequest message or plain object - * @returns Promise + * Decodes a TemporalAsset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TemporalAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public createFeed(request: google.cloud.asset.v1.ICreateFeedRequest): Promise; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.TemporalAsset; /** - * Calls GetFeed. - * @param request GetFeedRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Feed + * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TemporalAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public getFeed(request: google.cloud.asset.v1.IGetFeedRequest, callback: google.cloud.asset.v1.AssetService.GetFeedCallback): void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.TemporalAsset; /** - * Calls GetFeed. - * @param request GetFeedRequest message or plain object - * @returns Promise + * Verifies a TemporalAsset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public getFeed(request: google.cloud.asset.v1.IGetFeedRequest): Promise; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls ListFeeds. - * @param request ListFeedsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListFeedsResponse + * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TemporalAsset */ - public listFeeds(request: google.cloud.asset.v1.IListFeedsRequest, callback: google.cloud.asset.v1.AssetService.ListFeedsCallback): void; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.TemporalAsset; /** - * Calls ListFeeds. - * @param request ListFeedsRequest message or plain object - * @returns Promise + * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * @param message TemporalAsset + * @param [options] Conversion options + * @returns Plain object */ - public listFeeds(request: google.cloud.asset.v1.IListFeedsRequest): Promise; + public static toObject(message: google.cloud.asset.v1.TemporalAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls UpdateFeed. - * @param request UpdateFeedRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Feed + * Converts this TemporalAsset to JSON. + * @returns JSON object */ - public updateFeed(request: google.cloud.asset.v1.IUpdateFeedRequest, callback: google.cloud.asset.v1.AssetService.UpdateFeedCallback): void; + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TimeWindow. */ + interface ITimeWindow { + + /** TimeWindow startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** TimeWindow endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a TimeWindow. */ + class TimeWindow implements ITimeWindow { /** - * Calls UpdateFeed. - * @param request UpdateFeedRequest message or plain object - * @returns Promise + * Constructs a new TimeWindow. + * @param [properties] Properties to set */ - public updateFeed(request: google.cloud.asset.v1.IUpdateFeedRequest): Promise; + constructor(properties?: google.cloud.asset.v1.ITimeWindow); + + /** TimeWindow startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** TimeWindow endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); /** - * Calls DeleteFeed. - * @param request DeleteFeedRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * Creates a new TimeWindow instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeWindow instance */ - public deleteFeed(request: google.cloud.asset.v1.IDeleteFeedRequest, callback: google.cloud.asset.v1.AssetService.DeleteFeedCallback): void; + public static create(properties?: google.cloud.asset.v1.ITimeWindow): google.cloud.asset.v1.TimeWindow; /** - * Calls DeleteFeed. - * @param request DeleteFeedRequest message or plain object - * @returns Promise + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. + * @param message TimeWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public deleteFeed(request: google.cloud.asset.v1.IDeleteFeedRequest): Promise; - } - - namespace AssetService { + public static encode(message: google.cloud.asset.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#exportAssets}. - * @param error Error, if any - * @param [response] Operation + * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. + * @param message TimeWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type ExportAssetsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static encodeDelimited(message: google.cloud.asset.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#batchGetAssetsHistory}. - * @param error Error, if any - * @param [response] BatchGetAssetsHistoryResponse + * Decodes a TimeWindow message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type BatchGetAssetsHistoryCallback = (error: (Error|null), response?: google.cloud.asset.v1.BatchGetAssetsHistoryResponse) => void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.TimeWindow; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#createFeed}. - * @param error Error, if any - * @param [response] Feed + * Decodes a TimeWindow message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type CreateFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1.Feed) => void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.TimeWindow; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#getFeed}. - * @param error Error, if any - * @param [response] Feed + * Verifies a TimeWindow message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type GetFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1.Feed) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#listFeeds}. - * @param error Error, if any - * @param [response] ListFeedsResponse + * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeWindow */ - type ListFeedsCallback = (error: (Error|null), response?: google.cloud.asset.v1.ListFeedsResponse) => void; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.TimeWindow; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#updateFeed}. - * @param error Error, if any - * @param [response] Feed + * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. + * @param message TimeWindow + * @param [options] Conversion options + * @returns Plain object */ - type UpdateFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1.Feed) => void; + public static toObject(message: google.cloud.asset.v1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Callback as used by {@link google.cloud.asset.v1.AssetService#deleteFeed}. - * @param error Error, if any - * @param [response] Empty + * Converts this TimeWindow to JSON. + * @returns JSON object */ - type DeleteFeedCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + public toJSON(): { [k: string]: any }; } - /** Properties of an ExportAssetsRequest. */ - interface IExportAssetsRequest { + /** Properties of an Asset. */ + interface IAsset { - /** ExportAssetsRequest parent */ - parent?: (string|null); + /** Asset name */ + name?: (string|null); - /** ExportAssetsRequest readTime */ - readTime?: (google.protobuf.ITimestamp|null); + /** Asset assetType */ + assetType?: (string|null); - /** ExportAssetsRequest assetTypes */ - assetTypes?: (string[]|null); + /** Asset resource */ + resource?: (google.cloud.asset.v1.IResource|null); - /** ExportAssetsRequest contentType */ - contentType?: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType|null); + /** Asset iamPolicy */ + iamPolicy?: (google.iam.v1.IPolicy|null); - /** ExportAssetsRequest outputConfig */ - outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); + /** Asset ancestors */ + ancestors?: (string[]|null); } - /** Represents an ExportAssetsRequest. */ - class ExportAssetsRequest implements IExportAssetsRequest { + /** Represents an Asset. */ + class Asset implements IAsset { /** - * Constructs a new ExportAssetsRequest. + * Constructs a new Asset. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IExportAssetsRequest); + constructor(properties?: google.cloud.asset.v1.IAsset); - /** ExportAssetsRequest parent. */ - public parent: string; + /** Asset name. */ + public name: string; - /** ExportAssetsRequest readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); + /** Asset assetType. */ + public assetType: string; - /** ExportAssetsRequest assetTypes. */ - public assetTypes: string[]; + /** Asset resource. */ + public resource?: (google.cloud.asset.v1.IResource|null); - /** ExportAssetsRequest contentType. */ - public contentType: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType); + /** Asset iamPolicy. */ + public iamPolicy?: (google.iam.v1.IPolicy|null); - /** ExportAssetsRequest outputConfig. */ - public outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); + /** Asset ancestors. */ + public ancestors: string[]; /** - * Creates a new ExportAssetsRequest instance using the specified properties. + * Creates a new Asset instance using the specified properties. * @param [properties] Properties to set - * @returns ExportAssetsRequest instance + * @returns Asset instance */ - public static create(properties?: google.cloud.asset.v1.IExportAssetsRequest): google.cloud.asset.v1.ExportAssetsRequest; + public static create(properties?: google.cloud.asset.v1.IAsset): google.cloud.asset.v1.Asset; /** - * Encodes the specified ExportAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsRequest.verify|verify} messages. - * @param message ExportAssetsRequest message or plain object to encode + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ExportAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsRequest.verify|verify} messages. - * @param message ExportAssetsRequest message or plain object to encode + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExportAssetsRequest message from the specified reader or buffer. + * Decodes an Asset message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ExportAssetsRequest + * @returns Asset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.ExportAssetsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.Asset; /** - * Decodes an ExportAssetsRequest message from the specified reader or buffer, length delimited. + * Decodes an Asset message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExportAssetsRequest + * @returns Asset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.ExportAssetsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.Asset; /** - * Verifies an ExportAssetsRequest message. + * Verifies an Asset message. * @param message Plain 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 ExportAssetsRequest message from a plain object. Also converts values to their respective internal types. + * Creates an Asset message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExportAssetsRequest + * @returns Asset */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ExportAssetsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Asset; /** - * Creates a plain object from an ExportAssetsRequest message. Also converts values to other types if specified. - * @param message ExportAssetsRequest + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @param message Asset * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.ExportAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExportAssetsRequest to JSON. + * Converts this Asset to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an ExportAssetsResponse. */ - interface IExportAssetsResponse { + /** Properties of a Resource. */ + interface IResource { - /** ExportAssetsResponse readTime */ - readTime?: (google.protobuf.ITimestamp|null); + /** Resource version */ + version?: (string|null); - /** ExportAssetsResponse outputConfig */ - outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); + /** Resource discoveryDocumentUri */ + discoveryDocumentUri?: (string|null); + + /** Resource discoveryName */ + discoveryName?: (string|null); + + /** Resource resourceUrl */ + resourceUrl?: (string|null); + + /** Resource parent */ + parent?: (string|null); + + /** Resource data */ + data?: (google.protobuf.IStruct|null); } - /** Represents an ExportAssetsResponse. */ - class ExportAssetsResponse implements IExportAssetsResponse { + /** Represents a Resource. */ + class Resource implements IResource { /** - * Constructs a new ExportAssetsResponse. + * Constructs a new Resource. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IExportAssetsResponse); + constructor(properties?: google.cloud.asset.v1.IResource); - /** ExportAssetsResponse readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); + /** Resource version. */ + public version: string; - /** ExportAssetsResponse outputConfig. */ - public outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); + /** Resource discoveryDocumentUri. */ + public discoveryDocumentUri: string; + + /** Resource discoveryName. */ + public discoveryName: string; + + /** Resource resourceUrl. */ + public resourceUrl: string; + + /** Resource parent. */ + public parent: string; + + /** Resource data. */ + public data?: (google.protobuf.IStruct|null); /** - * Creates a new ExportAssetsResponse instance using the specified properties. + * Creates a new Resource instance using the specified properties. * @param [properties] Properties to set - * @returns ExportAssetsResponse instance + * @returns Resource instance */ - public static create(properties?: google.cloud.asset.v1.IExportAssetsResponse): google.cloud.asset.v1.ExportAssetsResponse; + public static create(properties?: google.cloud.asset.v1.IResource): google.cloud.asset.v1.Resource; /** - * Encodes the specified ExportAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsResponse.verify|verify} messages. - * @param message ExportAssetsResponse message or plain object to encode + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ExportAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsResponse.verify|verify} messages. - * @param message ExportAssetsResponse message or plain object to encode + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExportAssetsResponse message from the specified reader or buffer. + * Decodes a Resource message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ExportAssetsResponse + * @returns Resource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.ExportAssetsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.Resource; /** - * Decodes an ExportAssetsResponse message from the specified reader or buffer, length delimited. + * Decodes a Resource message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExportAssetsResponse + * @returns Resource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.ExportAssetsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.Resource; /** - * Verifies an ExportAssetsResponse message. + * Verifies a Resource message. * @param message Plain 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 ExportAssetsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a Resource message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExportAssetsResponse + * @returns Resource */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ExportAssetsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Resource; /** - * Creates a plain object from an ExportAssetsResponse message. Also converts values to other types if specified. - * @param message ExportAssetsResponse + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @param message Resource * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.ExportAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExportAssetsResponse to JSON. + * Converts this Resource to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BatchGetAssetsHistoryRequest. */ - interface IBatchGetAssetsHistoryRequest { - - /** BatchGetAssetsHistoryRequest parent */ - parent?: (string|null); - - /** BatchGetAssetsHistoryRequest assetNames */ - assetNames?: (string[]|null); - - /** BatchGetAssetsHistoryRequest contentType */ - contentType?: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType|null); - - /** BatchGetAssetsHistoryRequest readTimeWindow */ - readTimeWindow?: (google.cloud.asset.v1.ITimeWindow|null); - } - - /** Represents a BatchGetAssetsHistoryRequest. */ - class BatchGetAssetsHistoryRequest implements IBatchGetAssetsHistoryRequest { + /** Represents an AssetService */ + class AssetService extends $protobuf.rpc.Service { /** - * Constructs a new BatchGetAssetsHistoryRequest. - * @param [properties] Properties to set + * Constructs a new AssetService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited */ - constructor(properties?: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest); - - /** BatchGetAssetsHistoryRequest parent. */ - public parent: string; - - /** BatchGetAssetsHistoryRequest assetNames. */ - public assetNames: string[]; - - /** BatchGetAssetsHistoryRequest contentType. */ - public contentType: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType); - - /** BatchGetAssetsHistoryRequest readTimeWindow. */ - public readTimeWindow?: (google.cloud.asset.v1.ITimeWindow|null); + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); /** - * Creates a new BatchGetAssetsHistoryRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchGetAssetsHistoryRequest instance + * Creates new AssetService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. */ - public static create(properties?: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest): google.cloud.asset.v1.BatchGetAssetsHistoryRequest; + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): AssetService; /** - * Encodes the specified BatchGetAssetsHistoryRequest message. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryRequest.verify|verify} messages. - * @param message BatchGetAssetsHistoryRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls ExportAssets. + * @param request ExportAssetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static encode(message: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public exportAssets(request: google.cloud.asset.v1.IExportAssetsRequest, callback: google.cloud.asset.v1.AssetService.ExportAssetsCallback): void; /** - * Encodes the specified BatchGetAssetsHistoryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryRequest.verify|verify} messages. - * @param message BatchGetAssetsHistoryRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls ExportAssets. + * @param request ExportAssetsRequest message or plain object + * @returns Promise */ - public static encodeDelimited(message: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public exportAssets(request: google.cloud.asset.v1.IExportAssetsRequest): Promise; /** - * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchGetAssetsHistoryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls BatchGetAssetsHistory. + * @param request BatchGetAssetsHistoryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchGetAssetsHistoryResponse */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.BatchGetAssetsHistoryRequest; + public batchGetAssetsHistory(request: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, callback: google.cloud.asset.v1.AssetService.BatchGetAssetsHistoryCallback): void; /** - * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchGetAssetsHistoryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls BatchGetAssetsHistory. + * @param request BatchGetAssetsHistoryRequest message or plain object + * @returns Promise */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.BatchGetAssetsHistoryRequest; + public batchGetAssetsHistory(request: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest): Promise; /** - * Verifies a BatchGetAssetsHistoryRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls CreateFeed. + * @param request CreateFeedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Feed */ - public static verify(message: { [k: string]: any }): (string|null); + public createFeed(request: google.cloud.asset.v1.ICreateFeedRequest, callback: google.cloud.asset.v1.AssetService.CreateFeedCallback): void; /** - * Creates a BatchGetAssetsHistoryRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchGetAssetsHistoryRequest + * Calls CreateFeed. + * @param request CreateFeedRequest message or plain object + * @returns Promise */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BatchGetAssetsHistoryRequest; + public createFeed(request: google.cloud.asset.v1.ICreateFeedRequest): Promise; /** - * Creates a plain object from a BatchGetAssetsHistoryRequest message. Also converts values to other types if specified. - * @param message BatchGetAssetsHistoryRequest - * @param [options] Conversion options - * @returns Plain object + * Calls GetFeed. + * @param request GetFeedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Feed */ - public static toObject(message: google.cloud.asset.v1.BatchGetAssetsHistoryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public getFeed(request: google.cloud.asset.v1.IGetFeedRequest, callback: google.cloud.asset.v1.AssetService.GetFeedCallback): void; /** - * Converts this BatchGetAssetsHistoryRequest to JSON. - * @returns JSON object + * Calls GetFeed. + * @param request GetFeedRequest message or plain object + * @returns Promise */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a BatchGetAssetsHistoryResponse. */ - interface IBatchGetAssetsHistoryResponse { + public getFeed(request: google.cloud.asset.v1.IGetFeedRequest): Promise; - /** BatchGetAssetsHistoryResponse assets */ - assets?: (google.cloud.asset.v1.ITemporalAsset[]|null); - } + /** + * Calls ListFeeds. + * @param request ListFeedsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListFeedsResponse + */ + public listFeeds(request: google.cloud.asset.v1.IListFeedsRequest, callback: google.cloud.asset.v1.AssetService.ListFeedsCallback): void; - /** Represents a BatchGetAssetsHistoryResponse. */ - class BatchGetAssetsHistoryResponse implements IBatchGetAssetsHistoryResponse { + /** + * Calls ListFeeds. + * @param request ListFeedsRequest message or plain object + * @returns Promise + */ + public listFeeds(request: google.cloud.asset.v1.IListFeedsRequest): Promise; /** - * Constructs a new BatchGetAssetsHistoryResponse. - * @param [properties] Properties to set + * Calls UpdateFeed. + * @param request UpdateFeedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Feed */ - constructor(properties?: google.cloud.asset.v1.IBatchGetAssetsHistoryResponse); + public updateFeed(request: google.cloud.asset.v1.IUpdateFeedRequest, callback: google.cloud.asset.v1.AssetService.UpdateFeedCallback): void; - /** BatchGetAssetsHistoryResponse assets. */ - public assets: google.cloud.asset.v1.ITemporalAsset[]; + /** + * Calls UpdateFeed. + * @param request UpdateFeedRequest message or plain object + * @returns Promise + */ + public updateFeed(request: google.cloud.asset.v1.IUpdateFeedRequest): Promise; /** - * Creates a new BatchGetAssetsHistoryResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchGetAssetsHistoryResponse instance + * Calls DeleteFeed. + * @param request DeleteFeedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty */ - public static create(properties?: google.cloud.asset.v1.IBatchGetAssetsHistoryResponse): google.cloud.asset.v1.BatchGetAssetsHistoryResponse; + public deleteFeed(request: google.cloud.asset.v1.IDeleteFeedRequest, callback: google.cloud.asset.v1.AssetService.DeleteFeedCallback): void; /** - * Encodes the specified BatchGetAssetsHistoryResponse message. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryResponse.verify|verify} messages. - * @param message BatchGetAssetsHistoryResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls DeleteFeed. + * @param request DeleteFeedRequest message or plain object + * @returns Promise */ - public static encode(message: google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public deleteFeed(request: google.cloud.asset.v1.IDeleteFeedRequest): Promise; + } + + namespace AssetService { /** - * Encodes the specified BatchGetAssetsHistoryResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryResponse.verify|verify} messages. - * @param message BatchGetAssetsHistoryResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Callback as used by {@link google.cloud.asset.v1.AssetService#exportAssets}. + * @param error Error, if any + * @param [response] Operation */ - public static encodeDelimited(message: google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + type ExportAssetsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchGetAssetsHistoryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.asset.v1.AssetService#batchGetAssetsHistory}. + * @param error Error, if any + * @param [response] BatchGetAssetsHistoryResponse */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.BatchGetAssetsHistoryResponse; + type BatchGetAssetsHistoryCallback = (error: (Error|null), response?: google.cloud.asset.v1.BatchGetAssetsHistoryResponse) => void; /** - * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchGetAssetsHistoryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.asset.v1.AssetService#createFeed}. + * @param error Error, if any + * @param [response] Feed */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.BatchGetAssetsHistoryResponse; + type CreateFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1.Feed) => void; /** - * Verifies a BatchGetAssetsHistoryResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Callback as used by {@link google.cloud.asset.v1.AssetService#getFeed}. + * @param error Error, if any + * @param [response] Feed */ - public static verify(message: { [k: string]: any }): (string|null); + type GetFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1.Feed) => void; /** - * Creates a BatchGetAssetsHistoryResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchGetAssetsHistoryResponse + * Callback as used by {@link google.cloud.asset.v1.AssetService#listFeeds}. + * @param error Error, if any + * @param [response] ListFeedsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BatchGetAssetsHistoryResponse; + type ListFeedsCallback = (error: (Error|null), response?: google.cloud.asset.v1.ListFeedsResponse) => void; /** - * Creates a plain object from a BatchGetAssetsHistoryResponse message. Also converts values to other types if specified. - * @param message BatchGetAssetsHistoryResponse - * @param [options] Conversion options - * @returns Plain object + * Callback as used by {@link google.cloud.asset.v1.AssetService#updateFeed}. + * @param error Error, if any + * @param [response] Feed */ - public static toObject(message: google.cloud.asset.v1.BatchGetAssetsHistoryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + type UpdateFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1.Feed) => void; /** - * Converts this BatchGetAssetsHistoryResponse to JSON. - * @returns JSON object + * Callback as used by {@link google.cloud.asset.v1.AssetService#deleteFeed}. + * @param error Error, if any + * @param [response] Empty */ - public toJSON(): { [k: string]: any }; + type DeleteFeedCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; } - /** Properties of a CreateFeedRequest. */ - interface ICreateFeedRequest { + /** Properties of an ExportAssetsRequest. */ + interface IExportAssetsRequest { - /** CreateFeedRequest parent */ + /** ExportAssetsRequest parent */ parent?: (string|null); - /** CreateFeedRequest feedId */ - feedId?: (string|null); + /** ExportAssetsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); - /** CreateFeedRequest feed */ - feed?: (google.cloud.asset.v1.IFeed|null); + /** ExportAssetsRequest assetTypes */ + assetTypes?: (string[]|null); + + /** ExportAssetsRequest contentType */ + contentType?: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType|null); + + /** ExportAssetsRequest outputConfig */ + outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); } - /** Represents a CreateFeedRequest. */ - class CreateFeedRequest implements ICreateFeedRequest { + /** Represents an ExportAssetsRequest. */ + class ExportAssetsRequest implements IExportAssetsRequest { /** - * Constructs a new CreateFeedRequest. + * Constructs a new ExportAssetsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.ICreateFeedRequest); + constructor(properties?: google.cloud.asset.v1.IExportAssetsRequest); - /** CreateFeedRequest parent. */ + /** ExportAssetsRequest parent. */ public parent: string; - /** CreateFeedRequest feedId. */ - public feedId: string; + /** ExportAssetsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); - /** CreateFeedRequest feed. */ - public feed?: (google.cloud.asset.v1.IFeed|null); + /** ExportAssetsRequest assetTypes. */ + public assetTypes: string[]; + + /** ExportAssetsRequest contentType. */ + public contentType: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType); + + /** ExportAssetsRequest outputConfig. */ + public outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); /** - * Creates a new CreateFeedRequest instance using the specified properties. + * Creates a new ExportAssetsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateFeedRequest instance + * @returns ExportAssetsRequest instance */ - public static create(properties?: google.cloud.asset.v1.ICreateFeedRequest): google.cloud.asset.v1.CreateFeedRequest; + public static create(properties?: google.cloud.asset.v1.IExportAssetsRequest): google.cloud.asset.v1.ExportAssetsRequest; /** - * Encodes the specified CreateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.CreateFeedRequest.verify|verify} messages. - * @param message CreateFeedRequest message or plain object to encode + * Encodes the specified ExportAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsRequest.verify|verify} messages. + * @param message ExportAssetsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.ICreateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.CreateFeedRequest.verify|verify} messages. - * @param message CreateFeedRequest message or plain object to encode + * Encodes the specified ExportAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsRequest.verify|verify} messages. + * @param message ExportAssetsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.ICreateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateFeedRequest message from the specified reader or buffer. + * Decodes an ExportAssetsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateFeedRequest + * @returns ExportAssetsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.CreateFeedRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.ExportAssetsRequest; /** - * Decodes a CreateFeedRequest message from the specified reader or buffer, length delimited. + * Decodes an ExportAssetsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateFeedRequest + * @returns ExportAssetsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.CreateFeedRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.ExportAssetsRequest; /** - * Verifies a CreateFeedRequest message. + * Verifies an ExportAssetsRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateFeedRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ExportAssetsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateFeedRequest + * @returns ExportAssetsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.CreateFeedRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ExportAssetsRequest; /** - * Creates a plain object from a CreateFeedRequest message. Also converts values to other types if specified. - * @param message CreateFeedRequest + * Creates a plain object from an ExportAssetsRequest message. Also converts values to other types if specified. + * @param message ExportAssetsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.CreateFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.ExportAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateFeedRequest to JSON. + * Converts this ExportAssetsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetFeedRequest. */ - interface IGetFeedRequest { + /** Properties of an ExportAssetsResponse. */ + interface IExportAssetsResponse { - /** GetFeedRequest name */ - name?: (string|null); + /** ExportAssetsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ExportAssetsResponse outputConfig */ + outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); } - /** Represents a GetFeedRequest. */ - class GetFeedRequest implements IGetFeedRequest { + /** Represents an ExportAssetsResponse. */ + class ExportAssetsResponse implements IExportAssetsResponse { /** - * Constructs a new GetFeedRequest. + * Constructs a new ExportAssetsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IGetFeedRequest); + constructor(properties?: google.cloud.asset.v1.IExportAssetsResponse); - /** GetFeedRequest name. */ - public name: string; + /** ExportAssetsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ExportAssetsResponse outputConfig. */ + public outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); /** - * Creates a new GetFeedRequest instance using the specified properties. + * Creates a new ExportAssetsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns GetFeedRequest instance + * @returns ExportAssetsResponse instance */ - public static create(properties?: google.cloud.asset.v1.IGetFeedRequest): google.cloud.asset.v1.GetFeedRequest; + public static create(properties?: google.cloud.asset.v1.IExportAssetsResponse): google.cloud.asset.v1.ExportAssetsResponse; /** - * Encodes the specified GetFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.GetFeedRequest.verify|verify} messages. - * @param message GetFeedRequest message or plain object to encode + * Encodes the specified ExportAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsResponse.verify|verify} messages. + * @param message ExportAssetsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IGetFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GetFeedRequest.verify|verify} messages. - * @param message GetFeedRequest message or plain object to encode + * Encodes the specified ExportAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsResponse.verify|verify} messages. + * @param message ExportAssetsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IGetFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetFeedRequest message from the specified reader or buffer. + * Decodes an ExportAssetsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetFeedRequest + * @returns ExportAssetsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.GetFeedRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.ExportAssetsResponse; /** - * Decodes a GetFeedRequest message from the specified reader or buffer, length delimited. + * Decodes an ExportAssetsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetFeedRequest + * @returns ExportAssetsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.GetFeedRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.ExportAssetsResponse; /** - * Verifies a GetFeedRequest message. + * Verifies an ExportAssetsResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetFeedRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ExportAssetsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetFeedRequest + * @returns ExportAssetsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.GetFeedRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ExportAssetsResponse; /** - * Creates a plain object from a GetFeedRequest message. Also converts values to other types if specified. - * @param message GetFeedRequest + * Creates a plain object from an ExportAssetsResponse message. Also converts values to other types if specified. + * @param message ExportAssetsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.GetFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.ExportAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetFeedRequest to JSON. + * Converts this ExportAssetsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListFeedsRequest. */ - interface IListFeedsRequest { + /** Properties of a BatchGetAssetsHistoryRequest. */ + interface IBatchGetAssetsHistoryRequest { - /** ListFeedsRequest parent */ + /** BatchGetAssetsHistoryRequest parent */ parent?: (string|null); + + /** BatchGetAssetsHistoryRequest assetNames */ + assetNames?: (string[]|null); + + /** BatchGetAssetsHistoryRequest contentType */ + contentType?: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType|null); + + /** BatchGetAssetsHistoryRequest readTimeWindow */ + readTimeWindow?: (google.cloud.asset.v1.ITimeWindow|null); } - /** Represents a ListFeedsRequest. */ - class ListFeedsRequest implements IListFeedsRequest { + /** Represents a BatchGetAssetsHistoryRequest. */ + class BatchGetAssetsHistoryRequest implements IBatchGetAssetsHistoryRequest { /** - * Constructs a new ListFeedsRequest. + * Constructs a new BatchGetAssetsHistoryRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IListFeedsRequest); + constructor(properties?: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest); - /** ListFeedsRequest parent. */ + /** BatchGetAssetsHistoryRequest parent. */ public parent: string; + /** BatchGetAssetsHistoryRequest assetNames. */ + public assetNames: string[]; + + /** BatchGetAssetsHistoryRequest contentType. */ + public contentType: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType); + + /** BatchGetAssetsHistoryRequest readTimeWindow. */ + public readTimeWindow?: (google.cloud.asset.v1.ITimeWindow|null); + /** - * Creates a new ListFeedsRequest instance using the specified properties. + * Creates a new BatchGetAssetsHistoryRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListFeedsRequest instance + * @returns BatchGetAssetsHistoryRequest instance */ - public static create(properties?: google.cloud.asset.v1.IListFeedsRequest): google.cloud.asset.v1.ListFeedsRequest; + public static create(properties?: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest): google.cloud.asset.v1.BatchGetAssetsHistoryRequest; /** - * Encodes the specified ListFeedsRequest message. Does not implicitly {@link google.cloud.asset.v1.ListFeedsRequest.verify|verify} messages. - * @param message ListFeedsRequest message or plain object to encode + * Encodes the specified BatchGetAssetsHistoryRequest message. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryRequest.verify|verify} messages. + * @param message BatchGetAssetsHistoryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IListFeedsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListFeedsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListFeedsRequest.verify|verify} messages. - * @param message ListFeedsRequest message or plain object to encode + * Encodes the specified BatchGetAssetsHistoryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryRequest.verify|verify} messages. + * @param message BatchGetAssetsHistoryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IListFeedsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListFeedsRequest message from the specified reader or buffer. + * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListFeedsRequest + * @returns BatchGetAssetsHistoryRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.ListFeedsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.BatchGetAssetsHistoryRequest; /** - * Decodes a ListFeedsRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListFeedsRequest + * @returns BatchGetAssetsHistoryRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.ListFeedsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.BatchGetAssetsHistoryRequest; /** - * Verifies a ListFeedsRequest message. + * Verifies a BatchGetAssetsHistoryRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListFeedsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BatchGetAssetsHistoryRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListFeedsRequest + * @returns BatchGetAssetsHistoryRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ListFeedsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BatchGetAssetsHistoryRequest; /** - * Creates a plain object from a ListFeedsRequest message. Also converts values to other types if specified. - * @param message ListFeedsRequest + * Creates a plain object from a BatchGetAssetsHistoryRequest message. Also converts values to other types if specified. + * @param message BatchGetAssetsHistoryRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.ListFeedsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.BatchGetAssetsHistoryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListFeedsRequest to JSON. + * Converts this BatchGetAssetsHistoryRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListFeedsResponse. */ - interface IListFeedsResponse { + /** Properties of a BatchGetAssetsHistoryResponse. */ + interface IBatchGetAssetsHistoryResponse { - /** ListFeedsResponse feeds */ - feeds?: (google.cloud.asset.v1.IFeed[]|null); + /** BatchGetAssetsHistoryResponse assets */ + assets?: (google.cloud.asset.v1.ITemporalAsset[]|null); } - /** Represents a ListFeedsResponse. */ - class ListFeedsResponse implements IListFeedsResponse { + /** Represents a BatchGetAssetsHistoryResponse. */ + class BatchGetAssetsHistoryResponse implements IBatchGetAssetsHistoryResponse { /** - * Constructs a new ListFeedsResponse. + * Constructs a new BatchGetAssetsHistoryResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IListFeedsResponse); + constructor(properties?: google.cloud.asset.v1.IBatchGetAssetsHistoryResponse); - /** ListFeedsResponse feeds. */ - public feeds: google.cloud.asset.v1.IFeed[]; + /** BatchGetAssetsHistoryResponse assets. */ + public assets: google.cloud.asset.v1.ITemporalAsset[]; /** - * Creates a new ListFeedsResponse instance using the specified properties. + * Creates a new BatchGetAssetsHistoryResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ListFeedsResponse instance + * @returns BatchGetAssetsHistoryResponse instance */ - public static create(properties?: google.cloud.asset.v1.IListFeedsResponse): google.cloud.asset.v1.ListFeedsResponse; + public static create(properties?: google.cloud.asset.v1.IBatchGetAssetsHistoryResponse): google.cloud.asset.v1.BatchGetAssetsHistoryResponse; /** - * Encodes the specified ListFeedsResponse message. Does not implicitly {@link google.cloud.asset.v1.ListFeedsResponse.verify|verify} messages. - * @param message ListFeedsResponse message or plain object to encode + * Encodes the specified BatchGetAssetsHistoryResponse message. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * @param message BatchGetAssetsHistoryResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IListFeedsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListFeedsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListFeedsResponse.verify|verify} messages. - * @param message ListFeedsResponse message or plain object to encode + * Encodes the specified BatchGetAssetsHistoryResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * @param message BatchGetAssetsHistoryResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IListFeedsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListFeedsResponse message from the specified reader or buffer. + * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListFeedsResponse + * @returns BatchGetAssetsHistoryResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.ListFeedsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.BatchGetAssetsHistoryResponse; /** - * Decodes a ListFeedsResponse message from the specified reader or buffer, length delimited. + * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListFeedsResponse + * @returns BatchGetAssetsHistoryResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.ListFeedsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.BatchGetAssetsHistoryResponse; /** - * Verifies a ListFeedsResponse message. + * Verifies a BatchGetAssetsHistoryResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListFeedsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a BatchGetAssetsHistoryResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListFeedsResponse + * @returns BatchGetAssetsHistoryResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ListFeedsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BatchGetAssetsHistoryResponse; /** - * Creates a plain object from a ListFeedsResponse message. Also converts values to other types if specified. - * @param message ListFeedsResponse + * Creates a plain object from a BatchGetAssetsHistoryResponse message. Also converts values to other types if specified. + * @param message BatchGetAssetsHistoryResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.ListFeedsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.BatchGetAssetsHistoryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListFeedsResponse to JSON. + * Converts this BatchGetAssetsHistoryResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an UpdateFeedRequest. */ - interface IUpdateFeedRequest { + /** Properties of a CreateFeedRequest. */ + interface ICreateFeedRequest { - /** UpdateFeedRequest feed */ - feed?: (google.cloud.asset.v1.IFeed|null); + /** CreateFeedRequest parent */ + parent?: (string|null); - /** UpdateFeedRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** CreateFeedRequest feedId */ + feedId?: (string|null); + + /** CreateFeedRequest feed */ + feed?: (google.cloud.asset.v1.IFeed|null); } - /** Represents an UpdateFeedRequest. */ - class UpdateFeedRequest implements IUpdateFeedRequest { + /** Represents a CreateFeedRequest. */ + class CreateFeedRequest implements ICreateFeedRequest { /** - * Constructs a new UpdateFeedRequest. + * Constructs a new CreateFeedRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IUpdateFeedRequest); + constructor(properties?: google.cloud.asset.v1.ICreateFeedRequest); - /** UpdateFeedRequest feed. */ - public feed?: (google.cloud.asset.v1.IFeed|null); + /** CreateFeedRequest parent. */ + public parent: string; - /** UpdateFeedRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** CreateFeedRequest feedId. */ + public feedId: string; + + /** CreateFeedRequest feed. */ + public feed?: (google.cloud.asset.v1.IFeed|null); /** - * Creates a new UpdateFeedRequest instance using the specified properties. + * Creates a new CreateFeedRequest instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateFeedRequest instance + * @returns CreateFeedRequest instance */ - public static create(properties?: google.cloud.asset.v1.IUpdateFeedRequest): google.cloud.asset.v1.UpdateFeedRequest; + public static create(properties?: google.cloud.asset.v1.ICreateFeedRequest): google.cloud.asset.v1.CreateFeedRequest; /** - * Encodes the specified UpdateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.UpdateFeedRequest.verify|verify} messages. - * @param message UpdateFeedRequest message or plain object to encode + * Encodes the specified CreateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.CreateFeedRequest.verify|verify} messages. + * @param message CreateFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IUpdateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.ICreateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.UpdateFeedRequest.verify|verify} messages. - * @param message UpdateFeedRequest message or plain object to encode + * Encodes the specified CreateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.CreateFeedRequest.verify|verify} messages. + * @param message CreateFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IUpdateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.ICreateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateFeedRequest message from the specified reader or buffer. + * Decodes a CreateFeedRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateFeedRequest + * @returns CreateFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.UpdateFeedRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.CreateFeedRequest; /** - * Decodes an UpdateFeedRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateFeedRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateFeedRequest + * @returns CreateFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.UpdateFeedRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.CreateFeedRequest; /** - * Verifies an UpdateFeedRequest message. + * Verifies a CreateFeedRequest message. * @param message Plain 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 UpdateFeedRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateFeedRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateFeedRequest + * @returns CreateFeedRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.UpdateFeedRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.CreateFeedRequest; /** - * Creates a plain object from an UpdateFeedRequest message. Also converts values to other types if specified. - * @param message UpdateFeedRequest + * Creates a plain object from a CreateFeedRequest message. Also converts values to other types if specified. + * @param message CreateFeedRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.UpdateFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.CreateFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateFeedRequest to JSON. + * Converts this CreateFeedRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a DeleteFeedRequest. */ - interface IDeleteFeedRequest { + /** Properties of a GetFeedRequest. */ + interface IGetFeedRequest { - /** DeleteFeedRequest name */ + /** GetFeedRequest name */ name?: (string|null); } - /** Represents a DeleteFeedRequest. */ - class DeleteFeedRequest implements IDeleteFeedRequest { + /** Represents a GetFeedRequest. */ + class GetFeedRequest implements IGetFeedRequest { /** - * Constructs a new DeleteFeedRequest. + * Constructs a new GetFeedRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IDeleteFeedRequest); + constructor(properties?: google.cloud.asset.v1.IGetFeedRequest); - /** DeleteFeedRequest name. */ + /** GetFeedRequest name. */ public name: string; /** - * Creates a new DeleteFeedRequest instance using the specified properties. + * Creates a new GetFeedRequest instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteFeedRequest instance + * @returns GetFeedRequest instance */ - public static create(properties?: google.cloud.asset.v1.IDeleteFeedRequest): google.cloud.asset.v1.DeleteFeedRequest; + public static create(properties?: google.cloud.asset.v1.IGetFeedRequest): google.cloud.asset.v1.GetFeedRequest; /** - * Encodes the specified DeleteFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.DeleteFeedRequest.verify|verify} messages. - * @param message DeleteFeedRequest message or plain object to encode + * Encodes the specified GetFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.GetFeedRequest.verify|verify} messages. + * @param message GetFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IDeleteFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IGetFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.DeleteFeedRequest.verify|verify} messages. - * @param message DeleteFeedRequest message or plain object to encode + * Encodes the specified GetFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GetFeedRequest.verify|verify} messages. + * @param message GetFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IDeleteFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IGetFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteFeedRequest message from the specified reader or buffer. + * Decodes a GetFeedRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteFeedRequest + * @returns GetFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.DeleteFeedRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.GetFeedRequest; /** - * Decodes a DeleteFeedRequest message from the specified reader or buffer, length delimited. + * Decodes a GetFeedRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteFeedRequest + * @returns GetFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.DeleteFeedRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.GetFeedRequest; /** - * Verifies a DeleteFeedRequest message. + * Verifies a GetFeedRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteFeedRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetFeedRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteFeedRequest + * @returns GetFeedRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.DeleteFeedRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.GetFeedRequest; /** - * Creates a plain object from a DeleteFeedRequest message. Also converts values to other types if specified. - * @param message DeleteFeedRequest + * Creates a plain object from a GetFeedRequest message. Also converts values to other types if specified. + * @param message GetFeedRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.DeleteFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.GetFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteFeedRequest to JSON. + * Converts this GetFeedRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an OutputConfig. */ - interface IOutputConfig { - - /** OutputConfig gcsDestination */ - gcsDestination?: (google.cloud.asset.v1.IGcsDestination|null); + /** Properties of a ListFeedsRequest. */ + interface IListFeedsRequest { - /** OutputConfig bigqueryDestination */ - bigqueryDestination?: (google.cloud.asset.v1.IBigQueryDestination|null); + /** ListFeedsRequest parent */ + parent?: (string|null); } - /** Represents an OutputConfig. */ - class OutputConfig implements IOutputConfig { + /** Represents a ListFeedsRequest. */ + class ListFeedsRequest implements IListFeedsRequest { /** - * Constructs a new OutputConfig. + * Constructs a new ListFeedsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IOutputConfig); - - /** OutputConfig gcsDestination. */ - public gcsDestination?: (google.cloud.asset.v1.IGcsDestination|null); - - /** OutputConfig bigqueryDestination. */ - public bigqueryDestination?: (google.cloud.asset.v1.IBigQueryDestination|null); + constructor(properties?: google.cloud.asset.v1.IListFeedsRequest); - /** OutputConfig destination. */ - public destination?: ("gcsDestination"|"bigqueryDestination"); + /** ListFeedsRequest parent. */ + public parent: string; /** - * Creates a new OutputConfig instance using the specified properties. + * Creates a new ListFeedsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns OutputConfig instance + * @returns ListFeedsRequest instance */ - public static create(properties?: google.cloud.asset.v1.IOutputConfig): google.cloud.asset.v1.OutputConfig; + public static create(properties?: google.cloud.asset.v1.IListFeedsRequest): google.cloud.asset.v1.ListFeedsRequest; /** - * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1.OutputConfig.verify|verify} messages. - * @param message OutputConfig message or plain object to encode + * Encodes the specified ListFeedsRequest message. Does not implicitly {@link google.cloud.asset.v1.ListFeedsRequest.verify|verify} messages. + * @param message ListFeedsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IListFeedsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.OutputConfig.verify|verify} messages. - * @param message OutputConfig message or plain object to encode + * Encodes the specified ListFeedsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListFeedsRequest.verify|verify} messages. + * @param message ListFeedsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IListFeedsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an OutputConfig message from the specified reader or buffer. + * Decodes a ListFeedsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns OutputConfig + * @returns ListFeedsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.OutputConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.ListFeedsRequest; /** - * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * Decodes a ListFeedsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns OutputConfig + * @returns ListFeedsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.OutputConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.ListFeedsRequest; /** - * Verifies an OutputConfig message. + * Verifies a ListFeedsRequest message. * @param message Plain 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 OutputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a ListFeedsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns OutputConfig + * @returns ListFeedsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.OutputConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ListFeedsRequest; /** - * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. - * @param message OutputConfig + * Creates a plain object from a ListFeedsRequest message. Also converts values to other types if specified. + * @param message ListFeedsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.OutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.ListFeedsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this OutputConfig to JSON. + * Converts this ListFeedsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GcsDestination. */ - interface IGcsDestination { - - /** GcsDestination uri */ - uri?: (string|null); + /** Properties of a ListFeedsResponse. */ + interface IListFeedsResponse { - /** GcsDestination uriPrefix */ - uriPrefix?: (string|null); + /** ListFeedsResponse feeds */ + feeds?: (google.cloud.asset.v1.IFeed[]|null); } - /** Represents a GcsDestination. */ - class GcsDestination implements IGcsDestination { + /** Represents a ListFeedsResponse. */ + class ListFeedsResponse implements IListFeedsResponse { /** - * Constructs a new GcsDestination. + * Constructs a new ListFeedsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IGcsDestination); - - /** GcsDestination uri. */ - public uri: string; - - /** GcsDestination uriPrefix. */ - public uriPrefix: string; + constructor(properties?: google.cloud.asset.v1.IListFeedsResponse); - /** GcsDestination objectUri. */ - public objectUri?: ("uri"|"uriPrefix"); + /** ListFeedsResponse feeds. */ + public feeds: google.cloud.asset.v1.IFeed[]; /** - * Creates a new GcsDestination instance using the specified properties. + * Creates a new ListFeedsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns GcsDestination instance + * @returns ListFeedsResponse instance */ - public static create(properties?: google.cloud.asset.v1.IGcsDestination): google.cloud.asset.v1.GcsDestination; + public static create(properties?: google.cloud.asset.v1.IListFeedsResponse): google.cloud.asset.v1.ListFeedsResponse; /** - * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1.GcsDestination.verify|verify} messages. - * @param message GcsDestination message or plain object to encode + * Encodes the specified ListFeedsResponse message. Does not implicitly {@link google.cloud.asset.v1.ListFeedsResponse.verify|verify} messages. + * @param message ListFeedsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IListFeedsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GcsDestination.verify|verify} messages. - * @param message GcsDestination message or plain object to encode + * Encodes the specified ListFeedsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListFeedsResponse.verify|verify} messages. + * @param message ListFeedsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IListFeedsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GcsDestination message from the specified reader or buffer. + * Decodes a ListFeedsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GcsDestination + * @returns ListFeedsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.GcsDestination; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.ListFeedsResponse; /** - * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * Decodes a ListFeedsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GcsDestination + * @returns ListFeedsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.GcsDestination; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.ListFeedsResponse; /** - * Verifies a GcsDestination message. + * Verifies a ListFeedsResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * Creates a ListFeedsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GcsDestination + * @returns ListFeedsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.GcsDestination; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ListFeedsResponse; /** - * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. - * @param message GcsDestination + * Creates a plain object from a ListFeedsResponse message. Also converts values to other types if specified. + * @param message ListFeedsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.ListFeedsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GcsDestination to JSON. + * Converts this ListFeedsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BigQueryDestination. */ - interface IBigQueryDestination { + /** Properties of an UpdateFeedRequest. */ + interface IUpdateFeedRequest { - /** BigQueryDestination dataset */ - dataset?: (string|null); - - /** BigQueryDestination table */ - table?: (string|null); + /** UpdateFeedRequest feed */ + feed?: (google.cloud.asset.v1.IFeed|null); - /** BigQueryDestination force */ - force?: (boolean|null); + /** UpdateFeedRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents a BigQueryDestination. */ - class BigQueryDestination implements IBigQueryDestination { + /** Represents an UpdateFeedRequest. */ + class UpdateFeedRequest implements IUpdateFeedRequest { /** - * Constructs a new BigQueryDestination. + * Constructs a new UpdateFeedRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IBigQueryDestination); - - /** BigQueryDestination dataset. */ - public dataset: string; + constructor(properties?: google.cloud.asset.v1.IUpdateFeedRequest); - /** BigQueryDestination table. */ - public table: string; + /** UpdateFeedRequest feed. */ + public feed?: (google.cloud.asset.v1.IFeed|null); - /** BigQueryDestination force. */ - public force: boolean; + /** UpdateFeedRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new BigQueryDestination instance using the specified properties. + * Creates a new UpdateFeedRequest instance using the specified properties. * @param [properties] Properties to set - * @returns BigQueryDestination instance + * @returns UpdateFeedRequest instance */ - public static create(properties?: google.cloud.asset.v1.IBigQueryDestination): google.cloud.asset.v1.BigQueryDestination; + public static create(properties?: google.cloud.asset.v1.IUpdateFeedRequest): google.cloud.asset.v1.UpdateFeedRequest; /** - * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.asset.v1.BigQueryDestination.verify|verify} messages. - * @param message BigQueryDestination message or plain object to encode + * Encodes the specified UpdateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.UpdateFeedRequest.verify|verify} messages. + * @param message UpdateFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IUpdateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BigQueryDestination.verify|verify} messages. - * @param message BigQueryDestination message or plain object to encode + * Encodes the specified UpdateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.UpdateFeedRequest.verify|verify} messages. + * @param message UpdateFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IUpdateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BigQueryDestination message from the specified reader or buffer. + * Decodes an UpdateFeedRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BigQueryDestination + * @returns UpdateFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.BigQueryDestination; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.UpdateFeedRequest; /** - * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. + * Decodes an UpdateFeedRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BigQueryDestination + * @returns UpdateFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.BigQueryDestination; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.UpdateFeedRequest; /** - * Verifies a BigQueryDestination message. + * Verifies an UpdateFeedRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BigQueryDestination message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateFeedRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BigQueryDestination + * @returns UpdateFeedRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BigQueryDestination; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.UpdateFeedRequest; /** - * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. - * @param message BigQueryDestination + * Creates a plain object from an UpdateFeedRequest message. Also converts values to other types if specified. + * @param message UpdateFeedRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.BigQueryDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.UpdateFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BigQueryDestination to JSON. + * Converts this UpdateFeedRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a PubsubDestination. */ - interface IPubsubDestination { + /** Properties of a DeleteFeedRequest. */ + interface IDeleteFeedRequest { - /** PubsubDestination topic */ - topic?: (string|null); + /** DeleteFeedRequest name */ + name?: (string|null); } - /** Represents a PubsubDestination. */ - class PubsubDestination implements IPubsubDestination { + /** Represents a DeleteFeedRequest. */ + class DeleteFeedRequest implements IDeleteFeedRequest { /** - * Constructs a new PubsubDestination. + * Constructs a new DeleteFeedRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IPubsubDestination); + constructor(properties?: google.cloud.asset.v1.IDeleteFeedRequest); - /** PubsubDestination topic. */ - public topic: string; + /** DeleteFeedRequest name. */ + public name: string; /** - * Creates a new PubsubDestination instance using the specified properties. + * Creates a new DeleteFeedRequest instance using the specified properties. * @param [properties] Properties to set - * @returns PubsubDestination instance + * @returns DeleteFeedRequest instance */ - public static create(properties?: google.cloud.asset.v1.IPubsubDestination): google.cloud.asset.v1.PubsubDestination; + public static create(properties?: google.cloud.asset.v1.IDeleteFeedRequest): google.cloud.asset.v1.DeleteFeedRequest; /** - * Encodes the specified PubsubDestination message. Does not implicitly {@link google.cloud.asset.v1.PubsubDestination.verify|verify} messages. - * @param message PubsubDestination message or plain object to encode + * Encodes the specified DeleteFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.DeleteFeedRequest.verify|verify} messages. + * @param message DeleteFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IPubsubDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IDeleteFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PubsubDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.PubsubDestination.verify|verify} messages. - * @param message PubsubDestination message or plain object to encode + * Encodes the specified DeleteFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.DeleteFeedRequest.verify|verify} messages. + * @param message DeleteFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IPubsubDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IDeleteFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PubsubDestination message from the specified reader or buffer. + * Decodes a DeleteFeedRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PubsubDestination + * @returns DeleteFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.PubsubDestination; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.DeleteFeedRequest; /** - * Decodes a PubsubDestination message from the specified reader or buffer, length delimited. + * Decodes a DeleteFeedRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PubsubDestination + * @returns DeleteFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.PubsubDestination; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.DeleteFeedRequest; /** - * Verifies a PubsubDestination message. + * Verifies a DeleteFeedRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a PubsubDestination message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteFeedRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PubsubDestination + * @returns DeleteFeedRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.PubsubDestination; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.DeleteFeedRequest; /** - * Creates a plain object from a PubsubDestination message. Also converts values to other types if specified. - * @param message PubsubDestination + * Creates a plain object from a DeleteFeedRequest message. Also converts values to other types if specified. + * @param message DeleteFeedRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.PubsubDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.DeleteFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PubsubDestination to JSON. + * Converts this DeleteFeedRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** ContentType enum. */ - enum ContentType { - CONTENT_TYPE_UNSPECIFIED = 0, - RESOURCE = 1, - IAM_POLICY = 2, - ORG_POLICY = 4, - ACCESS_POLICY = 5 - } + /** Properties of an OutputConfig. */ + interface IOutputConfig { - /** Properties of a FeedOutputConfig. */ - interface IFeedOutputConfig { + /** OutputConfig gcsDestination */ + gcsDestination?: (google.cloud.asset.v1.IGcsDestination|null); - /** FeedOutputConfig pubsubDestination */ - pubsubDestination?: (google.cloud.asset.v1.IPubsubDestination|null); + /** OutputConfig bigqueryDestination */ + bigqueryDestination?: (google.cloud.asset.v1.IBigQueryDestination|null); } - /** Represents a FeedOutputConfig. */ - class FeedOutputConfig implements IFeedOutputConfig { + /** Represents an OutputConfig. */ + class OutputConfig implements IOutputConfig { /** - * Constructs a new FeedOutputConfig. + * Constructs a new OutputConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IFeedOutputConfig); + constructor(properties?: google.cloud.asset.v1.IOutputConfig); - /** FeedOutputConfig pubsubDestination. */ - public pubsubDestination?: (google.cloud.asset.v1.IPubsubDestination|null); + /** OutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.asset.v1.IGcsDestination|null); - /** FeedOutputConfig destination. */ - public destination?: "pubsubDestination"; + /** OutputConfig bigqueryDestination. */ + public bigqueryDestination?: (google.cloud.asset.v1.IBigQueryDestination|null); + + /** OutputConfig destination. */ + public destination?: ("gcsDestination"|"bigqueryDestination"); /** - * Creates a new FeedOutputConfig instance using the specified properties. + * Creates a new OutputConfig instance using the specified properties. * @param [properties] Properties to set - * @returns FeedOutputConfig instance + * @returns OutputConfig instance */ - public static create(properties?: google.cloud.asset.v1.IFeedOutputConfig): google.cloud.asset.v1.FeedOutputConfig; + public static create(properties?: google.cloud.asset.v1.IOutputConfig): google.cloud.asset.v1.OutputConfig; /** - * Encodes the specified FeedOutputConfig message. Does not implicitly {@link google.cloud.asset.v1.FeedOutputConfig.verify|verify} messages. - * @param message FeedOutputConfig message or plain object to encode + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IFeedOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified FeedOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.FeedOutputConfig.verify|verify} messages. - * @param message FeedOutputConfig message or plain object to encode + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IFeedOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FeedOutputConfig message from the specified reader or buffer. + * Decodes an OutputConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns FeedOutputConfig + * @returns OutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.FeedOutputConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.OutputConfig; /** - * Decodes a FeedOutputConfig message from the specified reader or buffer, length delimited. + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FeedOutputConfig + * @returns OutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.FeedOutputConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.OutputConfig; /** - * Verifies a FeedOutputConfig message. + * Verifies an OutputConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a FeedOutputConfig message from a plain object. Also converts values to their respective internal types. + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FeedOutputConfig + * @returns OutputConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.FeedOutputConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.OutputConfig; /** - * Creates a plain object from a FeedOutputConfig message. Also converts values to other types if specified. - * @param message FeedOutputConfig + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @param message OutputConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.FeedOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.OutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FeedOutputConfig to JSON. + * Converts this OutputConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Feed. */ - interface IFeed { - - /** Feed name */ - name?: (string|null); - - /** Feed assetNames */ - assetNames?: (string[]|null); - - /** Feed assetTypes */ - assetTypes?: (string[]|null); + /** Properties of a GcsDestination. */ + interface IGcsDestination { - /** Feed contentType */ - contentType?: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType|null); + /** GcsDestination uri */ + uri?: (string|null); - /** Feed feedOutputConfig */ - feedOutputConfig?: (google.cloud.asset.v1.IFeedOutputConfig|null); + /** GcsDestination uriPrefix */ + uriPrefix?: (string|null); } - /** Represents a Feed. */ - class Feed implements IFeed { + /** Represents a GcsDestination. */ + class GcsDestination implements IGcsDestination { /** - * Constructs a new Feed. + * Constructs a new GcsDestination. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IFeed); + constructor(properties?: google.cloud.asset.v1.IGcsDestination); - /** Feed name. */ - public name: string; + /** GcsDestination uri. */ + public uri: string; - /** Feed assetNames. */ - public assetNames: string[]; - - /** Feed assetTypes. */ - public assetTypes: string[]; - - /** Feed contentType. */ - public contentType: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType); + /** GcsDestination uriPrefix. */ + public uriPrefix: string; - /** Feed feedOutputConfig. */ - public feedOutputConfig?: (google.cloud.asset.v1.IFeedOutputConfig|null); + /** GcsDestination objectUri. */ + public objectUri?: ("uri"|"uriPrefix"); /** - * Creates a new Feed instance using the specified properties. + * Creates a new GcsDestination instance using the specified properties. * @param [properties] Properties to set - * @returns Feed instance + * @returns GcsDestination instance */ - public static create(properties?: google.cloud.asset.v1.IFeed): google.cloud.asset.v1.Feed; + public static create(properties?: google.cloud.asset.v1.IGcsDestination): google.cloud.asset.v1.GcsDestination; /** - * Encodes the specified Feed message. Does not implicitly {@link google.cloud.asset.v1.Feed.verify|verify} messages. - * @param message Feed message or plain object to encode + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IFeed, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Feed message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Feed.verify|verify} messages. - * @param message Feed message or plain object to encode + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IFeed, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Feed message from the specified reader or buffer. + * Decodes a GcsDestination message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Feed + * @returns GcsDestination * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.Feed; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.GcsDestination; /** - * Decodes a Feed message from the specified reader or buffer, length delimited. + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Feed + * @returns GcsDestination * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.Feed; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.GcsDestination; /** - * Verifies a Feed message. + * Verifies a GcsDestination message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Feed message from a plain object. Also converts values to their respective internal types. + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Feed + * @returns GcsDestination */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Feed; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.GcsDestination; /** - * Creates a plain object from a Feed message. Also converts values to other types if specified. - * @param message Feed + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @param message GcsDestination * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.Feed, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Feed to JSON. + * Converts this GcsDestination to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a TemporalAsset. */ - interface ITemporalAsset { + /** Properties of a BigQueryDestination. */ + interface IBigQueryDestination { - /** TemporalAsset window */ - window?: (google.cloud.asset.v1.ITimeWindow|null); + /** BigQueryDestination dataset */ + dataset?: (string|null); - /** TemporalAsset deleted */ - deleted?: (boolean|null); + /** BigQueryDestination table */ + table?: (string|null); - /** TemporalAsset asset */ - asset?: (google.cloud.asset.v1.IAsset|null); + /** BigQueryDestination force */ + force?: (boolean|null); } - /** Represents a TemporalAsset. */ - class TemporalAsset implements ITemporalAsset { + /** Represents a BigQueryDestination. */ + class BigQueryDestination implements IBigQueryDestination { /** - * Constructs a new TemporalAsset. + * Constructs a new BigQueryDestination. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.ITemporalAsset); + constructor(properties?: google.cloud.asset.v1.IBigQueryDestination); - /** TemporalAsset window. */ - public window?: (google.cloud.asset.v1.ITimeWindow|null); + /** BigQueryDestination dataset. */ + public dataset: string; - /** TemporalAsset deleted. */ - public deleted: boolean; + /** BigQueryDestination table. */ + public table: string; - /** TemporalAsset asset. */ - public asset?: (google.cloud.asset.v1.IAsset|null); + /** BigQueryDestination force. */ + public force: boolean; /** - * Creates a new TemporalAsset instance using the specified properties. + * Creates a new BigQueryDestination instance using the specified properties. * @param [properties] Properties to set - * @returns TemporalAsset instance + * @returns BigQueryDestination instance */ - public static create(properties?: google.cloud.asset.v1.ITemporalAsset): google.cloud.asset.v1.TemporalAsset; + public static create(properties?: google.cloud.asset.v1.IBigQueryDestination): google.cloud.asset.v1.BigQueryDestination; /** - * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. - * @param message TemporalAsset message or plain object to encode + * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.asset.v1.BigQueryDestination.verify|verify} messages. + * @param message BigQueryDestination message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. - * @param message TemporalAsset message or plain object to encode + * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BigQueryDestination.verify|verify} messages. + * @param message BigQueryDestination message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TemporalAsset message from the specified reader or buffer. + * Decodes a BigQueryDestination message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TemporalAsset + * @returns BigQueryDestination * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.TemporalAsset; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.BigQueryDestination; /** - * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TemporalAsset + * @returns BigQueryDestination * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.TemporalAsset; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.BigQueryDestination; /** - * Verifies a TemporalAsset message. + * Verifies a BigQueryDestination message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. + * Creates a BigQueryDestination message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TemporalAsset + * @returns BigQueryDestination */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.TemporalAsset; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BigQueryDestination; /** - * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. - * @param message TemporalAsset + * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. + * @param message BigQueryDestination * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.TemporalAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.BigQueryDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TemporalAsset to JSON. + * Converts this BigQueryDestination to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a TimeWindow. */ - interface ITimeWindow { - - /** TimeWindow startTime */ - startTime?: (google.protobuf.ITimestamp|null); + /** Properties of a PubsubDestination. */ + interface IPubsubDestination { - /** TimeWindow endTime */ - endTime?: (google.protobuf.ITimestamp|null); + /** PubsubDestination topic */ + topic?: (string|null); } - /** Represents a TimeWindow. */ - class TimeWindow implements ITimeWindow { + /** Represents a PubsubDestination. */ + class PubsubDestination implements IPubsubDestination { /** - * Constructs a new TimeWindow. + * Constructs a new PubsubDestination. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.ITimeWindow); - - /** TimeWindow startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); + constructor(properties?: google.cloud.asset.v1.IPubsubDestination); - /** TimeWindow endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); + /** PubsubDestination topic. */ + public topic: string; /** - * Creates a new TimeWindow instance using the specified properties. + * Creates a new PubsubDestination instance using the specified properties. * @param [properties] Properties to set - * @returns TimeWindow instance + * @returns PubsubDestination instance */ - public static create(properties?: google.cloud.asset.v1.ITimeWindow): google.cloud.asset.v1.TimeWindow; + public static create(properties?: google.cloud.asset.v1.IPubsubDestination): google.cloud.asset.v1.PubsubDestination; /** - * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. - * @param message TimeWindow message or plain object to encode + * Encodes the specified PubsubDestination message. Does not implicitly {@link google.cloud.asset.v1.PubsubDestination.verify|verify} messages. + * @param message PubsubDestination message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IPubsubDestination, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. - * @param message TimeWindow message or plain object to encode + * Encodes the specified PubsubDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.PubsubDestination.verify|verify} messages. + * @param message PubsubDestination message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IPubsubDestination, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TimeWindow message from the specified reader or buffer. + * Decodes a PubsubDestination message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TimeWindow + * @returns PubsubDestination * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.TimeWindow; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.PubsubDestination; /** - * Decodes a TimeWindow message from the specified reader or buffer, length delimited. + * Decodes a PubsubDestination message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TimeWindow + * @returns PubsubDestination * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.TimeWindow; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.PubsubDestination; /** - * Verifies a TimeWindow message. + * Verifies a PubsubDestination message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. + * Creates a PubsubDestination message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TimeWindow + * @returns PubsubDestination */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.TimeWindow; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.PubsubDestination; /** - * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. - * @param message TimeWindow + * Creates a plain object from a PubsubDestination message. Also converts values to other types if specified. + * @param message PubsubDestination * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.PubsubDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TimeWindow to JSON. + * Converts this PubsubDestination to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an Asset. */ - interface IAsset { - - /** Asset name */ - name?: (string|null); - - /** Asset assetType */ - assetType?: (string|null); - - /** Asset resource */ - resource?: (google.cloud.asset.v1.IResource|null); + /** ContentType enum. */ + enum ContentType { + CONTENT_TYPE_UNSPECIFIED = 0, + RESOURCE = 1, + IAM_POLICY = 2, + ORG_POLICY = 4, + ACCESS_POLICY = 5 + } - /** Asset iamPolicy */ - iamPolicy?: (google.iam.v1.IPolicy|null); + /** Properties of a FeedOutputConfig. */ + interface IFeedOutputConfig { - /** Asset ancestors */ - ancestors?: (string[]|null); + /** FeedOutputConfig pubsubDestination */ + pubsubDestination?: (google.cloud.asset.v1.IPubsubDestination|null); } - /** Represents an Asset. */ - class Asset implements IAsset { + /** Represents a FeedOutputConfig. */ + class FeedOutputConfig implements IFeedOutputConfig { /** - * Constructs a new Asset. + * Constructs a new FeedOutputConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IAsset); - - /** Asset name. */ - public name: string; + constructor(properties?: google.cloud.asset.v1.IFeedOutputConfig); - /** Asset assetType. */ - public assetType: string; + /** FeedOutputConfig pubsubDestination. */ + public pubsubDestination?: (google.cloud.asset.v1.IPubsubDestination|null); - /** Asset resource. */ - public resource?: (google.cloud.asset.v1.IResource|null); - - /** Asset iamPolicy. */ - public iamPolicy?: (google.iam.v1.IPolicy|null); - - /** Asset ancestors. */ - public ancestors: string[]; + /** FeedOutputConfig destination. */ + public destination?: "pubsubDestination"; /** - * Creates a new Asset instance using the specified properties. + * Creates a new FeedOutputConfig instance using the specified properties. * @param [properties] Properties to set - * @returns Asset instance + * @returns FeedOutputConfig instance */ - public static create(properties?: google.cloud.asset.v1.IAsset): google.cloud.asset.v1.Asset; + public static create(properties?: google.cloud.asset.v1.IFeedOutputConfig): google.cloud.asset.v1.FeedOutputConfig; /** - * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode + * Encodes the specified FeedOutputConfig message. Does not implicitly {@link google.cloud.asset.v1.FeedOutputConfig.verify|verify} messages. + * @param message FeedOutputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IFeedOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode + * Encodes the specified FeedOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.FeedOutputConfig.verify|verify} messages. + * @param message FeedOutputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IFeedOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Asset message from the specified reader or buffer. + * Decodes a FeedOutputConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Asset + * @returns FeedOutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.Asset; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.FeedOutputConfig; /** - * Decodes an Asset message from the specified reader or buffer, length delimited. + * Decodes a FeedOutputConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Asset + * @returns FeedOutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.Asset; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.FeedOutputConfig; /** - * Verifies an Asset message. + * Verifies a FeedOutputConfig message. * @param message Plain 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 Asset message from a plain object. Also converts values to their respective internal types. + * Creates a FeedOutputConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Asset + * @returns FeedOutputConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Asset; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.FeedOutputConfig; /** - * Creates a plain object from an Asset message. Also converts values to other types if specified. - * @param message Asset + * Creates a plain object from a FeedOutputConfig message. Also converts values to other types if specified. + * @param message FeedOutputConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.FeedOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Asset to JSON. + * Converts this FeedOutputConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Resource. */ - interface IResource { - - /** Resource version */ - version?: (string|null); + /** Properties of a Feed. */ + interface IFeed { - /** Resource discoveryDocumentUri */ - discoveryDocumentUri?: (string|null); + /** Feed name */ + name?: (string|null); - /** Resource discoveryName */ - discoveryName?: (string|null); + /** Feed assetNames */ + assetNames?: (string[]|null); - /** Resource resourceUrl */ - resourceUrl?: (string|null); + /** Feed assetTypes */ + assetTypes?: (string[]|null); - /** Resource parent */ - parent?: (string|null); + /** Feed contentType */ + contentType?: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType|null); - /** Resource data */ - data?: (google.protobuf.IStruct|null); + /** Feed feedOutputConfig */ + feedOutputConfig?: (google.cloud.asset.v1.IFeedOutputConfig|null); } - /** Represents a Resource. */ - class Resource implements IResource { + /** Represents a Feed. */ + class Feed implements IFeed { /** - * Constructs a new Resource. + * Constructs a new Feed. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IResource); - - /** Resource version. */ - public version: string; + constructor(properties?: google.cloud.asset.v1.IFeed); - /** Resource discoveryDocumentUri. */ - public discoveryDocumentUri: string; + /** Feed name. */ + public name: string; - /** Resource discoveryName. */ - public discoveryName: string; + /** Feed assetNames. */ + public assetNames: string[]; - /** Resource resourceUrl. */ - public resourceUrl: string; + /** Feed assetTypes. */ + public assetTypes: string[]; - /** Resource parent. */ - public parent: string; + /** Feed contentType. */ + public contentType: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType); - /** Resource data. */ - public data?: (google.protobuf.IStruct|null); + /** Feed feedOutputConfig. */ + public feedOutputConfig?: (google.cloud.asset.v1.IFeedOutputConfig|null); /** - * Creates a new Resource instance using the specified properties. + * Creates a new Feed instance using the specified properties. * @param [properties] Properties to set - * @returns Resource instance + * @returns Feed instance */ - public static create(properties?: google.cloud.asset.v1.IResource): google.cloud.asset.v1.Resource; + public static create(properties?: google.cloud.asset.v1.IFeed): google.cloud.asset.v1.Feed; /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. - * @param message Resource message or plain object to encode + * Encodes the specified Feed message. Does not implicitly {@link google.cloud.asset.v1.Feed.verify|verify} messages. + * @param message Feed message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IFeed, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. - * @param message Resource message or plain object to encode + * Encodes the specified Feed message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Feed.verify|verify} messages. + * @param message Feed message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IFeed, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Resource message from the specified reader or buffer. + * Decodes a Feed message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Resource + * @returns Feed * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.Resource; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.Feed; /** - * Decodes a Resource message from the specified reader or buffer, length delimited. + * Decodes a Feed message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Resource + * @returns Feed * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.Resource; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.Feed; /** - * Verifies a Resource message. + * Verifies a Feed message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * Creates a Feed message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Resource + * @returns Feed */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Resource; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Feed; /** - * Creates a plain object from a Resource message. Also converts values to other types if specified. - * @param message Resource + * Creates a plain object from a Feed message. Also converts values to other types if specified. + * @param message Feed * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.Feed, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Resource to JSON. + * Converts this Feed to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; @@ -2205,1102 +2205,1330 @@ export namespace google { /** Namespace v1beta1. */ namespace v1beta1 { - /** Represents an AssetService */ - class AssetService extends $protobuf.rpc.Service { + /** Properties of a TemporalAsset. */ + interface ITemporalAsset { + + /** TemporalAsset window */ + window?: (google.cloud.asset.v1beta1.ITimeWindow|null); + + /** TemporalAsset deleted */ + deleted?: (boolean|null); + + /** TemporalAsset asset */ + asset?: (google.cloud.asset.v1beta1.IAsset|null); + } + + /** Represents a TemporalAsset. */ + class TemporalAsset implements ITemporalAsset { /** - * Constructs a new AssetService service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited + * Constructs a new TemporalAsset. + * @param [properties] Properties to set */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + constructor(properties?: google.cloud.asset.v1beta1.ITemporalAsset); + + /** TemporalAsset window. */ + public window?: (google.cloud.asset.v1beta1.ITimeWindow|null); + + /** TemporalAsset deleted. */ + public deleted: boolean; + + /** TemporalAsset asset. */ + public asset?: (google.cloud.asset.v1beta1.IAsset|null); /** - * Creates new AssetService service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. + * Creates a new TemporalAsset instance using the specified properties. + * @param [properties] Properties to set + * @returns TemporalAsset instance */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): AssetService; + public static create(properties?: google.cloud.asset.v1beta1.ITemporalAsset): google.cloud.asset.v1beta1.TemporalAsset; /** - * Calls ExportAssets. - * @param request ExportAssetsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1beta1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public exportAssets(request: google.cloud.asset.v1beta1.IExportAssetsRequest, callback: google.cloud.asset.v1beta1.AssetService.ExportAssetsCallback): void; + public static encode(message: google.cloud.asset.v1beta1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls ExportAssets. - * @param request ExportAssetsRequest message or plain object - * @returns Promise + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public exportAssets(request: google.cloud.asset.v1beta1.IExportAssetsRequest): Promise; + public static encodeDelimited(message: google.cloud.asset.v1beta1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls BatchGetAssetsHistory. - * @param request BatchGetAssetsHistoryRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BatchGetAssetsHistoryResponse + * Decodes a TemporalAsset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TemporalAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public batchGetAssetsHistory(request: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, callback: google.cloud.asset.v1beta1.AssetService.BatchGetAssetsHistoryCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.TemporalAsset; /** - * Calls BatchGetAssetsHistory. - * @param request BatchGetAssetsHistoryRequest message or plain object - * @returns Promise + * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TemporalAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public batchGetAssetsHistory(request: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest): Promise; - } - - namespace AssetService { + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.TemporalAsset; /** - * Callback as used by {@link google.cloud.asset.v1beta1.AssetService#exportAssets}. - * @param error Error, if any - * @param [response] Operation + * Verifies a TemporalAsset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type ExportAssetsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.cloud.asset.v1beta1.AssetService#batchGetAssetsHistory}. - * @param error Error, if any - * @param [response] BatchGetAssetsHistoryResponse + * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TemporalAsset */ - type BatchGetAssetsHistoryCallback = (error: (Error|null), response?: google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse) => void; - } - - /** Properties of an ExportAssetsRequest. */ - interface IExportAssetsRequest { + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.TemporalAsset; - /** ExportAssetsRequest parent */ - parent?: (string|null); + /** + * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * @param message TemporalAsset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1beta1.TemporalAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** ExportAssetsRequest readTime */ - readTime?: (google.protobuf.ITimestamp|null); + /** + * Converts this TemporalAsset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** ExportAssetsRequest assetTypes */ - assetTypes?: (string[]|null); + /** Properties of a TimeWindow. */ + interface ITimeWindow { - /** ExportAssetsRequest contentType */ - contentType?: (google.cloud.asset.v1beta1.ContentType|keyof typeof google.cloud.asset.v1beta1.ContentType|null); + /** TimeWindow startTime */ + startTime?: (google.protobuf.ITimestamp|null); - /** ExportAssetsRequest outputConfig */ - outputConfig?: (google.cloud.asset.v1beta1.IOutputConfig|null); + /** TimeWindow endTime */ + endTime?: (google.protobuf.ITimestamp|null); } - /** Represents an ExportAssetsRequest. */ - class ExportAssetsRequest implements IExportAssetsRequest { + /** Represents a TimeWindow. */ + class TimeWindow implements ITimeWindow { /** - * Constructs a new ExportAssetsRequest. + * Constructs a new TimeWindow. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1beta1.IExportAssetsRequest); - - /** ExportAssetsRequest parent. */ - public parent: string; - - /** ExportAssetsRequest readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** ExportAssetsRequest assetTypes. */ - public assetTypes: string[]; + constructor(properties?: google.cloud.asset.v1beta1.ITimeWindow); - /** ExportAssetsRequest contentType. */ - public contentType: (google.cloud.asset.v1beta1.ContentType|keyof typeof google.cloud.asset.v1beta1.ContentType); + /** TimeWindow startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); - /** ExportAssetsRequest outputConfig. */ - public outputConfig?: (google.cloud.asset.v1beta1.IOutputConfig|null); + /** TimeWindow endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); /** - * Creates a new ExportAssetsRequest instance using the specified properties. + * Creates a new TimeWindow instance using the specified properties. * @param [properties] Properties to set - * @returns ExportAssetsRequest instance + * @returns TimeWindow instance */ - public static create(properties?: google.cloud.asset.v1beta1.IExportAssetsRequest): google.cloud.asset.v1beta1.ExportAssetsRequest; + public static create(properties?: google.cloud.asset.v1beta1.ITimeWindow): google.cloud.asset.v1beta1.TimeWindow; /** - * Encodes the specified ExportAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsRequest.verify|verify} messages. - * @param message ExportAssetsRequest message or plain object to encode + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1beta1.TimeWindow.verify|verify} messages. + * @param message TimeWindow message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1beta1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1beta1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ExportAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsRequest.verify|verify} messages. - * @param message ExportAssetsRequest message or plain object to encode + * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.TimeWindow.verify|verify} messages. + * @param message TimeWindow message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1beta1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1beta1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExportAssetsRequest message from the specified reader or buffer. + * Decodes a TimeWindow message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ExportAssetsRequest + * @returns TimeWindow * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.ExportAssetsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.TimeWindow; /** - * Decodes an ExportAssetsRequest message from the specified reader or buffer, length delimited. + * Decodes a TimeWindow message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExportAssetsRequest + * @returns TimeWindow * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.ExportAssetsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.TimeWindow; /** - * Verifies an ExportAssetsRequest message. + * Verifies a TimeWindow message. * @param message Plain 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 ExportAssetsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExportAssetsRequest + * @returns TimeWindow */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.ExportAssetsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.TimeWindow; /** - * Creates a plain object from an ExportAssetsRequest message. Also converts values to other types if specified. - * @param message ExportAssetsRequest + * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. + * @param message TimeWindow * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1beta1.ExportAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1beta1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExportAssetsRequest to JSON. + * Converts this TimeWindow to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an ExportAssetsResponse. */ - interface IExportAssetsResponse { + /** Properties of an Asset. */ + interface IAsset { - /** ExportAssetsResponse readTime */ - readTime?: (google.protobuf.ITimestamp|null); + /** Asset name */ + name?: (string|null); - /** ExportAssetsResponse outputConfig */ - outputConfig?: (google.cloud.asset.v1beta1.IOutputConfig|null); + /** Asset assetType */ + assetType?: (string|null); + + /** Asset resource */ + resource?: (google.cloud.asset.v1beta1.IResource|null); + + /** Asset iamPolicy */ + iamPolicy?: (google.iam.v1.IPolicy|null); } - /** Represents an ExportAssetsResponse. */ - class ExportAssetsResponse implements IExportAssetsResponse { + /** Represents an Asset. */ + class Asset implements IAsset { /** - * Constructs a new ExportAssetsResponse. + * Constructs a new Asset. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1beta1.IExportAssetsResponse); + constructor(properties?: google.cloud.asset.v1beta1.IAsset); - /** ExportAssetsResponse readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); + /** Asset name. */ + public name: string; - /** ExportAssetsResponse outputConfig. */ - public outputConfig?: (google.cloud.asset.v1beta1.IOutputConfig|null); + /** Asset assetType. */ + public assetType: string; + + /** Asset resource. */ + public resource?: (google.cloud.asset.v1beta1.IResource|null); + + /** Asset iamPolicy. */ + public iamPolicy?: (google.iam.v1.IPolicy|null); /** - * Creates a new ExportAssetsResponse instance using the specified properties. + * Creates a new Asset instance using the specified properties. * @param [properties] Properties to set - * @returns ExportAssetsResponse instance + * @returns Asset instance */ - public static create(properties?: google.cloud.asset.v1beta1.IExportAssetsResponse): google.cloud.asset.v1beta1.ExportAssetsResponse; + public static create(properties?: google.cloud.asset.v1beta1.IAsset): google.cloud.asset.v1beta1.Asset; /** - * Encodes the specified ExportAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsResponse.verify|verify} messages. - * @param message ExportAssetsResponse message or plain object to encode + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1beta1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1beta1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ExportAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsResponse.verify|verify} messages. - * @param message ExportAssetsResponse message or plain object to encode + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1beta1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExportAssetsResponse message from the specified reader or buffer. + * Decodes an Asset message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ExportAssetsResponse + * @returns Asset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.ExportAssetsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.Asset; /** - * Decodes an ExportAssetsResponse message from the specified reader or buffer, length delimited. + * Decodes an Asset message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExportAssetsResponse + * @returns Asset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.ExportAssetsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.Asset; /** - * Verifies an ExportAssetsResponse message. + * Verifies an Asset message. * @param message Plain 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 ExportAssetsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an Asset message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExportAssetsResponse + * @returns Asset */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.ExportAssetsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.Asset; /** - * Creates a plain object from an ExportAssetsResponse message. Also converts values to other types if specified. - * @param message ExportAssetsResponse + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @param message Asset * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1beta1.ExportAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1beta1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExportAssetsResponse to JSON. + * Converts this Asset to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BatchGetAssetsHistoryRequest. */ - interface IBatchGetAssetsHistoryRequest { + /** Properties of a Resource. */ + interface IResource { - /** BatchGetAssetsHistoryRequest parent */ - parent?: (string|null); + /** Resource version */ + version?: (string|null); - /** BatchGetAssetsHistoryRequest assetNames */ - assetNames?: (string[]|null); + /** Resource discoveryDocumentUri */ + discoveryDocumentUri?: (string|null); - /** BatchGetAssetsHistoryRequest contentType */ - contentType?: (google.cloud.asset.v1beta1.ContentType|keyof typeof google.cloud.asset.v1beta1.ContentType|null); + /** Resource discoveryName */ + discoveryName?: (string|null); - /** BatchGetAssetsHistoryRequest readTimeWindow */ - readTimeWindow?: (google.cloud.asset.v1beta1.ITimeWindow|null); + /** Resource resourceUrl */ + resourceUrl?: (string|null); + + /** Resource parent */ + parent?: (string|null); + + /** Resource data */ + data?: (google.protobuf.IStruct|null); } - /** Represents a BatchGetAssetsHistoryRequest. */ - class BatchGetAssetsHistoryRequest implements IBatchGetAssetsHistoryRequest { + /** Represents a Resource. */ + class Resource implements IResource { /** - * Constructs a new BatchGetAssetsHistoryRequest. + * Constructs a new Resource. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest); + constructor(properties?: google.cloud.asset.v1beta1.IResource); - /** BatchGetAssetsHistoryRequest parent. */ - public parent: string; + /** Resource version. */ + public version: string; - /** BatchGetAssetsHistoryRequest assetNames. */ - public assetNames: string[]; + /** Resource discoveryDocumentUri. */ + public discoveryDocumentUri: string; - /** BatchGetAssetsHistoryRequest contentType. */ - public contentType: (google.cloud.asset.v1beta1.ContentType|keyof typeof google.cloud.asset.v1beta1.ContentType); + /** Resource discoveryName. */ + public discoveryName: string; - /** BatchGetAssetsHistoryRequest readTimeWindow. */ - public readTimeWindow?: (google.cloud.asset.v1beta1.ITimeWindow|null); + /** Resource resourceUrl. */ + public resourceUrl: string; + + /** Resource parent. */ + public parent: string; + + /** Resource data. */ + public data?: (google.protobuf.IStruct|null); /** - * Creates a new BatchGetAssetsHistoryRequest instance using the specified properties. + * Creates a new Resource instance using the specified properties. * @param [properties] Properties to set - * @returns BatchGetAssetsHistoryRequest instance + * @returns Resource instance */ - public static create(properties?: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest): google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest; + public static create(properties?: google.cloud.asset.v1beta1.IResource): google.cloud.asset.v1beta1.Resource; /** - * Encodes the specified BatchGetAssetsHistoryRequest message. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest.verify|verify} messages. - * @param message BatchGetAssetsHistoryRequest message or plain object to encode + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1beta1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1beta1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchGetAssetsHistoryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest.verify|verify} messages. - * @param message BatchGetAssetsHistoryRequest message or plain object to encode + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1beta1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer. + * Decodes a Resource message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchGetAssetsHistoryRequest + * @returns Resource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.Resource; /** - * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer, length delimited. + * Decodes a Resource message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchGetAssetsHistoryRequest + * @returns Resource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.Resource; /** - * Verifies a BatchGetAssetsHistoryRequest message. + * Verifies a Resource message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchGetAssetsHistoryRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Resource message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchGetAssetsHistoryRequest + * @returns Resource */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.Resource; /** - * Creates a plain object from a BatchGetAssetsHistoryRequest message. Also converts values to other types if specified. - * @param message BatchGetAssetsHistoryRequest + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @param message Resource * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1beta1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchGetAssetsHistoryRequest to JSON. + * Converts this Resource to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BatchGetAssetsHistoryResponse. */ - interface IBatchGetAssetsHistoryResponse { + /** Represents an AssetService */ + class AssetService extends $protobuf.rpc.Service { - /** BatchGetAssetsHistoryResponse assets */ - assets?: (google.cloud.asset.v1beta1.ITemporalAsset[]|null); + /** + * Constructs a new AssetService 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 AssetService 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): AssetService; + + /** + * Calls ExportAssets. + * @param request ExportAssetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportAssets(request: google.cloud.asset.v1beta1.IExportAssetsRequest, callback: google.cloud.asset.v1beta1.AssetService.ExportAssetsCallback): void; + + /** + * Calls ExportAssets. + * @param request ExportAssetsRequest message or plain object + * @returns Promise + */ + public exportAssets(request: google.cloud.asset.v1beta1.IExportAssetsRequest): Promise; + + /** + * Calls BatchGetAssetsHistory. + * @param request BatchGetAssetsHistoryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchGetAssetsHistoryResponse + */ + public batchGetAssetsHistory(request: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, callback: google.cloud.asset.v1beta1.AssetService.BatchGetAssetsHistoryCallback): void; + + /** + * Calls BatchGetAssetsHistory. + * @param request BatchGetAssetsHistoryRequest message or plain object + * @returns Promise + */ + public batchGetAssetsHistory(request: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest): Promise; } - /** Represents a BatchGetAssetsHistoryResponse. */ - class BatchGetAssetsHistoryResponse implements IBatchGetAssetsHistoryResponse { + namespace AssetService { /** - * Constructs a new BatchGetAssetsHistoryResponse. + * Callback as used by {@link google.cloud.asset.v1beta1.AssetService#exportAssets}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportAssetsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1beta1.AssetService#batchGetAssetsHistory}. + * @param error Error, if any + * @param [response] BatchGetAssetsHistoryResponse + */ + type BatchGetAssetsHistoryCallback = (error: (Error|null), response?: google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse) => void; + } + + /** Properties of an ExportAssetsRequest. */ + interface IExportAssetsRequest { + + /** ExportAssetsRequest parent */ + parent?: (string|null); + + /** ExportAssetsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ExportAssetsRequest assetTypes */ + assetTypes?: (string[]|null); + + /** ExportAssetsRequest contentType */ + contentType?: (google.cloud.asset.v1beta1.ContentType|keyof typeof google.cloud.asset.v1beta1.ContentType|null); + + /** ExportAssetsRequest outputConfig */ + outputConfig?: (google.cloud.asset.v1beta1.IOutputConfig|null); + } + + /** Represents an ExportAssetsRequest. */ + class ExportAssetsRequest implements IExportAssetsRequest { + + /** + * Constructs a new ExportAssetsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse); + constructor(properties?: google.cloud.asset.v1beta1.IExportAssetsRequest); - /** BatchGetAssetsHistoryResponse assets. */ - public assets: google.cloud.asset.v1beta1.ITemporalAsset[]; + /** ExportAssetsRequest parent. */ + public parent: string; + + /** ExportAssetsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ExportAssetsRequest assetTypes. */ + public assetTypes: string[]; + + /** ExportAssetsRequest contentType. */ + public contentType: (google.cloud.asset.v1beta1.ContentType|keyof typeof google.cloud.asset.v1beta1.ContentType); + + /** ExportAssetsRequest outputConfig. */ + public outputConfig?: (google.cloud.asset.v1beta1.IOutputConfig|null); /** - * Creates a new BatchGetAssetsHistoryResponse instance using the specified properties. + * Creates a new ExportAssetsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns BatchGetAssetsHistoryResponse instance + * @returns ExportAssetsRequest instance */ - public static create(properties?: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse): google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse; + public static create(properties?: google.cloud.asset.v1beta1.IExportAssetsRequest): google.cloud.asset.v1beta1.ExportAssetsRequest; /** - * Encodes the specified BatchGetAssetsHistoryResponse message. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. - * @param message BatchGetAssetsHistoryResponse message or plain object to encode + * Encodes the specified ExportAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsRequest.verify|verify} messages. + * @param message ExportAssetsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1beta1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchGetAssetsHistoryResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. - * @param message BatchGetAssetsHistoryResponse message or plain object to encode + * Encodes the specified ExportAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsRequest.verify|verify} messages. + * @param message ExportAssetsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1beta1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer. + * Decodes an ExportAssetsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchGetAssetsHistoryResponse + * @returns ExportAssetsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.ExportAssetsRequest; /** - * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer, length delimited. + * Decodes an ExportAssetsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchGetAssetsHistoryResponse + * @returns ExportAssetsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.ExportAssetsRequest; /** - * Verifies a BatchGetAssetsHistoryResponse message. + * Verifies an ExportAssetsRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchGetAssetsHistoryResponse message from a plain object. Also converts values to their respective internal types. + * Creates an ExportAssetsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchGetAssetsHistoryResponse + * @returns ExportAssetsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.ExportAssetsRequest; /** - * Creates a plain object from a BatchGetAssetsHistoryResponse message. Also converts values to other types if specified. - * @param message BatchGetAssetsHistoryResponse + * Creates a plain object from an ExportAssetsRequest message. Also converts values to other types if specified. + * @param message ExportAssetsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1beta1.ExportAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchGetAssetsHistoryResponse to JSON. + * Converts this ExportAssetsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an OutputConfig. */ - interface IOutputConfig { + /** Properties of an ExportAssetsResponse. */ + interface IExportAssetsResponse { - /** OutputConfig gcsDestination */ - gcsDestination?: (google.cloud.asset.v1beta1.IGcsDestination|null); + /** ExportAssetsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ExportAssetsResponse outputConfig */ + outputConfig?: (google.cloud.asset.v1beta1.IOutputConfig|null); } - /** Represents an OutputConfig. */ - class OutputConfig implements IOutputConfig { + /** Represents an ExportAssetsResponse. */ + class ExportAssetsResponse implements IExportAssetsResponse { /** - * Constructs a new OutputConfig. + * Constructs a new ExportAssetsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1beta1.IOutputConfig); + constructor(properties?: google.cloud.asset.v1beta1.IExportAssetsResponse); - /** OutputConfig gcsDestination. */ - public gcsDestination?: (google.cloud.asset.v1beta1.IGcsDestination|null); + /** ExportAssetsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); - /** OutputConfig destination. */ - public destination?: "gcsDestination"; + /** ExportAssetsResponse outputConfig. */ + public outputConfig?: (google.cloud.asset.v1beta1.IOutputConfig|null); /** - * Creates a new OutputConfig instance using the specified properties. + * Creates a new ExportAssetsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns OutputConfig instance + * @returns ExportAssetsResponse instance */ - public static create(properties?: google.cloud.asset.v1beta1.IOutputConfig): google.cloud.asset.v1beta1.OutputConfig; + public static create(properties?: google.cloud.asset.v1beta1.IExportAssetsResponse): google.cloud.asset.v1beta1.ExportAssetsResponse; /** - * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1beta1.OutputConfig.verify|verify} messages. - * @param message OutputConfig message or plain object to encode + * Encodes the specified ExportAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsResponse.verify|verify} messages. + * @param message ExportAssetsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1beta1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.OutputConfig.verify|verify} messages. - * @param message OutputConfig message or plain object to encode + * Encodes the specified ExportAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.ExportAssetsResponse.verify|verify} messages. + * @param message ExportAssetsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1beta1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an OutputConfig message from the specified reader or buffer. + * Decodes an ExportAssetsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns OutputConfig + * @returns ExportAssetsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.OutputConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.ExportAssetsResponse; /** - * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * Decodes an ExportAssetsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns OutputConfig + * @returns ExportAssetsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.OutputConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.ExportAssetsResponse; /** - * Verifies an OutputConfig message. + * Verifies an ExportAssetsResponse message. * @param message Plain 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 OutputConfig message from a plain object. Also converts values to their respective internal types. + * Creates an ExportAssetsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns OutputConfig + * @returns ExportAssetsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.OutputConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.ExportAssetsResponse; /** - * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. - * @param message OutputConfig + * Creates a plain object from an ExportAssetsResponse message. Also converts values to other types if specified. + * @param message ExportAssetsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1beta1.OutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1beta1.ExportAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this OutputConfig to JSON. + * Converts this ExportAssetsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GcsDestination. */ - interface IGcsDestination { + /** Properties of a BatchGetAssetsHistoryRequest. */ + interface IBatchGetAssetsHistoryRequest { - /** GcsDestination uri */ - uri?: (string|null); + /** BatchGetAssetsHistoryRequest parent */ + parent?: (string|null); + + /** BatchGetAssetsHistoryRequest assetNames */ + assetNames?: (string[]|null); + + /** BatchGetAssetsHistoryRequest contentType */ + contentType?: (google.cloud.asset.v1beta1.ContentType|keyof typeof google.cloud.asset.v1beta1.ContentType|null); + + /** BatchGetAssetsHistoryRequest readTimeWindow */ + readTimeWindow?: (google.cloud.asset.v1beta1.ITimeWindow|null); } - /** Represents a GcsDestination. */ - class GcsDestination implements IGcsDestination { + /** Represents a BatchGetAssetsHistoryRequest. */ + class BatchGetAssetsHistoryRequest implements IBatchGetAssetsHistoryRequest { /** - * Constructs a new GcsDestination. + * Constructs a new BatchGetAssetsHistoryRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1beta1.IGcsDestination); + constructor(properties?: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest); - /** GcsDestination uri. */ - public uri: string; + /** BatchGetAssetsHistoryRequest parent. */ + public parent: string; - /** GcsDestination objectUri. */ - public objectUri?: "uri"; + /** BatchGetAssetsHistoryRequest assetNames. */ + public assetNames: string[]; + + /** BatchGetAssetsHistoryRequest contentType. */ + public contentType: (google.cloud.asset.v1beta1.ContentType|keyof typeof google.cloud.asset.v1beta1.ContentType); + + /** BatchGetAssetsHistoryRequest readTimeWindow. */ + public readTimeWindow?: (google.cloud.asset.v1beta1.ITimeWindow|null); /** - * Creates a new GcsDestination instance using the specified properties. + * Creates a new BatchGetAssetsHistoryRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GcsDestination instance + * @returns BatchGetAssetsHistoryRequest instance */ - public static create(properties?: google.cloud.asset.v1beta1.IGcsDestination): google.cloud.asset.v1beta1.GcsDestination; + public static create(properties?: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest): google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest; /** - * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1beta1.GcsDestination.verify|verify} messages. - * @param message GcsDestination message or plain object to encode + * Encodes the specified BatchGetAssetsHistoryRequest message. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest.verify|verify} messages. + * @param message BatchGetAssetsHistoryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.GcsDestination.verify|verify} messages. - * @param message GcsDestination message or plain object to encode + * Encodes the specified BatchGetAssetsHistoryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest.verify|verify} messages. + * @param message BatchGetAssetsHistoryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GcsDestination message from the specified reader or buffer. + * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GcsDestination + * @returns BatchGetAssetsHistoryRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.GcsDestination; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest; /** - * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GcsDestination + * @returns BatchGetAssetsHistoryRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.GcsDestination; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest; /** - * Verifies a GcsDestination message. + * Verifies a BatchGetAssetsHistoryRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * Creates a BatchGetAssetsHistoryRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GcsDestination + * @returns BatchGetAssetsHistoryRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.GcsDestination; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest; /** - * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. - * @param message GcsDestination + * Creates a plain object from a BatchGetAssetsHistoryRequest message. Also converts values to other types if specified. + * @param message BatchGetAssetsHistoryRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1beta1.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GcsDestination to JSON. + * Converts this BatchGetAssetsHistoryRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** ContentType enum. */ - enum ContentType { - CONTENT_TYPE_UNSPECIFIED = 0, - RESOURCE = 1, - IAM_POLICY = 2 - } - - /** Properties of a TemporalAsset. */ - interface ITemporalAsset { - - /** TemporalAsset window */ - window?: (google.cloud.asset.v1beta1.ITimeWindow|null); - - /** TemporalAsset deleted */ - deleted?: (boolean|null); + /** Properties of a BatchGetAssetsHistoryResponse. */ + interface IBatchGetAssetsHistoryResponse { - /** TemporalAsset asset */ - asset?: (google.cloud.asset.v1beta1.IAsset|null); + /** BatchGetAssetsHistoryResponse assets */ + assets?: (google.cloud.asset.v1beta1.ITemporalAsset[]|null); } - /** Represents a TemporalAsset. */ - class TemporalAsset implements ITemporalAsset { + /** Represents a BatchGetAssetsHistoryResponse. */ + class BatchGetAssetsHistoryResponse implements IBatchGetAssetsHistoryResponse { /** - * Constructs a new TemporalAsset. + * Constructs a new BatchGetAssetsHistoryResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1beta1.ITemporalAsset); - - /** TemporalAsset window. */ - public window?: (google.cloud.asset.v1beta1.ITimeWindow|null); - - /** TemporalAsset deleted. */ - public deleted: boolean; + constructor(properties?: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse); - /** TemporalAsset asset. */ - public asset?: (google.cloud.asset.v1beta1.IAsset|null); + /** BatchGetAssetsHistoryResponse assets. */ + public assets: google.cloud.asset.v1beta1.ITemporalAsset[]; /** - * Creates a new TemporalAsset instance using the specified properties. + * Creates a new BatchGetAssetsHistoryResponse instance using the specified properties. * @param [properties] Properties to set - * @returns TemporalAsset instance + * @returns BatchGetAssetsHistoryResponse instance */ - public static create(properties?: google.cloud.asset.v1beta1.ITemporalAsset): google.cloud.asset.v1beta1.TemporalAsset; + public static create(properties?: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse): google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse; /** - * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1beta1.TemporalAsset.verify|verify} messages. - * @param message TemporalAsset message or plain object to encode + * Encodes the specified BatchGetAssetsHistoryResponse message. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * @param message BatchGetAssetsHistoryResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1beta1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.TemporalAsset.verify|verify} messages. - * @param message TemporalAsset message or plain object to encode + * Encodes the specified BatchGetAssetsHistoryResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * @param message BatchGetAssetsHistoryResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1beta1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TemporalAsset message from the specified reader or buffer. + * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TemporalAsset + * @returns BatchGetAssetsHistoryResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.TemporalAsset; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse; /** - * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TemporalAsset + * @returns BatchGetAssetsHistoryResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.TemporalAsset; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse; /** - * Verifies a TemporalAsset message. + * Verifies a BatchGetAssetsHistoryResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. + * Creates a BatchGetAssetsHistoryResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TemporalAsset + * @returns BatchGetAssetsHistoryResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.TemporalAsset; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse; /** - * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. - * @param message TemporalAsset + * Creates a plain object from a BatchGetAssetsHistoryResponse message. Also converts values to other types if specified. + * @param message BatchGetAssetsHistoryResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1beta1.TemporalAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TemporalAsset to JSON. + * Converts this BatchGetAssetsHistoryResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a TimeWindow. */ - interface ITimeWindow { - - /** TimeWindow startTime */ - startTime?: (google.protobuf.ITimestamp|null); + /** Properties of an OutputConfig. */ + interface IOutputConfig { - /** TimeWindow endTime */ - endTime?: (google.protobuf.ITimestamp|null); + /** OutputConfig gcsDestination */ + gcsDestination?: (google.cloud.asset.v1beta1.IGcsDestination|null); } - /** Represents a TimeWindow. */ - class TimeWindow implements ITimeWindow { + /** Represents an OutputConfig. */ + class OutputConfig implements IOutputConfig { /** - * Constructs a new TimeWindow. + * Constructs a new OutputConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1beta1.ITimeWindow); + constructor(properties?: google.cloud.asset.v1beta1.IOutputConfig); - /** TimeWindow startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); + /** OutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.asset.v1beta1.IGcsDestination|null); - /** TimeWindow endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); + /** OutputConfig destination. */ + public destination?: "gcsDestination"; /** - * Creates a new TimeWindow instance using the specified properties. + * Creates a new OutputConfig instance using the specified properties. * @param [properties] Properties to set - * @returns TimeWindow instance + * @returns OutputConfig instance */ - public static create(properties?: google.cloud.asset.v1beta1.ITimeWindow): google.cloud.asset.v1beta1.TimeWindow; + public static create(properties?: google.cloud.asset.v1beta1.IOutputConfig): google.cloud.asset.v1beta1.OutputConfig; /** - * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1beta1.TimeWindow.verify|verify} messages. - * @param message TimeWindow message or plain object to encode + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1beta1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1beta1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.TimeWindow.verify|verify} messages. - * @param message TimeWindow message or plain object to encode + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1beta1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TimeWindow message from the specified reader or buffer. + * Decodes an OutputConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TimeWindow + * @returns OutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.TimeWindow; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.OutputConfig; /** - * Decodes a TimeWindow message from the specified reader or buffer, length delimited. + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TimeWindow + * @returns OutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.TimeWindow; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.OutputConfig; /** - * Verifies a TimeWindow message. + * Verifies an OutputConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TimeWindow + * @returns OutputConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.TimeWindow; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.OutputConfig; /** - * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. - * @param message TimeWindow + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @param message OutputConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1beta1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1beta1.OutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TimeWindow to JSON. + * Converts this OutputConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an Asset. */ - interface IAsset { - - /** Asset name */ - name?: (string|null); - - /** Asset assetType */ - assetType?: (string|null); + /** Properties of a GcsDestination. */ + interface IGcsDestination { - /** Asset resource */ - resource?: (google.cloud.asset.v1beta1.IResource|null); + /** GcsDestination uri */ + uri?: (string|null); - /** Asset iamPolicy */ - iamPolicy?: (google.iam.v1.IPolicy|null); + /** GcsDestination uriPrefix */ + uriPrefix?: (string|null); } - /** Represents an Asset. */ - class Asset implements IAsset { + /** Represents a GcsDestination. */ + class GcsDestination implements IGcsDestination { /** - * Constructs a new Asset. + * Constructs a new GcsDestination. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1beta1.IAsset); - - /** Asset name. */ - public name: string; + constructor(properties?: google.cloud.asset.v1beta1.IGcsDestination); - /** Asset assetType. */ - public assetType: string; + /** GcsDestination uri. */ + public uri: string; - /** Asset resource. */ - public resource?: (google.cloud.asset.v1beta1.IResource|null); + /** GcsDestination uriPrefix. */ + public uriPrefix: string; - /** Asset iamPolicy. */ - public iamPolicy?: (google.iam.v1.IPolicy|null); + /** GcsDestination objectUri. */ + public objectUri?: ("uri"|"uriPrefix"); /** - * Creates a new Asset instance using the specified properties. + * Creates a new GcsDestination instance using the specified properties. * @param [properties] Properties to set - * @returns Asset instance + * @returns GcsDestination instance */ - public static create(properties?: google.cloud.asset.v1beta1.IAsset): google.cloud.asset.v1beta1.Asset; + public static create(properties?: google.cloud.asset.v1beta1.IGcsDestination): google.cloud.asset.v1beta1.GcsDestination; /** - * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1beta1.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1beta1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Asset message from the specified reader or buffer. + * Decodes a GcsDestination message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Asset + * @returns GcsDestination * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.Asset; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.GcsDestination; /** - * Decodes an Asset message from the specified reader or buffer, length delimited. + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Asset + * @returns GcsDestination * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.Asset; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.GcsDestination; /** - * Verifies an Asset message. + * Verifies a GcsDestination message. * @param message Plain 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 Asset message from a plain object. Also converts values to their respective internal types. + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Asset + * @returns GcsDestination */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.Asset; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.GcsDestination; /** - * Creates a plain object from an Asset message. Also converts values to other types if specified. - * @param message Asset + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @param message GcsDestination * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1beta1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1beta1.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Asset to JSON. + * Converts this GcsDestination to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Resource. */ - interface IResource { + /** ContentType enum. */ + enum ContentType { + CONTENT_TYPE_UNSPECIFIED = 0, + RESOURCE = 1, + IAM_POLICY = 2 + } + } - /** Resource version */ - version?: (string|null); + /** Namespace v1p1beta1. */ + namespace v1p1beta1 { - /** Resource discoveryDocumentUri */ - discoveryDocumentUri?: (string|null); + /** Properties of a StandardResourceMetadata. */ + interface IStandardResourceMetadata { - /** Resource discoveryName */ - discoveryName?: (string|null); + /** StandardResourceMetadata name */ + name?: (string|null); - /** Resource resourceUrl */ - resourceUrl?: (string|null); + /** StandardResourceMetadata assetType */ + assetType?: (string|null); - /** Resource parent */ - parent?: (string|null); + /** StandardResourceMetadata project */ + project?: (string|null); - /** Resource data */ - data?: (google.protobuf.IStruct|null); + /** StandardResourceMetadata displayName */ + displayName?: (string|null); + + /** StandardResourceMetadata description */ + description?: (string|null); + + /** StandardResourceMetadata additionalAttributes */ + additionalAttributes?: (string[]|null); } - /** Represents a Resource. */ - class Resource implements IResource { + /** Represents a StandardResourceMetadata. */ + class StandardResourceMetadata implements IStandardResourceMetadata { /** - * Constructs a new Resource. + * Constructs a new StandardResourceMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1beta1.IResource); + constructor(properties?: google.cloud.asset.v1p1beta1.IStandardResourceMetadata); - /** Resource version. */ - public version: string; + /** StandardResourceMetadata name. */ + public name: string; - /** Resource discoveryDocumentUri. */ - public discoveryDocumentUri: string; + /** StandardResourceMetadata assetType. */ + public assetType: string; - /** Resource discoveryName. */ - public discoveryName: string; + /** StandardResourceMetadata project. */ + public project: string; - /** Resource resourceUrl. */ - public resourceUrl: string; + /** StandardResourceMetadata displayName. */ + public displayName: string; - /** Resource parent. */ - public parent: string; + /** StandardResourceMetadata description. */ + public description: string; - /** Resource data. */ - public data?: (google.protobuf.IStruct|null); + /** StandardResourceMetadata additionalAttributes. */ + public additionalAttributes: string[]; /** - * Creates a new Resource instance using the specified properties. + * Creates a new StandardResourceMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns Resource instance + * @returns StandardResourceMetadata instance */ - public static create(properties?: google.cloud.asset.v1beta1.IResource): google.cloud.asset.v1beta1.Resource; + public static create(properties?: google.cloud.asset.v1p1beta1.IStandardResourceMetadata): google.cloud.asset.v1p1beta1.StandardResourceMetadata; /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1beta1.Resource.verify|verify} messages. - * @param message Resource message or plain object to encode + * Encodes the specified StandardResourceMetadata message. Does not implicitly {@link google.cloud.asset.v1p1beta1.StandardResourceMetadata.verify|verify} messages. + * @param message StandardResourceMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1beta1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p1beta1.IStandardResourceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.Resource.verify|verify} messages. - * @param message Resource message or plain object to encode + * Encodes the specified StandardResourceMetadata message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.StandardResourceMetadata.verify|verify} messages. + * @param message StandardResourceMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1beta1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p1beta1.IStandardResourceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Resource message from the specified reader or buffer. + * Decodes a StandardResourceMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Resource + * @returns StandardResourceMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1beta1.Resource; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p1beta1.StandardResourceMetadata; /** - * Decodes a Resource message from the specified reader or buffer, length delimited. + * Decodes a StandardResourceMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Resource + * @returns StandardResourceMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1beta1.Resource; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p1beta1.StandardResourceMetadata; /** - * Verifies a Resource message. + * Verifies a StandardResourceMetadata message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * Creates a StandardResourceMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Resource + * @returns StandardResourceMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1beta1.Resource; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.StandardResourceMetadata; /** - * Creates a plain object from a Resource message. Also converts values to other types if specified. - * @param message Resource + * Creates a plain object from a StandardResourceMetadata message. Also converts values to other types if specified. + * @param message StandardResourceMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1beta1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p1beta1.StandardResourceMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Resource to JSON. + * Converts this StandardResourceMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - } - /** Namespace v1p2beta1. */ - namespace v1p2beta1 { + /** Properties of an IamPolicySearchResult. */ + interface IIamPolicySearchResult { + + /** IamPolicySearchResult resource */ + resource?: (string|null); + + /** IamPolicySearchResult project */ + project?: (string|null); + + /** IamPolicySearchResult policy */ + policy?: (google.iam.v1.IPolicy|null); + } + + /** Represents an IamPolicySearchResult. */ + class IamPolicySearchResult implements IIamPolicySearchResult { + + /** + * Constructs a new IamPolicySearchResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p1beta1.IIamPolicySearchResult); + + /** IamPolicySearchResult resource. */ + public resource: string; + + /** IamPolicySearchResult project. */ + public project: string; + + /** IamPolicySearchResult policy. */ + public policy?: (google.iam.v1.IPolicy|null); + + /** + * Creates a new IamPolicySearchResult instance using the specified properties. + * @param [properties] Properties to set + * @returns IamPolicySearchResult instance + */ + public static create(properties?: google.cloud.asset.v1p1beta1.IIamPolicySearchResult): google.cloud.asset.v1p1beta1.IamPolicySearchResult; + + /** + * Encodes the specified IamPolicySearchResult message. Does not implicitly {@link google.cloud.asset.v1p1beta1.IamPolicySearchResult.verify|verify} messages. + * @param message IamPolicySearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p1beta1.IIamPolicySearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamPolicySearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.IamPolicySearchResult.verify|verify} messages. + * @param message IamPolicySearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p1beta1.IIamPolicySearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IamPolicySearchResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IamPolicySearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p1beta1.IamPolicySearchResult; + + /** + * Decodes an IamPolicySearchResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IamPolicySearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p1beta1.IamPolicySearchResult; + + /** + * Verifies an IamPolicySearchResult message. + * @param message Plain 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 IamPolicySearchResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IamPolicySearchResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.IamPolicySearchResult; + + /** + * Creates a plain object from an IamPolicySearchResult message. Also converts values to other types if specified. + * @param message IamPolicySearchResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p1beta1.IamPolicySearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamPolicySearchResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } /** Represents an AssetService */ class AssetService extends $protobuf.rpc.Service { @@ -3323,2178 +3551,2765 @@ export namespace google { public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): AssetService; /** - * Calls ExportAssets. - * @param request ExportAssetsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Calls SearchResources. + * @param request SearchResourcesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchResourcesResponse */ - public exportAssets(request: google.cloud.asset.v1p2beta1.IExportAssetsRequest, callback: google.cloud.asset.v1p2beta1.AssetService.ExportAssetsCallback): void; + public searchResources(request: google.cloud.asset.v1p1beta1.ISearchResourcesRequest, callback: google.cloud.asset.v1p1beta1.AssetService.SearchResourcesCallback): void; /** - * Calls ExportAssets. - * @param request ExportAssetsRequest message or plain object + * Calls SearchResources. + * @param request SearchResourcesRequest message or plain object * @returns Promise */ - public exportAssets(request: google.cloud.asset.v1p2beta1.IExportAssetsRequest): Promise; + public searchResources(request: google.cloud.asset.v1p1beta1.ISearchResourcesRequest): Promise; /** - * Calls BatchGetAssetsHistory. - * @param request BatchGetAssetsHistoryRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BatchGetAssetsHistoryResponse + * Calls SearchIamPolicies. + * @param request SearchIamPoliciesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchIamPoliciesResponse */ - public batchGetAssetsHistory(request: google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryRequest, callback: google.cloud.asset.v1p2beta1.AssetService.BatchGetAssetsHistoryCallback): void; + public searchIamPolicies(request: google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest, callback: google.cloud.asset.v1p1beta1.AssetService.SearchIamPoliciesCallback): void; /** - * Calls BatchGetAssetsHistory. - * @param request BatchGetAssetsHistoryRequest message or plain object + * Calls SearchIamPolicies. + * @param request SearchIamPoliciesRequest message or plain object * @returns Promise */ - public batchGetAssetsHistory(request: google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryRequest): Promise; + public searchIamPolicies(request: google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest): Promise; /** - * Calls CreateFeed. - * @param request CreateFeedRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Feed + * Calls SearchAllResources. + * @param request SearchAllResourcesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchAllResourcesResponse */ - public createFeed(request: google.cloud.asset.v1p2beta1.ICreateFeedRequest, callback: google.cloud.asset.v1p2beta1.AssetService.CreateFeedCallback): void; + public searchAllResources(request: google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, callback: google.cloud.asset.v1p1beta1.AssetService.SearchAllResourcesCallback): void; /** - * Calls CreateFeed. - * @param request CreateFeedRequest message or plain object + * Calls SearchAllResources. + * @param request SearchAllResourcesRequest message or plain object * @returns Promise */ - public createFeed(request: google.cloud.asset.v1p2beta1.ICreateFeedRequest): Promise; + public searchAllResources(request: google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest): Promise; /** - * Calls GetFeed. - * @param request GetFeedRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Feed + * Calls SearchAllIamPolicies. + * @param request SearchAllIamPoliciesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchAllIamPoliciesResponse */ - public getFeed(request: google.cloud.asset.v1p2beta1.IGetFeedRequest, callback: google.cloud.asset.v1p2beta1.AssetService.GetFeedCallback): void; + public searchAllIamPolicies(request: google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, callback: google.cloud.asset.v1p1beta1.AssetService.SearchAllIamPoliciesCallback): void; /** - * Calls GetFeed. - * @param request GetFeedRequest message or plain object + * Calls SearchAllIamPolicies. + * @param request SearchAllIamPoliciesRequest message or plain object * @returns Promise */ - public getFeed(request: google.cloud.asset.v1p2beta1.IGetFeedRequest): Promise; + public searchAllIamPolicies(request: google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest): Promise; + } + + namespace AssetService { /** - * Calls ListFeeds. - * @param request ListFeedsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListFeedsResponse + * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService#searchResources}. + * @param error Error, if any + * @param [response] SearchResourcesResponse */ - public listFeeds(request: google.cloud.asset.v1p2beta1.IListFeedsRequest, callback: google.cloud.asset.v1p2beta1.AssetService.ListFeedsCallback): void; + type SearchResourcesCallback = (error: (Error|null), response?: google.cloud.asset.v1p1beta1.SearchResourcesResponse) => void; /** - * Calls ListFeeds. - * @param request ListFeedsRequest message or plain object - * @returns Promise + * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService#searchIamPolicies}. + * @param error Error, if any + * @param [response] SearchIamPoliciesResponse */ - public listFeeds(request: google.cloud.asset.v1p2beta1.IListFeedsRequest): Promise; + type SearchIamPoliciesCallback = (error: (Error|null), response?: google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse) => void; /** - * Calls UpdateFeed. - * @param request UpdateFeedRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Feed - */ - public updateFeed(request: google.cloud.asset.v1p2beta1.IUpdateFeedRequest, callback: google.cloud.asset.v1p2beta1.AssetService.UpdateFeedCallback): void; - - /** - * Calls UpdateFeed. - * @param request UpdateFeedRequest message or plain object - * @returns Promise - */ - public updateFeed(request: google.cloud.asset.v1p2beta1.IUpdateFeedRequest): Promise; - - /** - * Calls DeleteFeed. - * @param request DeleteFeedRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteFeed(request: google.cloud.asset.v1p2beta1.IDeleteFeedRequest, callback: google.cloud.asset.v1p2beta1.AssetService.DeleteFeedCallback): void; - - /** - * Calls DeleteFeed. - * @param request DeleteFeedRequest message or plain object - * @returns Promise - */ - public deleteFeed(request: google.cloud.asset.v1p2beta1.IDeleteFeedRequest): Promise; - } - - namespace AssetService { - - /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#exportAssets}. - * @param error Error, if any - * @param [response] Operation - */ - type ExportAssetsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#batchGetAssetsHistory}. - * @param error Error, if any - * @param [response] BatchGetAssetsHistoryResponse - */ - type BatchGetAssetsHistoryCallback = (error: (Error|null), response?: google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse) => void; - - /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#createFeed}. - * @param error Error, if any - * @param [response] Feed - */ - type CreateFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1p2beta1.Feed) => void; - - /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#getFeed}. - * @param error Error, if any - * @param [response] Feed - */ - type GetFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1p2beta1.Feed) => void; - - /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#listFeeds}. + * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService#searchAllResources}. * @param error Error, if any - * @param [response] ListFeedsResponse - */ - type ListFeedsCallback = (error: (Error|null), response?: google.cloud.asset.v1p2beta1.ListFeedsResponse) => void; - - /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#updateFeed}. - * @param error Error, if any - * @param [response] Feed + * @param [response] SearchAllResourcesResponse */ - type UpdateFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1p2beta1.Feed) => void; + type SearchAllResourcesCallback = (error: (Error|null), response?: google.cloud.asset.v1p1beta1.SearchAllResourcesResponse) => void; /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#deleteFeed}. + * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService#searchAllIamPolicies}. * @param error Error, if any - * @param [response] Empty + * @param [response] SearchAllIamPoliciesResponse */ - type DeleteFeedCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + type SearchAllIamPoliciesCallback = (error: (Error|null), response?: google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse) => void; } - /** Properties of an ExportAssetsRequest. */ - interface IExportAssetsRequest { + /** Properties of a SearchResourcesRequest. */ + interface ISearchResourcesRequest { - /** ExportAssetsRequest parent */ - parent?: (string|null); + /** SearchResourcesRequest scope */ + scope?: (string|null); - /** ExportAssetsRequest readTime */ - readTime?: (google.protobuf.ITimestamp|null); + /** SearchResourcesRequest query */ + query?: (string|null); - /** ExportAssetsRequest assetTypes */ + /** SearchResourcesRequest assetTypes */ assetTypes?: (string[]|null); - /** ExportAssetsRequest contentType */ - contentType?: (google.cloud.asset.v1p2beta1.ContentType|keyof typeof google.cloud.asset.v1p2beta1.ContentType|null); + /** SearchResourcesRequest pageSize */ + pageSize?: (number|null); - /** ExportAssetsRequest outputConfig */ - outputConfig?: (google.cloud.asset.v1p2beta1.IOutputConfig|null); + /** SearchResourcesRequest pageToken */ + pageToken?: (string|null); } - /** Represents an ExportAssetsRequest. */ - class ExportAssetsRequest implements IExportAssetsRequest { + /** Represents a SearchResourcesRequest. */ + class SearchResourcesRequest implements ISearchResourcesRequest { /** - * Constructs a new ExportAssetsRequest. + * Constructs a new SearchResourcesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1p2beta1.IExportAssetsRequest); + constructor(properties?: google.cloud.asset.v1p1beta1.ISearchResourcesRequest); - /** ExportAssetsRequest parent. */ - public parent: string; + /** SearchResourcesRequest scope. */ + public scope: string; - /** ExportAssetsRequest readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); + /** SearchResourcesRequest query. */ + public query: string; - /** ExportAssetsRequest assetTypes. */ + /** SearchResourcesRequest assetTypes. */ public assetTypes: string[]; - /** ExportAssetsRequest contentType. */ - public contentType: (google.cloud.asset.v1p2beta1.ContentType|keyof typeof google.cloud.asset.v1p2beta1.ContentType); + /** SearchResourcesRequest pageSize. */ + public pageSize: number; - /** ExportAssetsRequest outputConfig. */ - public outputConfig?: (google.cloud.asset.v1p2beta1.IOutputConfig|null); + /** SearchResourcesRequest pageToken. */ + public pageToken: string; /** - * Creates a new ExportAssetsRequest instance using the specified properties. + * Creates a new SearchResourcesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ExportAssetsRequest instance + * @returns SearchResourcesRequest instance */ - public static create(properties?: google.cloud.asset.v1p2beta1.IExportAssetsRequest): google.cloud.asset.v1p2beta1.ExportAssetsRequest; + public static create(properties?: google.cloud.asset.v1p1beta1.ISearchResourcesRequest): google.cloud.asset.v1p1beta1.SearchResourcesRequest; /** - * Encodes the specified ExportAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ExportAssetsRequest.verify|verify} messages. - * @param message ExportAssetsRequest message or plain object to encode + * Encodes the specified SearchResourcesRequest message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesRequest.verify|verify} messages. + * @param message SearchResourcesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p2beta1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p1beta1.ISearchResourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ExportAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ExportAssetsRequest.verify|verify} messages. - * @param message ExportAssetsRequest message or plain object to encode + * Encodes the specified SearchResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesRequest.verify|verify} messages. + * @param message SearchResourcesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p1beta1.ISearchResourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExportAssetsRequest message from the specified reader or buffer. + * Decodes a SearchResourcesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ExportAssetsRequest + * @returns SearchResourcesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.ExportAssetsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p1beta1.SearchResourcesRequest; /** - * Decodes an ExportAssetsRequest message from the specified reader or buffer, length delimited. + * Decodes a SearchResourcesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExportAssetsRequest + * @returns SearchResourcesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.ExportAssetsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p1beta1.SearchResourcesRequest; /** - * Verifies an ExportAssetsRequest message. + * Verifies a SearchResourcesRequest message. * @param message Plain 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 ExportAssetsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SearchResourcesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExportAssetsRequest + * @returns SearchResourcesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.ExportAssetsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.SearchResourcesRequest; /** - * Creates a plain object from an ExportAssetsRequest message. Also converts values to other types if specified. - * @param message ExportAssetsRequest + * Creates a plain object from a SearchResourcesRequest message. Also converts values to other types if specified. + * @param message SearchResourcesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p2beta1.ExportAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p1beta1.SearchResourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExportAssetsRequest to JSON. + * Converts this SearchResourcesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an ExportAssetsResponse. */ - interface IExportAssetsResponse { + /** Properties of a SearchResourcesResponse. */ + interface ISearchResourcesResponse { - /** ExportAssetsResponse readTime */ - readTime?: (google.protobuf.ITimestamp|null); + /** SearchResourcesResponse results */ + results?: (google.cloud.asset.v1p1beta1.IStandardResourceMetadata[]|null); - /** ExportAssetsResponse outputConfig */ - outputConfig?: (google.cloud.asset.v1p2beta1.IOutputConfig|null); + /** SearchResourcesResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents an ExportAssetsResponse. */ - class ExportAssetsResponse implements IExportAssetsResponse { + /** Represents a SearchResourcesResponse. */ + class SearchResourcesResponse implements ISearchResourcesResponse { /** - * Constructs a new ExportAssetsResponse. + * Constructs a new SearchResourcesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1p2beta1.IExportAssetsResponse); + constructor(properties?: google.cloud.asset.v1p1beta1.ISearchResourcesResponse); - /** ExportAssetsResponse readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); + /** SearchResourcesResponse results. */ + public results: google.cloud.asset.v1p1beta1.IStandardResourceMetadata[]; - /** ExportAssetsResponse outputConfig. */ - public outputConfig?: (google.cloud.asset.v1p2beta1.IOutputConfig|null); + /** SearchResourcesResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new ExportAssetsResponse instance using the specified properties. + * Creates a new SearchResourcesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ExportAssetsResponse instance + * @returns SearchResourcesResponse instance */ - public static create(properties?: google.cloud.asset.v1p2beta1.IExportAssetsResponse): google.cloud.asset.v1p2beta1.ExportAssetsResponse; + public static create(properties?: google.cloud.asset.v1p1beta1.ISearchResourcesResponse): google.cloud.asset.v1p1beta1.SearchResourcesResponse; /** - * Encodes the specified ExportAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ExportAssetsResponse.verify|verify} messages. - * @param message ExportAssetsResponse message or plain object to encode + * Encodes the specified SearchResourcesResponse message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesResponse.verify|verify} messages. + * @param message SearchResourcesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p2beta1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p1beta1.ISearchResourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ExportAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ExportAssetsResponse.verify|verify} messages. - * @param message ExportAssetsResponse message or plain object to encode + * Encodes the specified SearchResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesResponse.verify|verify} messages. + * @param message SearchResourcesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p1beta1.ISearchResourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExportAssetsResponse message from the specified reader or buffer. + * Decodes a SearchResourcesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ExportAssetsResponse + * @returns SearchResourcesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.ExportAssetsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p1beta1.SearchResourcesResponse; /** - * Decodes an ExportAssetsResponse message from the specified reader or buffer, length delimited. + * Decodes a SearchResourcesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExportAssetsResponse + * @returns SearchResourcesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.ExportAssetsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p1beta1.SearchResourcesResponse; /** - * Verifies an ExportAssetsResponse message. + * Verifies a SearchResourcesResponse message. * @param message Plain 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 ExportAssetsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SearchResourcesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExportAssetsResponse + * @returns SearchResourcesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.ExportAssetsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.SearchResourcesResponse; /** - * Creates a plain object from an ExportAssetsResponse message. Also converts values to other types if specified. - * @param message ExportAssetsResponse + * Creates a plain object from a SearchResourcesResponse message. Also converts values to other types if specified. + * @param message SearchResourcesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p2beta1.ExportAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p1beta1.SearchResourcesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExportAssetsResponse to JSON. + * Converts this SearchResourcesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BatchGetAssetsHistoryRequest. */ - interface IBatchGetAssetsHistoryRequest { + /** Properties of a SearchIamPoliciesRequest. */ + interface ISearchIamPoliciesRequest { - /** BatchGetAssetsHistoryRequest parent */ - parent?: (string|null); + /** SearchIamPoliciesRequest scope */ + scope?: (string|null); - /** BatchGetAssetsHistoryRequest assetNames */ - assetNames?: (string[]|null); + /** SearchIamPoliciesRequest query */ + query?: (string|null); - /** BatchGetAssetsHistoryRequest contentType */ - contentType?: (google.cloud.asset.v1p2beta1.ContentType|keyof typeof google.cloud.asset.v1p2beta1.ContentType|null); + /** SearchIamPoliciesRequest pageSize */ + pageSize?: (number|null); - /** BatchGetAssetsHistoryRequest readTimeWindow */ - readTimeWindow?: (google.cloud.asset.v1p2beta1.ITimeWindow|null); + /** SearchIamPoliciesRequest pageToken */ + pageToken?: (string|null); } - /** Represents a BatchGetAssetsHistoryRequest. */ - class BatchGetAssetsHistoryRequest implements IBatchGetAssetsHistoryRequest { + /** Represents a SearchIamPoliciesRequest. */ + class SearchIamPoliciesRequest implements ISearchIamPoliciesRequest { /** - * Constructs a new BatchGetAssetsHistoryRequest. + * Constructs a new SearchIamPoliciesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryRequest); + constructor(properties?: google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest); - /** BatchGetAssetsHistoryRequest parent. */ - public parent: string; + /** SearchIamPoliciesRequest scope. */ + public scope: string; - /** BatchGetAssetsHistoryRequest assetNames. */ - public assetNames: string[]; + /** SearchIamPoliciesRequest query. */ + public query: string; - /** BatchGetAssetsHistoryRequest contentType. */ - public contentType: (google.cloud.asset.v1p2beta1.ContentType|keyof typeof google.cloud.asset.v1p2beta1.ContentType); + /** SearchIamPoliciesRequest pageSize. */ + public pageSize: number; - /** BatchGetAssetsHistoryRequest readTimeWindow. */ - public readTimeWindow?: (google.cloud.asset.v1p2beta1.ITimeWindow|null); + /** SearchIamPoliciesRequest pageToken. */ + public pageToken: string; /** - * Creates a new BatchGetAssetsHistoryRequest instance using the specified properties. + * Creates a new SearchIamPoliciesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns BatchGetAssetsHistoryRequest instance + * @returns SearchIamPoliciesRequest instance */ - public static create(properties?: google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryRequest): google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest; + public static create(properties?: google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest): google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest; /** - * Encodes the specified BatchGetAssetsHistoryRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest.verify|verify} messages. - * @param message BatchGetAssetsHistoryRequest message or plain object to encode + * Encodes the specified SearchIamPoliciesRequest message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest.verify|verify} messages. + * @param message SearchIamPoliciesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchGetAssetsHistoryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest.verify|verify} messages. - * @param message BatchGetAssetsHistoryRequest message or plain object to encode + * Encodes the specified SearchIamPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest.verify|verify} messages. + * @param message SearchIamPoliciesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer. + * Decodes a SearchIamPoliciesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchGetAssetsHistoryRequest + * @returns SearchIamPoliciesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest; /** - * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer, length delimited. + * Decodes a SearchIamPoliciesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchGetAssetsHistoryRequest + * @returns SearchIamPoliciesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest; /** - * Verifies a BatchGetAssetsHistoryRequest message. + * Verifies a SearchIamPoliciesRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchGetAssetsHistoryRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SearchIamPoliciesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchGetAssetsHistoryRequest + * @returns SearchIamPoliciesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest; /** - * Creates a plain object from a BatchGetAssetsHistoryRequest message. Also converts values to other types if specified. - * @param message BatchGetAssetsHistoryRequest + * Creates a plain object from a SearchIamPoliciesRequest message. Also converts values to other types if specified. + * @param message SearchIamPoliciesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchGetAssetsHistoryRequest to JSON. + * Converts this SearchIamPoliciesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BatchGetAssetsHistoryResponse. */ - interface IBatchGetAssetsHistoryResponse { + /** Properties of a SearchIamPoliciesResponse. */ + interface ISearchIamPoliciesResponse { - /** BatchGetAssetsHistoryResponse assets */ - assets?: (google.cloud.asset.v1p2beta1.ITemporalAsset[]|null); + /** SearchIamPoliciesResponse results */ + results?: (google.cloud.asset.v1p1beta1.IIamPolicySearchResult[]|null); + + /** SearchIamPoliciesResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a BatchGetAssetsHistoryResponse. */ - class BatchGetAssetsHistoryResponse implements IBatchGetAssetsHistoryResponse { + /** Represents a SearchIamPoliciesResponse. */ + class SearchIamPoliciesResponse implements ISearchIamPoliciesResponse { /** - * Constructs a new BatchGetAssetsHistoryResponse. + * Constructs a new SearchIamPoliciesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryResponse); + constructor(properties?: google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse); - /** BatchGetAssetsHistoryResponse assets. */ - public assets: google.cloud.asset.v1p2beta1.ITemporalAsset[]; + /** SearchIamPoliciesResponse results. */ + public results: google.cloud.asset.v1p1beta1.IIamPolicySearchResult[]; + + /** SearchIamPoliciesResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new BatchGetAssetsHistoryResponse instance using the specified properties. + * Creates a new SearchIamPoliciesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns BatchGetAssetsHistoryResponse instance + * @returns SearchIamPoliciesResponse instance */ - public static create(properties?: google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryResponse): google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse; + public static create(properties?: google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse): google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse; /** - * Encodes the specified BatchGetAssetsHistoryResponse message. Does not implicitly {@link google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. - * @param message BatchGetAssetsHistoryResponse message or plain object to encode + * Encodes the specified SearchIamPoliciesResponse message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse.verify|verify} messages. + * @param message SearchIamPoliciesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchGetAssetsHistoryResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. - * @param message BatchGetAssetsHistoryResponse message or plain object to encode + * Encodes the specified SearchIamPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse.verify|verify} messages. + * @param message SearchIamPoliciesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer. + * Decodes a SearchIamPoliciesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchGetAssetsHistoryResponse + * @returns SearchIamPoliciesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse; /** - * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer, length delimited. + * Decodes a SearchIamPoliciesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchGetAssetsHistoryResponse + * @returns SearchIamPoliciesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse; /** - * Verifies a BatchGetAssetsHistoryResponse message. + * Verifies a SearchIamPoliciesResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchGetAssetsHistoryResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SearchIamPoliciesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchGetAssetsHistoryResponse + * @returns SearchIamPoliciesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse; /** - * Creates a plain object from a BatchGetAssetsHistoryResponse message. Also converts values to other types if specified. - * @param message BatchGetAssetsHistoryResponse + * Creates a plain object from a SearchIamPoliciesResponse message. Also converts values to other types if specified. + * @param message SearchIamPoliciesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchGetAssetsHistoryResponse to JSON. + * Converts this SearchIamPoliciesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CreateFeedRequest. */ - interface ICreateFeedRequest { + /** Properties of a SearchAllResourcesRequest. */ + interface ISearchAllResourcesRequest { - /** CreateFeedRequest parent */ - parent?: (string|null); + /** SearchAllResourcesRequest scope */ + scope?: (string|null); - /** CreateFeedRequest feedId */ - feedId?: (string|null); + /** SearchAllResourcesRequest query */ + query?: (string|null); - /** CreateFeedRequest feed */ - feed?: (google.cloud.asset.v1p2beta1.IFeed|null); + /** SearchAllResourcesRequest assetTypes */ + assetTypes?: (string[]|null); + + /** SearchAllResourcesRequest pageSize */ + pageSize?: (number|null); + + /** SearchAllResourcesRequest pageToken */ + pageToken?: (string|null); } - /** Represents a CreateFeedRequest. */ - class CreateFeedRequest implements ICreateFeedRequest { + /** Represents a SearchAllResourcesRequest. */ + class SearchAllResourcesRequest implements ISearchAllResourcesRequest { /** - * Constructs a new CreateFeedRequest. + * Constructs a new SearchAllResourcesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1p2beta1.ICreateFeedRequest); + constructor(properties?: google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest); - /** CreateFeedRequest parent. */ - public parent: string; + /** SearchAllResourcesRequest scope. */ + public scope: string; - /** CreateFeedRequest feedId. */ - public feedId: string; + /** SearchAllResourcesRequest query. */ + public query: string; - /** CreateFeedRequest feed. */ - public feed?: (google.cloud.asset.v1p2beta1.IFeed|null); + /** SearchAllResourcesRequest assetTypes. */ + public assetTypes: string[]; + + /** SearchAllResourcesRequest pageSize. */ + public pageSize: number; + + /** SearchAllResourcesRequest pageToken. */ + public pageToken: string; /** - * Creates a new CreateFeedRequest instance using the specified properties. + * Creates a new SearchAllResourcesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateFeedRequest instance + * @returns SearchAllResourcesRequest instance */ - public static create(properties?: google.cloud.asset.v1p2beta1.ICreateFeedRequest): google.cloud.asset.v1p2beta1.CreateFeedRequest; + public static create(properties?: google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest): google.cloud.asset.v1p1beta1.SearchAllResourcesRequest; /** - * Encodes the specified CreateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.CreateFeedRequest.verify|verify} messages. - * @param message CreateFeedRequest message or plain object to encode + * Encodes the specified SearchAllResourcesRequest message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllResourcesRequest.verify|verify} messages. + * @param message SearchAllResourcesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p2beta1.ICreateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.CreateFeedRequest.verify|verify} messages. - * @param message CreateFeedRequest message or plain object to encode + * Encodes the specified SearchAllResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllResourcesRequest.verify|verify} messages. + * @param message SearchAllResourcesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.ICreateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateFeedRequest message from the specified reader or buffer. + * Decodes a SearchAllResourcesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateFeedRequest + * @returns SearchAllResourcesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.CreateFeedRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p1beta1.SearchAllResourcesRequest; /** - * Decodes a CreateFeedRequest message from the specified reader or buffer, length delimited. + * Decodes a SearchAllResourcesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateFeedRequest + * @returns SearchAllResourcesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.CreateFeedRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p1beta1.SearchAllResourcesRequest; /** - * Verifies a CreateFeedRequest message. + * Verifies a SearchAllResourcesRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateFeedRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SearchAllResourcesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateFeedRequest + * @returns SearchAllResourcesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.CreateFeedRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.SearchAllResourcesRequest; /** - * Creates a plain object from a CreateFeedRequest message. Also converts values to other types if specified. - * @param message CreateFeedRequest + * Creates a plain object from a SearchAllResourcesRequest message. Also converts values to other types if specified. + * @param message SearchAllResourcesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p2beta1.CreateFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p1beta1.SearchAllResourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateFeedRequest to JSON. + * Converts this SearchAllResourcesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetFeedRequest. */ - interface IGetFeedRequest { + /** Properties of a SearchAllResourcesResponse. */ + interface ISearchAllResourcesResponse { - /** GetFeedRequest name */ - name?: (string|null); + /** SearchAllResourcesResponse results */ + results?: (google.cloud.asset.v1p1beta1.IStandardResourceMetadata[]|null); + + /** SearchAllResourcesResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a GetFeedRequest. */ - class GetFeedRequest implements IGetFeedRequest { + /** Represents a SearchAllResourcesResponse. */ + class SearchAllResourcesResponse implements ISearchAllResourcesResponse { /** - * Constructs a new GetFeedRequest. + * Constructs a new SearchAllResourcesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1p2beta1.IGetFeedRequest); + constructor(properties?: google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse); - /** GetFeedRequest name. */ - public name: string; + /** SearchAllResourcesResponse results. */ + public results: google.cloud.asset.v1p1beta1.IStandardResourceMetadata[]; + + /** SearchAllResourcesResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new GetFeedRequest instance using the specified properties. + * Creates a new SearchAllResourcesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns GetFeedRequest instance + * @returns SearchAllResourcesResponse instance */ - public static create(properties?: google.cloud.asset.v1p2beta1.IGetFeedRequest): google.cloud.asset.v1p2beta1.GetFeedRequest; + public static create(properties?: google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse): google.cloud.asset.v1p1beta1.SearchAllResourcesResponse; /** - * Encodes the specified GetFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.GetFeedRequest.verify|verify} messages. - * @param message GetFeedRequest message or plain object to encode + * Encodes the specified SearchAllResourcesResponse message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllResourcesResponse.verify|verify} messages. + * @param message SearchAllResourcesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p2beta1.IGetFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.GetFeedRequest.verify|verify} messages. - * @param message GetFeedRequest message or plain object to encode + * Encodes the specified SearchAllResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllResourcesResponse.verify|verify} messages. + * @param message SearchAllResourcesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IGetFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetFeedRequest message from the specified reader or buffer. + * Decodes a SearchAllResourcesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetFeedRequest + * @returns SearchAllResourcesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.GetFeedRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p1beta1.SearchAllResourcesResponse; /** - * Decodes a GetFeedRequest message from the specified reader or buffer, length delimited. + * Decodes a SearchAllResourcesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetFeedRequest + * @returns SearchAllResourcesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.GetFeedRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p1beta1.SearchAllResourcesResponse; /** - * Verifies a GetFeedRequest message. + * Verifies a SearchAllResourcesResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetFeedRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SearchAllResourcesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetFeedRequest + * @returns SearchAllResourcesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.GetFeedRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.SearchAllResourcesResponse; /** - * Creates a plain object from a GetFeedRequest message. Also converts values to other types if specified. - * @param message GetFeedRequest + * Creates a plain object from a SearchAllResourcesResponse message. Also converts values to other types if specified. + * @param message SearchAllResourcesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p2beta1.GetFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p1beta1.SearchAllResourcesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetFeedRequest to JSON. + * Converts this SearchAllResourcesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListFeedsRequest. */ - interface IListFeedsRequest { + /** Properties of a SearchAllIamPoliciesRequest. */ + interface ISearchAllIamPoliciesRequest { - /** ListFeedsRequest parent */ - parent?: (string|null); + /** SearchAllIamPoliciesRequest scope */ + scope?: (string|null); + + /** SearchAllIamPoliciesRequest query */ + query?: (string|null); + + /** SearchAllIamPoliciesRequest pageSize */ + pageSize?: (number|null); + + /** SearchAllIamPoliciesRequest pageToken */ + pageToken?: (string|null); } - /** Represents a ListFeedsRequest. */ - class ListFeedsRequest implements IListFeedsRequest { + /** Represents a SearchAllIamPoliciesRequest. */ + class SearchAllIamPoliciesRequest implements ISearchAllIamPoliciesRequest { /** - * Constructs a new ListFeedsRequest. + * Constructs a new SearchAllIamPoliciesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1p2beta1.IListFeedsRequest); + constructor(properties?: google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest); - /** ListFeedsRequest parent. */ - public parent: string; + /** SearchAllIamPoliciesRequest scope. */ + public scope: string; + + /** SearchAllIamPoliciesRequest query. */ + public query: string; + + /** SearchAllIamPoliciesRequest pageSize. */ + public pageSize: number; + + /** SearchAllIamPoliciesRequest pageToken. */ + public pageToken: string; /** - * Creates a new ListFeedsRequest instance using the specified properties. + * Creates a new SearchAllIamPoliciesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListFeedsRequest instance + * @returns SearchAllIamPoliciesRequest instance */ - public static create(properties?: google.cloud.asset.v1p2beta1.IListFeedsRequest): google.cloud.asset.v1p2beta1.ListFeedsRequest; + public static create(properties?: google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest): google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest; /** - * Encodes the specified ListFeedsRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsRequest.verify|verify} messages. - * @param message ListFeedsRequest message or plain object to encode + * Encodes the specified SearchAllIamPoliciesRequest message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest.verify|verify} messages. + * @param message SearchAllIamPoliciesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p2beta1.IListFeedsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListFeedsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsRequest.verify|verify} messages. - * @param message ListFeedsRequest message or plain object to encode + * Encodes the specified SearchAllIamPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest.verify|verify} messages. + * @param message SearchAllIamPoliciesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IListFeedsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListFeedsRequest message from the specified reader or buffer. + * Decodes a SearchAllIamPoliciesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListFeedsRequest + * @returns SearchAllIamPoliciesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.ListFeedsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest; /** - * Decodes a ListFeedsRequest message from the specified reader or buffer, length delimited. + * Decodes a SearchAllIamPoliciesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListFeedsRequest + * @returns SearchAllIamPoliciesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.ListFeedsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest; /** - * Verifies a ListFeedsRequest message. + * Verifies a SearchAllIamPoliciesRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListFeedsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SearchAllIamPoliciesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListFeedsRequest + * @returns SearchAllIamPoliciesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.ListFeedsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest; /** - * Creates a plain object from a ListFeedsRequest message. Also converts values to other types if specified. - * @param message ListFeedsRequest + * Creates a plain object from a SearchAllIamPoliciesRequest message. Also converts values to other types if specified. + * @param message SearchAllIamPoliciesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p2beta1.ListFeedsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListFeedsRequest to JSON. + * Converts this SearchAllIamPoliciesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListFeedsResponse. */ - interface IListFeedsResponse { + /** Properties of a SearchAllIamPoliciesResponse. */ + interface ISearchAllIamPoliciesResponse { - /** ListFeedsResponse feeds */ - feeds?: (google.cloud.asset.v1p2beta1.IFeed[]|null); + /** SearchAllIamPoliciesResponse results */ + results?: (google.cloud.asset.v1p1beta1.IIamPolicySearchResult[]|null); + + /** SearchAllIamPoliciesResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a ListFeedsResponse. */ - class ListFeedsResponse implements IListFeedsResponse { + /** Represents a SearchAllIamPoliciesResponse. */ + class SearchAllIamPoliciesResponse implements ISearchAllIamPoliciesResponse { /** - * Constructs a new ListFeedsResponse. + * Constructs a new SearchAllIamPoliciesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1p2beta1.IListFeedsResponse); + constructor(properties?: google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse); - /** ListFeedsResponse feeds. */ - public feeds: google.cloud.asset.v1p2beta1.IFeed[]; + /** SearchAllIamPoliciesResponse results. */ + public results: google.cloud.asset.v1p1beta1.IIamPolicySearchResult[]; + + /** SearchAllIamPoliciesResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new ListFeedsResponse instance using the specified properties. + * Creates a new SearchAllIamPoliciesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ListFeedsResponse instance + * @returns SearchAllIamPoliciesResponse instance */ - public static create(properties?: google.cloud.asset.v1p2beta1.IListFeedsResponse): google.cloud.asset.v1p2beta1.ListFeedsResponse; + public static create(properties?: google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse): google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse; /** - * Encodes the specified ListFeedsResponse message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsResponse.verify|verify} messages. - * @param message ListFeedsResponse message or plain object to encode + * Encodes the specified SearchAllIamPoliciesResponse message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse.verify|verify} messages. + * @param message SearchAllIamPoliciesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p2beta1.IListFeedsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListFeedsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsResponse.verify|verify} messages. - * @param message ListFeedsResponse message or plain object to encode + * Encodes the specified SearchAllIamPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse.verify|verify} messages. + * @param message SearchAllIamPoliciesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IListFeedsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListFeedsResponse message from the specified reader or buffer. + * Decodes a SearchAllIamPoliciesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListFeedsResponse + * @returns SearchAllIamPoliciesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.ListFeedsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse; /** - * Decodes a ListFeedsResponse message from the specified reader or buffer, length delimited. + * Decodes a SearchAllIamPoliciesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListFeedsResponse + * @returns SearchAllIamPoliciesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.ListFeedsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse; /** - * Verifies a ListFeedsResponse message. + * Verifies a SearchAllIamPoliciesResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListFeedsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SearchAllIamPoliciesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListFeedsResponse + * @returns SearchAllIamPoliciesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.ListFeedsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse; /** - * Creates a plain object from a ListFeedsResponse message. Also converts values to other types if specified. - * @param message ListFeedsResponse + * Creates a plain object from a SearchAllIamPoliciesResponse message. Also converts values to other types if specified. + * @param message SearchAllIamPoliciesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p2beta1.ListFeedsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListFeedsResponse to JSON. + * Converts this SearchAllIamPoliciesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } + } - /** Properties of an UpdateFeedRequest. */ - interface IUpdateFeedRequest { + /** Namespace v1p2beta1. */ + namespace v1p2beta1 { - /** UpdateFeedRequest feed */ - feed?: (google.cloud.asset.v1p2beta1.IFeed|null); + /** Properties of a TemporalAsset. */ + interface ITemporalAsset { - /** UpdateFeedRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** TemporalAsset window */ + window?: (google.cloud.asset.v1p2beta1.ITimeWindow|null); + + /** TemporalAsset deleted */ + deleted?: (boolean|null); + + /** TemporalAsset asset */ + asset?: (google.cloud.asset.v1p2beta1.IAsset|null); } - /** Represents an UpdateFeedRequest. */ - class UpdateFeedRequest implements IUpdateFeedRequest { + /** Represents a TemporalAsset. */ + class TemporalAsset implements ITemporalAsset { /** - * Constructs a new UpdateFeedRequest. + * Constructs a new TemporalAsset. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1p2beta1.IUpdateFeedRequest); + constructor(properties?: google.cloud.asset.v1p2beta1.ITemporalAsset); - /** UpdateFeedRequest feed. */ - public feed?: (google.cloud.asset.v1p2beta1.IFeed|null); + /** TemporalAsset window. */ + public window?: (google.cloud.asset.v1p2beta1.ITimeWindow|null); - /** UpdateFeedRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** TemporalAsset deleted. */ + public deleted: boolean; + + /** TemporalAsset asset. */ + public asset?: (google.cloud.asset.v1p2beta1.IAsset|null); /** - * Creates a new UpdateFeedRequest instance using the specified properties. + * Creates a new TemporalAsset instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateFeedRequest instance + * @returns TemporalAsset instance */ - public static create(properties?: google.cloud.asset.v1p2beta1.IUpdateFeedRequest): google.cloud.asset.v1p2beta1.UpdateFeedRequest; + public static create(properties?: google.cloud.asset.v1p2beta1.ITemporalAsset): google.cloud.asset.v1p2beta1.TemporalAsset; /** - * Encodes the specified UpdateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.UpdateFeedRequest.verify|verify} messages. - * @param message UpdateFeedRequest message or plain object to encode + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1p2beta1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p2beta1.IUpdateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p2beta1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.UpdateFeedRequest.verify|verify} messages. - * @param message UpdateFeedRequest message or plain object to encode + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IUpdateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateFeedRequest message from the specified reader or buffer. + * Decodes a TemporalAsset message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateFeedRequest + * @returns TemporalAsset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.UpdateFeedRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.TemporalAsset; /** - * Decodes an UpdateFeedRequest message from the specified reader or buffer, length delimited. + * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateFeedRequest + * @returns TemporalAsset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.UpdateFeedRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.TemporalAsset; /** - * Verifies an UpdateFeedRequest message. + * Verifies a TemporalAsset message. * @param message Plain 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 UpdateFeedRequest message from a plain object. Also converts values to their respective internal types. + * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateFeedRequest + * @returns TemporalAsset */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.UpdateFeedRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.TemporalAsset; /** - * Creates a plain object from an UpdateFeedRequest message. Also converts values to other types if specified. - * @param message UpdateFeedRequest + * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * @param message TemporalAsset * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p2beta1.UpdateFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p2beta1.TemporalAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateFeedRequest to JSON. + * Converts this TemporalAsset to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a DeleteFeedRequest. */ - interface IDeleteFeedRequest { + /** Properties of a TimeWindow. */ + interface ITimeWindow { - /** DeleteFeedRequest name */ - name?: (string|null); + /** TimeWindow startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** TimeWindow endTime */ + endTime?: (google.protobuf.ITimestamp|null); } - /** Represents a DeleteFeedRequest. */ - class DeleteFeedRequest implements IDeleteFeedRequest { + /** Represents a TimeWindow. */ + class TimeWindow implements ITimeWindow { /** - * Constructs a new DeleteFeedRequest. + * Constructs a new TimeWindow. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1p2beta1.IDeleteFeedRequest); + constructor(properties?: google.cloud.asset.v1p2beta1.ITimeWindow); - /** DeleteFeedRequest name. */ - public name: string; + /** TimeWindow startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** TimeWindow endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); /** - * Creates a new DeleteFeedRequest instance using the specified properties. + * Creates a new TimeWindow instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteFeedRequest instance + * @returns TimeWindow instance */ - public static create(properties?: google.cloud.asset.v1p2beta1.IDeleteFeedRequest): google.cloud.asset.v1p2beta1.DeleteFeedRequest; + public static create(properties?: google.cloud.asset.v1p2beta1.ITimeWindow): google.cloud.asset.v1p2beta1.TimeWindow; /** - * Encodes the specified DeleteFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.DeleteFeedRequest.verify|verify} messages. - * @param message DeleteFeedRequest message or plain object to encode + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1p2beta1.TimeWindow.verify|verify} messages. + * @param message TimeWindow message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p2beta1.IDeleteFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p2beta1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.DeleteFeedRequest.verify|verify} messages. - * @param message DeleteFeedRequest message or plain object to encode + * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.TimeWindow.verify|verify} messages. + * @param message TimeWindow message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IDeleteFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteFeedRequest message from the specified reader or buffer. + * Decodes a TimeWindow message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteFeedRequest + * @returns TimeWindow * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.DeleteFeedRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.TimeWindow; /** - * Decodes a DeleteFeedRequest message from the specified reader or buffer, length delimited. + * Decodes a TimeWindow message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteFeedRequest + * @returns TimeWindow * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.DeleteFeedRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.TimeWindow; /** - * Verifies a DeleteFeedRequest message. + * Verifies a TimeWindow message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteFeedRequest message from a plain object. Also converts values to their respective internal types. + * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteFeedRequest + * @returns TimeWindow */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.DeleteFeedRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.TimeWindow; /** - * Creates a plain object from a DeleteFeedRequest message. Also converts values to other types if specified. - * @param message DeleteFeedRequest + * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. + * @param message TimeWindow * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p2beta1.DeleteFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p2beta1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteFeedRequest to JSON. + * Converts this TimeWindow to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an OutputConfig. */ - interface IOutputConfig { + /** Properties of an Asset. */ + interface IAsset { - /** OutputConfig gcsDestination */ - gcsDestination?: (google.cloud.asset.v1p2beta1.IGcsDestination|null); + /** Asset name */ + name?: (string|null); - /** OutputConfig bigqueryDestination */ - bigqueryDestination?: (google.cloud.asset.v1p2beta1.IBigQueryDestination|null); - } + /** Asset assetType */ + assetType?: (string|null); - /** Represents an OutputConfig. */ - class OutputConfig implements IOutputConfig { + /** Asset resource */ + resource?: (google.cloud.asset.v1p2beta1.IResource|null); + + /** Asset iamPolicy */ + iamPolicy?: (google.iam.v1.IPolicy|null); + + /** Asset ancestors */ + ancestors?: (string[]|null); + } + + /** Represents an Asset. */ + class Asset implements IAsset { /** - * Constructs a new OutputConfig. + * Constructs a new Asset. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1p2beta1.IOutputConfig); + constructor(properties?: google.cloud.asset.v1p2beta1.IAsset); - /** OutputConfig gcsDestination. */ - public gcsDestination?: (google.cloud.asset.v1p2beta1.IGcsDestination|null); + /** Asset name. */ + public name: string; - /** OutputConfig bigqueryDestination. */ - public bigqueryDestination?: (google.cloud.asset.v1p2beta1.IBigQueryDestination|null); + /** Asset assetType. */ + public assetType: string; - /** OutputConfig destination. */ - public destination?: ("gcsDestination"|"bigqueryDestination"); + /** Asset resource. */ + public resource?: (google.cloud.asset.v1p2beta1.IResource|null); + + /** Asset iamPolicy. */ + public iamPolicy?: (google.iam.v1.IPolicy|null); + + /** Asset ancestors. */ + public ancestors: string[]; /** - * Creates a new OutputConfig instance using the specified properties. + * Creates a new Asset instance using the specified properties. * @param [properties] Properties to set - * @returns OutputConfig instance + * @returns Asset instance */ - public static create(properties?: google.cloud.asset.v1p2beta1.IOutputConfig): google.cloud.asset.v1p2beta1.OutputConfig; + public static create(properties?: google.cloud.asset.v1p2beta1.IAsset): google.cloud.asset.v1p2beta1.Asset; /** - * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1p2beta1.OutputConfig.verify|verify} messages. - * @param message OutputConfig message or plain object to encode + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p2beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p2beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.OutputConfig.verify|verify} messages. - * @param message OutputConfig message or plain object to encode + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an OutputConfig message from the specified reader or buffer. + * Decodes an Asset message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns OutputConfig + * @returns Asset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.OutputConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.Asset; /** - * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * Decodes an Asset message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns OutputConfig + * @returns Asset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.OutputConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.Asset; /** - * Verifies an OutputConfig message. + * Verifies an Asset message. * @param message Plain 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 OutputConfig message from a plain object. Also converts values to their respective internal types. + * Creates an Asset message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns OutputConfig + * @returns Asset */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.OutputConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.Asset; /** - * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. - * @param message OutputConfig + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @param message Asset * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p2beta1.OutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p2beta1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this OutputConfig to JSON. + * Converts this Asset to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GcsDestination. */ - interface IGcsDestination { + /** Properties of a Resource. */ + interface IResource { - /** GcsDestination uri */ - uri?: (string|null); + /** Resource version */ + version?: (string|null); - /** GcsDestination uriPrefix */ - uriPrefix?: (string|null); + /** Resource discoveryDocumentUri */ + discoveryDocumentUri?: (string|null); + + /** Resource discoveryName */ + discoveryName?: (string|null); + + /** Resource resourceUrl */ + resourceUrl?: (string|null); + + /** Resource parent */ + parent?: (string|null); + + /** Resource data */ + data?: (google.protobuf.IStruct|null); } - /** Represents a GcsDestination. */ - class GcsDestination implements IGcsDestination { + /** Represents a Resource. */ + class Resource implements IResource { /** - * Constructs a new GcsDestination. + * Constructs a new Resource. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1p2beta1.IGcsDestination); + constructor(properties?: google.cloud.asset.v1p2beta1.IResource); - /** GcsDestination uri. */ - public uri: string; + /** Resource version. */ + public version: string; - /** GcsDestination uriPrefix. */ - public uriPrefix: string; + /** Resource discoveryDocumentUri. */ + public discoveryDocumentUri: string; - /** GcsDestination objectUri. */ - public objectUri?: ("uri"|"uriPrefix"); + /** Resource discoveryName. */ + public discoveryName: string; + + /** Resource resourceUrl. */ + public resourceUrl: string; + + /** Resource parent. */ + public parent: string; + + /** Resource data. */ + public data?: (google.protobuf.IStruct|null); /** - * Creates a new GcsDestination instance using the specified properties. + * Creates a new Resource instance using the specified properties. * @param [properties] Properties to set - * @returns GcsDestination instance + * @returns Resource instance */ - public static create(properties?: google.cloud.asset.v1p2beta1.IGcsDestination): google.cloud.asset.v1p2beta1.GcsDestination; + public static create(properties?: google.cloud.asset.v1p2beta1.IResource): google.cloud.asset.v1p2beta1.Resource; /** - * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1p2beta1.GcsDestination.verify|verify} messages. - * @param message GcsDestination message or plain object to encode + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p2beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p2beta1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.GcsDestination.verify|verify} messages. - * @param message GcsDestination message or plain object to encode + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GcsDestination message from the specified reader or buffer. + * Decodes a Resource message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GcsDestination + * @returns Resource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.GcsDestination; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.Resource; /** - * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * Decodes a Resource message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GcsDestination + * @returns Resource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.GcsDestination; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.Resource; /** - * Verifies a GcsDestination message. + * Verifies a Resource message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * Creates a Resource message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GcsDestination + * @returns Resource */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.GcsDestination; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.Resource; /** - * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. - * @param message GcsDestination + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @param message Resource * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p2beta1.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p2beta1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GcsDestination to JSON. + * Converts this Resource to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BigQueryDestination. */ - interface IBigQueryDestination { - - /** BigQueryDestination dataset */ - dataset?: (string|null); - - /** BigQueryDestination table */ - table?: (string|null); - - /** BigQueryDestination force */ - force?: (boolean|null); - } - - /** Represents a BigQueryDestination. */ - class BigQueryDestination implements IBigQueryDestination { + /** Represents an AssetService */ + class AssetService extends $protobuf.rpc.Service { /** - * Constructs a new BigQueryDestination. - * @param [properties] Properties to set + * Constructs a new AssetService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited */ - constructor(properties?: google.cloud.asset.v1p2beta1.IBigQueryDestination); - - /** BigQueryDestination dataset. */ - public dataset: string; - - /** BigQueryDestination table. */ - public table: string; + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - /** BigQueryDestination force. */ - public force: boolean; + /** + * Creates new AssetService 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): AssetService; /** - * Creates a new BigQueryDestination instance using the specified properties. - * @param [properties] Properties to set - * @returns BigQueryDestination instance + * Calls CreateFeed. + * @param request CreateFeedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Feed */ - public static create(properties?: google.cloud.asset.v1p2beta1.IBigQueryDestination): google.cloud.asset.v1p2beta1.BigQueryDestination; + public createFeed(request: google.cloud.asset.v1p2beta1.ICreateFeedRequest, callback: google.cloud.asset.v1p2beta1.AssetService.CreateFeedCallback): void; /** - * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.asset.v1p2beta1.BigQueryDestination.verify|verify} messages. - * @param message BigQueryDestination message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls CreateFeed. + * @param request CreateFeedRequest message or plain object + * @returns Promise */ - public static encode(message: google.cloud.asset.v1p2beta1.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public createFeed(request: google.cloud.asset.v1p2beta1.ICreateFeedRequest): Promise; /** - * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.BigQueryDestination.verify|verify} messages. - * @param message BigQueryDestination message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls GetFeed. + * @param request GetFeedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Feed */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public getFeed(request: google.cloud.asset.v1p2beta1.IGetFeedRequest, callback: google.cloud.asset.v1p2beta1.AssetService.GetFeedCallback): void; /** - * Decodes a BigQueryDestination message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BigQueryDestination - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls GetFeed. + * @param request GetFeedRequest message or plain object + * @returns Promise */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.BigQueryDestination; + public getFeed(request: google.cloud.asset.v1p2beta1.IGetFeedRequest): Promise; /** - * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BigQueryDestination - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls ListFeeds. + * @param request ListFeedsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListFeedsResponse */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.BigQueryDestination; + public listFeeds(request: google.cloud.asset.v1p2beta1.IListFeedsRequest, callback: google.cloud.asset.v1p2beta1.AssetService.ListFeedsCallback): void; /** - * Verifies a BigQueryDestination message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls ListFeeds. + * @param request ListFeedsRequest message or plain object + * @returns Promise */ - public static verify(message: { [k: string]: any }): (string|null); + public listFeeds(request: google.cloud.asset.v1p2beta1.IListFeedsRequest): Promise; /** - * Creates a BigQueryDestination message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BigQueryDestination + * Calls UpdateFeed. + * @param request UpdateFeedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Feed */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.BigQueryDestination; + public updateFeed(request: google.cloud.asset.v1p2beta1.IUpdateFeedRequest, callback: google.cloud.asset.v1p2beta1.AssetService.UpdateFeedCallback): void; /** - * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. - * @param message BigQueryDestination - * @param [options] Conversion options - * @returns Plain object + * Calls UpdateFeed. + * @param request UpdateFeedRequest message or plain object + * @returns Promise */ - public static toObject(message: google.cloud.asset.v1p2beta1.BigQueryDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public updateFeed(request: google.cloud.asset.v1p2beta1.IUpdateFeedRequest): Promise; /** - * Converts this BigQueryDestination to JSON. - * @returns JSON object + * Calls DeleteFeed. + * @param request DeleteFeedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty */ - public toJSON(): { [k: string]: any }; + public deleteFeed(request: google.cloud.asset.v1p2beta1.IDeleteFeedRequest, callback: google.cloud.asset.v1p2beta1.AssetService.DeleteFeedCallback): void; + + /** + * Calls DeleteFeed. + * @param request DeleteFeedRequest message or plain object + * @returns Promise + */ + public deleteFeed(request: google.cloud.asset.v1p2beta1.IDeleteFeedRequest): Promise; } - /** Properties of a PubsubDestination. */ - interface IPubsubDestination { + namespace AssetService { - /** PubsubDestination topic */ - topic?: (string|null); + /** + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#createFeed}. + * @param error Error, if any + * @param [response] Feed + */ + type CreateFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1p2beta1.Feed) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#getFeed}. + * @param error Error, if any + * @param [response] Feed + */ + type GetFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1p2beta1.Feed) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#listFeeds}. + * @param error Error, if any + * @param [response] ListFeedsResponse + */ + type ListFeedsCallback = (error: (Error|null), response?: google.cloud.asset.v1p2beta1.ListFeedsResponse) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#updateFeed}. + * @param error Error, if any + * @param [response] Feed + */ + type UpdateFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1p2beta1.Feed) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#deleteFeed}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteFeedCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; } - /** Represents a PubsubDestination. */ - class PubsubDestination implements IPubsubDestination { + /** Properties of a CreateFeedRequest. */ + interface ICreateFeedRequest { + + /** CreateFeedRequest parent */ + parent?: (string|null); + + /** CreateFeedRequest feedId */ + feedId?: (string|null); + + /** CreateFeedRequest feed */ + feed?: (google.cloud.asset.v1p2beta1.IFeed|null); + } + + /** Represents a CreateFeedRequest. */ + class CreateFeedRequest implements ICreateFeedRequest { /** - * Constructs a new PubsubDestination. + * Constructs a new CreateFeedRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1p2beta1.IPubsubDestination); + constructor(properties?: google.cloud.asset.v1p2beta1.ICreateFeedRequest); - /** PubsubDestination topic. */ - public topic: string; + /** CreateFeedRequest parent. */ + public parent: string; + + /** CreateFeedRequest feedId. */ + public feedId: string; + + /** CreateFeedRequest feed. */ + public feed?: (google.cloud.asset.v1p2beta1.IFeed|null); /** - * Creates a new PubsubDestination instance using the specified properties. + * Creates a new CreateFeedRequest instance using the specified properties. * @param [properties] Properties to set - * @returns PubsubDestination instance + * @returns CreateFeedRequest instance */ - public static create(properties?: google.cloud.asset.v1p2beta1.IPubsubDestination): google.cloud.asset.v1p2beta1.PubsubDestination; + public static create(properties?: google.cloud.asset.v1p2beta1.ICreateFeedRequest): google.cloud.asset.v1p2beta1.CreateFeedRequest; /** - * Encodes the specified PubsubDestination message. Does not implicitly {@link google.cloud.asset.v1p2beta1.PubsubDestination.verify|verify} messages. - * @param message PubsubDestination message or plain object to encode + * Encodes the specified CreateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.CreateFeedRequest.verify|verify} messages. + * @param message CreateFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p2beta1.IPubsubDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p2beta1.ICreateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PubsubDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.PubsubDestination.verify|verify} messages. - * @param message PubsubDestination message or plain object to encode + * Encodes the specified CreateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.CreateFeedRequest.verify|verify} messages. + * @param message CreateFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IPubsubDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.ICreateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PubsubDestination message from the specified reader or buffer. + * Decodes a CreateFeedRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PubsubDestination + * @returns CreateFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.PubsubDestination; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.CreateFeedRequest; /** - * Decodes a PubsubDestination message from the specified reader or buffer, length delimited. + * Decodes a CreateFeedRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PubsubDestination + * @returns CreateFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.PubsubDestination; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.CreateFeedRequest; /** - * Verifies a PubsubDestination message. + * Verifies a CreateFeedRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a PubsubDestination message from a plain object. Also converts values to their respective internal types. + * Creates a CreateFeedRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PubsubDestination + * @returns CreateFeedRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.PubsubDestination; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.CreateFeedRequest; /** - * Creates a plain object from a PubsubDestination message. Also converts values to other types if specified. - * @param message PubsubDestination + * Creates a plain object from a CreateFeedRequest message. Also converts values to other types if specified. + * @param message CreateFeedRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p2beta1.PubsubDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p2beta1.CreateFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PubsubDestination to JSON. + * Converts this CreateFeedRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** ContentType enum. */ - enum ContentType { - CONTENT_TYPE_UNSPECIFIED = 0, - RESOURCE = 1, - IAM_POLICY = 2, - IAM_POLICY_NAME = 3, - ORG_POLICY = 4, - ACCESS_POLICY = 5 - } - - /** Properties of a FeedOutputConfig. */ - interface IFeedOutputConfig { + /** Properties of a GetFeedRequest. */ + interface IGetFeedRequest { - /** FeedOutputConfig pubsubDestination */ - pubsubDestination?: (google.cloud.asset.v1p2beta1.IPubsubDestination|null); + /** GetFeedRequest name */ + name?: (string|null); } - /** Represents a FeedOutputConfig. */ - class FeedOutputConfig implements IFeedOutputConfig { + /** Represents a GetFeedRequest. */ + class GetFeedRequest implements IGetFeedRequest { /** - * Constructs a new FeedOutputConfig. + * Constructs a new GetFeedRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1p2beta1.IFeedOutputConfig); - - /** FeedOutputConfig pubsubDestination. */ - public pubsubDestination?: (google.cloud.asset.v1p2beta1.IPubsubDestination|null); + constructor(properties?: google.cloud.asset.v1p2beta1.IGetFeedRequest); - /** FeedOutputConfig destination. */ - public destination?: "pubsubDestination"; + /** GetFeedRequest name. */ + public name: string; /** - * Creates a new FeedOutputConfig instance using the specified properties. + * Creates a new GetFeedRequest instance using the specified properties. * @param [properties] Properties to set - * @returns FeedOutputConfig instance + * @returns GetFeedRequest instance */ - public static create(properties?: google.cloud.asset.v1p2beta1.IFeedOutputConfig): google.cloud.asset.v1p2beta1.FeedOutputConfig; + public static create(properties?: google.cloud.asset.v1p2beta1.IGetFeedRequest): google.cloud.asset.v1p2beta1.GetFeedRequest; /** - * Encodes the specified FeedOutputConfig message. Does not implicitly {@link google.cloud.asset.v1p2beta1.FeedOutputConfig.verify|verify} messages. - * @param message FeedOutputConfig message or plain object to encode + * Encodes the specified GetFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.GetFeedRequest.verify|verify} messages. + * @param message GetFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p2beta1.IFeedOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p2beta1.IGetFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified FeedOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.FeedOutputConfig.verify|verify} messages. - * @param message FeedOutputConfig message or plain object to encode + * Encodes the specified GetFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.GetFeedRequest.verify|verify} messages. + * @param message GetFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IFeedOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IGetFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FeedOutputConfig message from the specified reader or buffer. + * Decodes a GetFeedRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns FeedOutputConfig + * @returns GetFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.FeedOutputConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.GetFeedRequest; /** - * Decodes a FeedOutputConfig message from the specified reader or buffer, length delimited. + * Decodes a GetFeedRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FeedOutputConfig + * @returns GetFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.FeedOutputConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.GetFeedRequest; /** - * Verifies a FeedOutputConfig message. + * Verifies a GetFeedRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a FeedOutputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a GetFeedRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FeedOutputConfig + * @returns GetFeedRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.FeedOutputConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.GetFeedRequest; /** - * Creates a plain object from a FeedOutputConfig message. Also converts values to other types if specified. - * @param message FeedOutputConfig + * Creates a plain object from a GetFeedRequest message. Also converts values to other types if specified. + * @param message GetFeedRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p2beta1.FeedOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p2beta1.GetFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FeedOutputConfig to JSON. + * Converts this GetFeedRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Feed. */ - interface IFeed { - - /** Feed name */ - name?: (string|null); - - /** Feed assetNames */ - assetNames?: (string[]|null); - - /** Feed assetTypes */ - assetTypes?: (string[]|null); - - /** Feed contentType */ - contentType?: (google.cloud.asset.v1p2beta1.ContentType|keyof typeof google.cloud.asset.v1p2beta1.ContentType|null); + /** Properties of a ListFeedsRequest. */ + interface IListFeedsRequest { - /** Feed feedOutputConfig */ - feedOutputConfig?: (google.cloud.asset.v1p2beta1.IFeedOutputConfig|null); + /** ListFeedsRequest parent */ + parent?: (string|null); } - /** Represents a Feed. */ - class Feed implements IFeed { + /** Represents a ListFeedsRequest. */ + class ListFeedsRequest implements IListFeedsRequest { /** - * Constructs a new Feed. + * Constructs a new ListFeedsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1p2beta1.IFeed); - - /** Feed name. */ - public name: string; - - /** Feed assetNames. */ - public assetNames: string[]; - - /** Feed assetTypes. */ - public assetTypes: string[]; - - /** Feed contentType. */ - public contentType: (google.cloud.asset.v1p2beta1.ContentType|keyof typeof google.cloud.asset.v1p2beta1.ContentType); + constructor(properties?: google.cloud.asset.v1p2beta1.IListFeedsRequest); - /** Feed feedOutputConfig. */ - public feedOutputConfig?: (google.cloud.asset.v1p2beta1.IFeedOutputConfig|null); + /** ListFeedsRequest parent. */ + public parent: string; /** - * Creates a new Feed instance using the specified properties. + * Creates a new ListFeedsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns Feed instance + * @returns ListFeedsRequest instance */ - public static create(properties?: google.cloud.asset.v1p2beta1.IFeed): google.cloud.asset.v1p2beta1.Feed; + public static create(properties?: google.cloud.asset.v1p2beta1.IListFeedsRequest): google.cloud.asset.v1p2beta1.ListFeedsRequest; /** - * Encodes the specified Feed message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Feed.verify|verify} messages. - * @param message Feed message or plain object to encode + * Encodes the specified ListFeedsRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsRequest.verify|verify} messages. + * @param message ListFeedsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p2beta1.IFeed, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p2beta1.IListFeedsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Feed message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Feed.verify|verify} messages. - * @param message Feed message or plain object to encode + * Encodes the specified ListFeedsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsRequest.verify|verify} messages. + * @param message ListFeedsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IFeed, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IListFeedsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Feed message from the specified reader or buffer. + * Decodes a ListFeedsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Feed + * @returns ListFeedsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.Feed; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.ListFeedsRequest; /** - * Decodes a Feed message from the specified reader or buffer, length delimited. + * Decodes a ListFeedsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Feed + * @returns ListFeedsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.Feed; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.ListFeedsRequest; /** - * Verifies a Feed message. + * Verifies a ListFeedsRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Feed message from a plain object. Also converts values to their respective internal types. + * Creates a ListFeedsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Feed + * @returns ListFeedsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.Feed; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.ListFeedsRequest; /** - * Creates a plain object from a Feed message. Also converts values to other types if specified. - * @param message Feed + * Creates a plain object from a ListFeedsRequest message. Also converts values to other types if specified. + * @param message ListFeedsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p2beta1.Feed, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p2beta1.ListFeedsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Feed to JSON. + * Converts this ListFeedsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a TemporalAsset. */ - interface ITemporalAsset { - - /** TemporalAsset window */ - window?: (google.cloud.asset.v1p2beta1.ITimeWindow|null); - - /** TemporalAsset deleted */ - deleted?: (boolean|null); + /** Properties of a ListFeedsResponse. */ + interface IListFeedsResponse { - /** TemporalAsset asset */ - asset?: (google.cloud.asset.v1p2beta1.IAsset|null); + /** ListFeedsResponse feeds */ + feeds?: (google.cloud.asset.v1p2beta1.IFeed[]|null); } - /** Represents a TemporalAsset. */ - class TemporalAsset implements ITemporalAsset { + /** Represents a ListFeedsResponse. */ + class ListFeedsResponse implements IListFeedsResponse { /** - * Constructs a new TemporalAsset. + * Constructs a new ListFeedsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1p2beta1.ITemporalAsset); - - /** TemporalAsset window. */ - public window?: (google.cloud.asset.v1p2beta1.ITimeWindow|null); - - /** TemporalAsset deleted. */ - public deleted: boolean; + constructor(properties?: google.cloud.asset.v1p2beta1.IListFeedsResponse); - /** TemporalAsset asset. */ - public asset?: (google.cloud.asset.v1p2beta1.IAsset|null); + /** ListFeedsResponse feeds. */ + public feeds: google.cloud.asset.v1p2beta1.IFeed[]; /** - * Creates a new TemporalAsset instance using the specified properties. + * Creates a new ListFeedsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns TemporalAsset instance + * @returns ListFeedsResponse instance */ - public static create(properties?: google.cloud.asset.v1p2beta1.ITemporalAsset): google.cloud.asset.v1p2beta1.TemporalAsset; + public static create(properties?: google.cloud.asset.v1p2beta1.IListFeedsResponse): google.cloud.asset.v1p2beta1.ListFeedsResponse; /** - * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1p2beta1.TemporalAsset.verify|verify} messages. - * @param message TemporalAsset message or plain object to encode + * Encodes the specified ListFeedsResponse message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsResponse.verify|verify} messages. + * @param message ListFeedsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p2beta1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p2beta1.IListFeedsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.TemporalAsset.verify|verify} messages. - * @param message TemporalAsset message or plain object to encode + * Encodes the specified ListFeedsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsResponse.verify|verify} messages. + * @param message ListFeedsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IListFeedsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TemporalAsset message from the specified reader or buffer. + * Decodes a ListFeedsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TemporalAsset + * @returns ListFeedsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.TemporalAsset; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.ListFeedsResponse; /** - * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * Decodes a ListFeedsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TemporalAsset + * @returns ListFeedsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.TemporalAsset; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.ListFeedsResponse; /** - * Verifies a TemporalAsset message. + * Verifies a ListFeedsResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. + * Creates a ListFeedsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TemporalAsset + * @returns ListFeedsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.TemporalAsset; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.ListFeedsResponse; /** - * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. - * @param message TemporalAsset + * Creates a plain object from a ListFeedsResponse message. Also converts values to other types if specified. + * @param message ListFeedsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p2beta1.TemporalAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p2beta1.ListFeedsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TemporalAsset to JSON. + * Converts this ListFeedsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a TimeWindow. */ - interface ITimeWindow { + /** Properties of an UpdateFeedRequest. */ + interface IUpdateFeedRequest { - /** TimeWindow startTime */ - startTime?: (google.protobuf.ITimestamp|null); + /** UpdateFeedRequest feed */ + feed?: (google.cloud.asset.v1p2beta1.IFeed|null); - /** TimeWindow endTime */ - endTime?: (google.protobuf.ITimestamp|null); + /** UpdateFeedRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents a TimeWindow. */ - class TimeWindow implements ITimeWindow { + /** Represents an UpdateFeedRequest. */ + class UpdateFeedRequest implements IUpdateFeedRequest { /** - * Constructs a new TimeWindow. + * Constructs a new UpdateFeedRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1p2beta1.ITimeWindow); + constructor(properties?: google.cloud.asset.v1p2beta1.IUpdateFeedRequest); - /** TimeWindow startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); + /** UpdateFeedRequest feed. */ + public feed?: (google.cloud.asset.v1p2beta1.IFeed|null); - /** TimeWindow endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); + /** UpdateFeedRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new TimeWindow instance using the specified properties. + * Creates a new UpdateFeedRequest instance using the specified properties. * @param [properties] Properties to set - * @returns TimeWindow instance + * @returns UpdateFeedRequest instance */ - public static create(properties?: google.cloud.asset.v1p2beta1.ITimeWindow): google.cloud.asset.v1p2beta1.TimeWindow; + public static create(properties?: google.cloud.asset.v1p2beta1.IUpdateFeedRequest): google.cloud.asset.v1p2beta1.UpdateFeedRequest; /** - * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1p2beta1.TimeWindow.verify|verify} messages. - * @param message TimeWindow message or plain object to encode + * Encodes the specified UpdateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.UpdateFeedRequest.verify|verify} messages. + * @param message UpdateFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p2beta1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p2beta1.IUpdateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.TimeWindow.verify|verify} messages. - * @param message TimeWindow message or plain object to encode + * Encodes the specified UpdateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.UpdateFeedRequest.verify|verify} messages. + * @param message UpdateFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IUpdateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TimeWindow message from the specified reader or buffer. + * Decodes an UpdateFeedRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TimeWindow + * @returns UpdateFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.TimeWindow; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.UpdateFeedRequest; /** - * Decodes a TimeWindow message from the specified reader or buffer, length delimited. + * Decodes an UpdateFeedRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TimeWindow + * @returns UpdateFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.TimeWindow; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.UpdateFeedRequest; /** - * Verifies a TimeWindow message. + * Verifies an UpdateFeedRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateFeedRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TimeWindow + * @returns UpdateFeedRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.TimeWindow; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.UpdateFeedRequest; /** - * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. - * @param message TimeWindow + * Creates a plain object from an UpdateFeedRequest message. Also converts values to other types if specified. + * @param message UpdateFeedRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p2beta1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p2beta1.UpdateFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TimeWindow to JSON. + * Converts this UpdateFeedRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an Asset. */ - interface IAsset { + /** Properties of a DeleteFeedRequest. */ + interface IDeleteFeedRequest { - /** Asset name */ + /** DeleteFeedRequest name */ name?: (string|null); - - /** Asset assetType */ - assetType?: (string|null); - - /** Asset resource */ - resource?: (google.cloud.asset.v1p2beta1.IResource|null); - - /** Asset iamPolicy */ - iamPolicy?: (google.iam.v1.IPolicy|null); - - /** Asset iamPolicyName */ - iamPolicyName?: (Uint8Array|string|null); - - /** Asset ancestors */ - ancestors?: (string[]|null); } - /** Represents an Asset. */ - class Asset implements IAsset { + /** Represents a DeleteFeedRequest. */ + class DeleteFeedRequest implements IDeleteFeedRequest { /** - * Constructs a new Asset. + * Constructs a new DeleteFeedRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1p2beta1.IAsset); + constructor(properties?: google.cloud.asset.v1p2beta1.IDeleteFeedRequest); - /** Asset name. */ + /** DeleteFeedRequest name. */ public name: string; - /** Asset assetType. */ - public assetType: string; - - /** Asset resource. */ - public resource?: (google.cloud.asset.v1p2beta1.IResource|null); - - /** Asset iamPolicy. */ - public iamPolicy?: (google.iam.v1.IPolicy|null); - - /** Asset iamPolicyName. */ - public iamPolicyName: (Uint8Array|string); - - /** Asset ancestors. */ - public ancestors: string[]; + /** + * Creates a new DeleteFeedRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteFeedRequest instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IDeleteFeedRequest): google.cloud.asset.v1p2beta1.DeleteFeedRequest; /** - * Creates a new Asset instance using the specified properties. - * @param [properties] Properties to set - * @returns Asset instance - */ - public static create(properties?: google.cloud.asset.v1p2beta1.IAsset): google.cloud.asset.v1p2beta1.Asset; - - /** - * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode + * Encodes the specified DeleteFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.DeleteFeedRequest.verify|verify} messages. + * @param message DeleteFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p2beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p2beta1.IDeleteFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode + * Encodes the specified DeleteFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.DeleteFeedRequest.verify|verify} messages. + * @param message DeleteFeedRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IDeleteFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Asset message from the specified reader or buffer. + * Decodes a DeleteFeedRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Asset + * @returns DeleteFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.Asset; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.DeleteFeedRequest; /** - * Decodes an Asset message from the specified reader or buffer, length delimited. + * Decodes a DeleteFeedRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Asset + * @returns DeleteFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.Asset; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.DeleteFeedRequest; /** - * Verifies an Asset message. + * Verifies a DeleteFeedRequest message. * @param message Plain 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 Asset message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteFeedRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Asset + * @returns DeleteFeedRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.Asset; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.DeleteFeedRequest; /** - * Creates a plain object from an Asset message. Also converts values to other types if specified. - * @param message Asset + * Creates a plain object from a DeleteFeedRequest message. Also converts values to other types if specified. + * @param message DeleteFeedRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p2beta1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p2beta1.DeleteFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Asset to JSON. + * Converts this DeleteFeedRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Resource. */ - interface IResource { + /** Properties of an OutputConfig. */ + interface IOutputConfig { - /** Resource version */ - version?: (string|null); + /** OutputConfig gcsDestination */ + gcsDestination?: (google.cloud.asset.v1p2beta1.IGcsDestination|null); + } - /** Resource discoveryDocumentUri */ - discoveryDocumentUri?: (string|null); + /** Represents an OutputConfig. */ + class OutputConfig implements IOutputConfig { - /** Resource discoveryName */ - discoveryName?: (string|null); + /** + * Constructs a new OutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IOutputConfig); - /** Resource resourceUrl */ - resourceUrl?: (string|null); + /** OutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.asset.v1p2beta1.IGcsDestination|null); - /** Resource parent */ - parent?: (string|null); + /** OutputConfig destination. */ + public destination?: "gcsDestination"; - /** Resource data */ - data?: (google.protobuf.IStruct|null); + /** + * Creates a new OutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputConfig instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IOutputConfig): google.cloud.asset.v1p2beta1.OutputConfig; - /** Resource internalData */ - internalData?: (google.protobuf.IAny|null); - } + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1p2beta1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a Resource. */ - class Resource implements IResource { + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Constructs a new Resource. - * @param [properties] Properties to set + * Decodes an OutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - constructor(properties?: google.cloud.asset.v1p2beta1.IResource); + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.OutputConfig; - /** Resource version. */ - public version: string; + /** + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.OutputConfig; - /** Resource discoveryDocumentUri. */ - public discoveryDocumentUri: string; + /** + * Verifies an OutputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Resource discoveryName. */ - public discoveryName: string; + /** + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.OutputConfig; - /** Resource resourceUrl. */ - public resourceUrl: string; + /** + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @param message OutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.OutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Resource parent. */ - public parent: string; + /** + * Converts this OutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Resource data. */ - public data?: (google.protobuf.IStruct|null); + /** Properties of a GcsDestination. */ + interface IGcsDestination { + + /** GcsDestination uri */ + uri?: (string|null); + } - /** Resource internalData. */ - public internalData?: (google.protobuf.IAny|null); + /** Represents a GcsDestination. */ + class GcsDestination implements IGcsDestination { /** - * Creates a new Resource instance using the specified properties. + * Constructs a new GcsDestination. * @param [properties] Properties to set - * @returns Resource instance */ - public static create(properties?: google.cloud.asset.v1p2beta1.IResource): google.cloud.asset.v1p2beta1.Resource; + constructor(properties?: google.cloud.asset.v1p2beta1.IGcsDestination); + + /** GcsDestination uri. */ + public uri: string; + + /** GcsDestination objectUri. */ + public objectUri?: "uri"; /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Resource.verify|verify} messages. - * @param message Resource message or plain object to encode + * Creates a new GcsDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsDestination instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IGcsDestination): google.cloud.asset.v1p2beta1.GcsDestination; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1p2beta1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1p2beta1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1p2beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Resource.verify|verify} messages. - * @param message Resource message or plain object to encode + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Resource message from the specified reader or buffer. + * Decodes a GcsDestination message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Resource + * @returns GcsDestination * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.Resource; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.GcsDestination; /** - * Decodes a Resource message from the specified reader or buffer, length delimited. + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Resource + * @returns GcsDestination * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.Resource; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.GcsDestination; /** - * Verifies a Resource message. + * Verifies a GcsDestination message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Resource + * @returns GcsDestination */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.Resource; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.GcsDestination; /** - * Creates a plain object from a Resource message. Also converts values to other types if specified. - * @param message Resource + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @param message GcsDestination * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1p2beta1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1p2beta1.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PubsubDestination. */ + interface IPubsubDestination { + + /** PubsubDestination topic */ + topic?: (string|null); + } + + /** Represents a PubsubDestination. */ + class PubsubDestination implements IPubsubDestination { + + /** + * Constructs a new PubsubDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IPubsubDestination); + + /** PubsubDestination topic. */ + public topic: string; + + /** + * Creates a new PubsubDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns PubsubDestination instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IPubsubDestination): google.cloud.asset.v1p2beta1.PubsubDestination; + + /** + * Encodes the specified PubsubDestination message. Does not implicitly {@link google.cloud.asset.v1p2beta1.PubsubDestination.verify|verify} messages. + * @param message PubsubDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IPubsubDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PubsubDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.PubsubDestination.verify|verify} messages. + * @param message PubsubDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IPubsubDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PubsubDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PubsubDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.PubsubDestination; + + /** + * Decodes a PubsubDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PubsubDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.PubsubDestination; + + /** + * Verifies a PubsubDestination message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PubsubDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PubsubDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.PubsubDestination; + + /** + * Creates a plain object from a PubsubDestination message. Also converts values to other types if specified. + * @param message PubsubDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.PubsubDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PubsubDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FeedOutputConfig. */ + interface IFeedOutputConfig { + + /** FeedOutputConfig pubsubDestination */ + pubsubDestination?: (google.cloud.asset.v1p2beta1.IPubsubDestination|null); + } + + /** Represents a FeedOutputConfig. */ + class FeedOutputConfig implements IFeedOutputConfig { + + /** + * Constructs a new FeedOutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IFeedOutputConfig); + + /** FeedOutputConfig pubsubDestination. */ + public pubsubDestination?: (google.cloud.asset.v1p2beta1.IPubsubDestination|null); + + /** FeedOutputConfig destination. */ + public destination?: "pubsubDestination"; + + /** + * Creates a new FeedOutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns FeedOutputConfig instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IFeedOutputConfig): google.cloud.asset.v1p2beta1.FeedOutputConfig; + + /** + * Encodes the specified FeedOutputConfig message. Does not implicitly {@link google.cloud.asset.v1p2beta1.FeedOutputConfig.verify|verify} messages. + * @param message FeedOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IFeedOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeedOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.FeedOutputConfig.verify|verify} messages. + * @param message FeedOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IFeedOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeedOutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeedOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.FeedOutputConfig; + + /** + * Decodes a FeedOutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeedOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.FeedOutputConfig; + + /** + * Verifies a FeedOutputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeedOutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeedOutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.FeedOutputConfig; + + /** + * Creates a plain object from a FeedOutputConfig message. Also converts values to other types if specified. + * @param message FeedOutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.FeedOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeedOutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Feed. */ + interface IFeed { + + /** Feed name */ + name?: (string|null); + + /** Feed assetNames */ + assetNames?: (string[]|null); + + /** Feed assetTypes */ + assetTypes?: (string[]|null); + + /** Feed contentType */ + contentType?: (google.cloud.asset.v1p2beta1.ContentType|keyof typeof google.cloud.asset.v1p2beta1.ContentType|null); + + /** Feed feedOutputConfig */ + feedOutputConfig?: (google.cloud.asset.v1p2beta1.IFeedOutputConfig|null); + } + + /** Represents a Feed. */ + class Feed implements IFeed { + + /** + * Constructs a new Feed. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IFeed); + + /** Feed name. */ + public name: string; + + /** Feed assetNames. */ + public assetNames: string[]; + + /** Feed assetTypes. */ + public assetTypes: string[]; + + /** Feed contentType. */ + public contentType: (google.cloud.asset.v1p2beta1.ContentType|keyof typeof google.cloud.asset.v1p2beta1.ContentType); + + /** Feed feedOutputConfig. */ + public feedOutputConfig?: (google.cloud.asset.v1p2beta1.IFeedOutputConfig|null); + + /** + * Creates a new Feed instance using the specified properties. + * @param [properties] Properties to set + * @returns Feed instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IFeed): google.cloud.asset.v1p2beta1.Feed; + + /** + * Encodes the specified Feed message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Feed.verify|verify} messages. + * @param message Feed message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IFeed, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Feed message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Feed.verify|verify} messages. + * @param message Feed message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IFeed, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Feed message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Feed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.Feed; + + /** + * Decodes a Feed message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Feed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.Feed; + + /** + * Verifies a Feed message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Feed message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Feed + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.Feed; + + /** + * Creates a plain object from a Feed message. Also converts values to other types if specified. + * @param message Feed + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.Feed, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Feed to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** ContentType enum. */ + enum ContentType { + CONTENT_TYPE_UNSPECIFIED = 0, + RESOURCE = 1, + IAM_POLICY = 2 + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; - /** - * Converts this Resource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } - } + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Namespace api. */ - namespace api { + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } /** Properties of a Http. */ interface IHttp { @@ -5844,232 +6659,6 @@ export namespace google { INPUT_ONLY = 4, IMMUTABLE = 5 } - - /** Properties of a ResourceDescriptor. */ - interface IResourceDescriptor { - - /** ResourceDescriptor type */ - type?: (string|null); - - /** ResourceDescriptor pattern */ - pattern?: (string[]|null); - - /** ResourceDescriptor nameField */ - nameField?: (string|null); - - /** ResourceDescriptor history */ - history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); - - /** ResourceDescriptor plural */ - plural?: (string|null); - - /** ResourceDescriptor singular */ - singular?: (string|null); - } - - /** Represents a ResourceDescriptor. */ - class ResourceDescriptor implements IResourceDescriptor { - - /** - * Constructs a new ResourceDescriptor. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceDescriptor); - - /** ResourceDescriptor type. */ - public type: string; - - /** ResourceDescriptor pattern. */ - public pattern: string[]; - - /** ResourceDescriptor nameField. */ - public nameField: string; - - /** ResourceDescriptor history. */ - public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); - - /** ResourceDescriptor plural. */ - public plural: string; - - /** ResourceDescriptor singular. */ - public singular: string; - - /** - * Creates a new ResourceDescriptor instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceDescriptor instance - */ - public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; - - /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; - - /** - * Verifies a ResourceDescriptor message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceDescriptor - */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; - - /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @param message ResourceDescriptor - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceDescriptor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace ResourceDescriptor { - - /** History enum. */ - enum History { - HISTORY_UNSPECIFIED = 0, - ORIGINALLY_SINGLE_PATTERN = 1, - FUTURE_MULTI_PATTERN = 2 - } - } - - /** Properties of a ResourceReference. */ - interface IResourceReference { - - /** ResourceReference type */ - type?: (string|null); - - /** ResourceReference childType */ - childType?: (string|null); - } - - /** Represents a ResourceReference. */ - class ResourceReference implements IResourceReference { - - /** - * Constructs a new ResourceReference. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceReference); - - /** ResourceReference type. */ - public type: string; - - /** ResourceReference childType. */ - public childType: string; - - /** - * Creates a new ResourceReference instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceReference instance - */ - public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; - - /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceReference message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; - - /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; - - /** - * Verifies a ResourceReference message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceReference - */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; - - /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @param message ResourceReference - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceReference to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } } /** Namespace protobuf. */ @@ -7929,11 +8518,11 @@ export namespace google { /** FieldOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - /** FieldOptions .google.api.fieldBehavior */ - ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); - /** FieldOptions .google.api.resourceReference */ ".google.api.resourceReference"?: (google.api.IResourceReference|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); } /** Represents a FieldOptions. */ diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index f311118aeb2..f8039941e01 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -66,6 +66,1074 @@ */ var v1 = {}; + v1.TemporalAsset = (function() { + + /** + * Properties of a TemporalAsset. + * @memberof google.cloud.asset.v1 + * @interface ITemporalAsset + * @property {google.cloud.asset.v1.ITimeWindow|null} [window] TemporalAsset window + * @property {boolean|null} [deleted] TemporalAsset deleted + * @property {google.cloud.asset.v1.IAsset|null} [asset] TemporalAsset asset + */ + + /** + * Constructs a new TemporalAsset. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a TemporalAsset. + * @implements ITemporalAsset + * @constructor + * @param {google.cloud.asset.v1.ITemporalAsset=} [properties] Properties to set + */ + function TemporalAsset(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TemporalAsset window. + * @member {google.cloud.asset.v1.ITimeWindow|null|undefined} window + * @memberof google.cloud.asset.v1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.window = null; + + /** + * TemporalAsset deleted. + * @member {boolean} deleted + * @memberof google.cloud.asset.v1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.deleted = false; + + /** + * TemporalAsset asset. + * @member {google.cloud.asset.v1.IAsset|null|undefined} asset + * @memberof google.cloud.asset.v1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.asset = null; + + /** + * Creates a new TemporalAsset instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {google.cloud.asset.v1.ITemporalAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset instance + */ + TemporalAsset.create = function create(properties) { + return new TemporalAsset(properties); + }; + + /** + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {google.cloud.asset.v1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TemporalAsset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.window != null && message.hasOwnProperty("window")) + $root.google.cloud.asset.v1.TimeWindow.encode(message.window, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.deleted != null && message.hasOwnProperty("deleted")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deleted); + if (message.asset != null && message.hasOwnProperty("asset")) + $root.google.cloud.asset.v1.Asset.encode(message.asset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {google.cloud.asset.v1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TemporalAsset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TemporalAsset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TemporalAsset.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.TemporalAsset(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.window = $root.google.cloud.asset.v1.TimeWindow.decode(reader, reader.uint32()); + break; + case 2: + message.deleted = reader.bool(); + break; + case 3: + message.asset = $root.google.cloud.asset.v1.Asset.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TemporalAsset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TemporalAsset message. + * @function verify + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TemporalAsset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.window != null && message.hasOwnProperty("window")) { + var error = $root.google.cloud.asset.v1.TimeWindow.verify(message.window); + if (error) + return "window." + error; + } + if (message.deleted != null && message.hasOwnProperty("deleted")) + if (typeof message.deleted !== "boolean") + return "deleted: boolean expected"; + if (message.asset != null && message.hasOwnProperty("asset")) { + var error = $root.google.cloud.asset.v1.Asset.verify(message.asset); + if (error) + return "asset." + error; + } + return null; + }; + + /** + * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + */ + TemporalAsset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.TemporalAsset) + return object; + var message = new $root.google.cloud.asset.v1.TemporalAsset(); + if (object.window != null) { + if (typeof object.window !== "object") + throw TypeError(".google.cloud.asset.v1.TemporalAsset.window: object expected"); + message.window = $root.google.cloud.asset.v1.TimeWindow.fromObject(object.window); + } + if (object.deleted != null) + message.deleted = Boolean(object.deleted); + if (object.asset != null) { + if (typeof object.asset !== "object") + throw TypeError(".google.cloud.asset.v1.TemporalAsset.asset: object expected"); + message.asset = $root.google.cloud.asset.v1.Asset.fromObject(object.asset); + } + return message; + }; + + /** + * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {google.cloud.asset.v1.TemporalAsset} message TemporalAsset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TemporalAsset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.window = null; + object.deleted = false; + object.asset = null; + } + if (message.window != null && message.hasOwnProperty("window")) + object.window = $root.google.cloud.asset.v1.TimeWindow.toObject(message.window, options); + if (message.deleted != null && message.hasOwnProperty("deleted")) + object.deleted = message.deleted; + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = $root.google.cloud.asset.v1.Asset.toObject(message.asset, options); + return object; + }; + + /** + * Converts this TemporalAsset to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.TemporalAsset + * @instance + * @returns {Object.} JSON object + */ + TemporalAsset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TemporalAsset; + })(); + + v1.TimeWindow = (function() { + + /** + * Properties of a TimeWindow. + * @memberof google.cloud.asset.v1 + * @interface ITimeWindow + * @property {google.protobuf.ITimestamp|null} [startTime] TimeWindow startTime + * @property {google.protobuf.ITimestamp|null} [endTime] TimeWindow endTime + */ + + /** + * Constructs a new TimeWindow. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a TimeWindow. + * @implements ITimeWindow + * @constructor + * @param {google.cloud.asset.v1.ITimeWindow=} [properties] Properties to set + */ + function TimeWindow(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimeWindow startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.asset.v1.TimeWindow + * @instance + */ + TimeWindow.prototype.startTime = null; + + /** + * TimeWindow endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.asset.v1.TimeWindow + * @instance + */ + TimeWindow.prototype.endTime = null; + + /** + * Creates a new TimeWindow instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {google.cloud.asset.v1.ITimeWindow=} [properties] Properties to set + * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow instance + */ + TimeWindow.create = function create(properties) { + return new TimeWindow(properties); + }; + + /** + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {google.cloud.asset.v1.ITimeWindow} message TimeWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeWindow.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && message.hasOwnProperty("startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && message.hasOwnProperty("endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {google.cloud.asset.v1.ITimeWindow} message TimeWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeWindow.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeWindow message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeWindow.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.TimeWindow(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 2: + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimeWindow message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeWindow.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeWindow message. + * @function verify + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeWindow.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow + */ + TimeWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.TimeWindow) + return object; + var message = new $root.google.cloud.asset.v1.TimeWindow(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.asset.v1.TimeWindow.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.asset.v1.TimeWindow.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {google.cloud.asset.v1.TimeWindow} message TimeWindow + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeWindow.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this TimeWindow to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.TimeWindow + * @instance + * @returns {Object.} JSON object + */ + TimeWindow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TimeWindow; + })(); + + v1.Asset = (function() { + + /** + * Properties of an Asset. + * @memberof google.cloud.asset.v1 + * @interface IAsset + * @property {string|null} [name] Asset name + * @property {string|null} [assetType] Asset assetType + * @property {google.cloud.asset.v1.IResource|null} [resource] Asset resource + * @property {google.iam.v1.IPolicy|null} [iamPolicy] Asset iamPolicy + * @property {Array.|null} [ancestors] Asset ancestors + */ + + /** + * Constructs a new Asset. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an Asset. + * @implements IAsset + * @constructor + * @param {google.cloud.asset.v1.IAsset=} [properties] Properties to set + */ + function Asset(properties) { + this.ancestors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Asset name. + * @member {string} name + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.name = ""; + + /** + * Asset assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.assetType = ""; + + /** + * Asset resource. + * @member {google.cloud.asset.v1.IResource|null|undefined} resource + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.resource = null; + + /** + * Asset iamPolicy. + * @member {google.iam.v1.IPolicy|null|undefined} iamPolicy + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.iamPolicy = null; + + /** + * Asset ancestors. + * @member {Array.} ancestors + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.ancestors = $util.emptyArray; + + /** + * Creates a new Asset instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {google.cloud.asset.v1.IAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1.Asset} Asset instance + */ + Asset.create = function create(properties) { + return new Asset(properties); + }; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {google.cloud.asset.v1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.assetType != null && message.hasOwnProperty("assetType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); + if (message.resource != null && message.hasOwnProperty("resource")) + $root.google.cloud.asset.v1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + $root.google.iam.v1.Policy.encode(message.iamPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.ancestors != null && message.ancestors.length) + for (var i = 0; i < message.ancestors.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.ancestors[i]); + return writer; + }; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {google.cloud.asset.v1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.Asset(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.assetType = reader.string(); + break; + case 3: + message.resource = $root.google.cloud.asset.v1.Resource.decode(reader, reader.uint32()); + break; + case 4: + message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + case 10: + if (!(message.ancestors && message.ancestors.length)) + message.ancestors = []; + message.ancestors.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Asset message. + * @function verify + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Asset.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.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.asset.v1.Resource.verify(message.resource); + if (error) + return "resource." + error; + } + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { + var error = $root.google.iam.v1.Policy.verify(message.iamPolicy); + if (error) + return "iamPolicy." + error; + } + if (message.ancestors != null && message.hasOwnProperty("ancestors")) { + if (!Array.isArray(message.ancestors)) + return "ancestors: array expected"; + for (var i = 0; i < message.ancestors.length; ++i) + if (!$util.isString(message.ancestors[i])) + return "ancestors: string[] expected"; + } + return null; + }; + + /** + * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.Asset} Asset + */ + Asset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.Asset) + return object; + var message = new $root.google.cloud.asset.v1.Asset(); + if (object.name != null) + message.name = String(object.name); + if (object.assetType != null) + message.assetType = String(object.assetType); + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.resource: object expected"); + message.resource = $root.google.cloud.asset.v1.Resource.fromObject(object.resource); + } + if (object.iamPolicy != null) { + if (typeof object.iamPolicy !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.iamPolicy: object expected"); + message.iamPolicy = $root.google.iam.v1.Policy.fromObject(object.iamPolicy); + } + if (object.ancestors) { + if (!Array.isArray(object.ancestors)) + throw TypeError(".google.cloud.asset.v1.Asset.ancestors: array expected"); + message.ancestors = []; + for (var i = 0; i < object.ancestors.length; ++i) + message.ancestors[i] = String(object.ancestors[i]); + } + return message; + }; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {google.cloud.asset.v1.Asset} message Asset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Asset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ancestors = []; + if (options.defaults) { + object.name = ""; + object.assetType = ""; + object.resource = null; + object.iamPolicy = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.asset.v1.Resource.toObject(message.resource, options); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + object.iamPolicy = $root.google.iam.v1.Policy.toObject(message.iamPolicy, options); + if (message.ancestors && message.ancestors.length) { + object.ancestors = []; + for (var j = 0; j < message.ancestors.length; ++j) + object.ancestors[j] = message.ancestors[j]; + } + return object; + }; + + /** + * Converts this Asset to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.Asset + * @instance + * @returns {Object.} JSON object + */ + Asset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Asset; + })(); + + v1.Resource = (function() { + + /** + * Properties of a Resource. + * @memberof google.cloud.asset.v1 + * @interface IResource + * @property {string|null} [version] Resource version + * @property {string|null} [discoveryDocumentUri] Resource discoveryDocumentUri + * @property {string|null} [discoveryName] Resource discoveryName + * @property {string|null} [resourceUrl] Resource resourceUrl + * @property {string|null} [parent] Resource parent + * @property {google.protobuf.IStruct|null} [data] Resource data + */ + + /** + * Constructs a new Resource. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a Resource. + * @implements IResource + * @constructor + * @param {google.cloud.asset.v1.IResource=} [properties] Properties to set + */ + function Resource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Resource version. + * @member {string} version + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.version = ""; + + /** + * Resource discoveryDocumentUri. + * @member {string} discoveryDocumentUri + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.discoveryDocumentUri = ""; + + /** + * Resource discoveryName. + * @member {string} discoveryName + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.discoveryName = ""; + + /** + * Resource resourceUrl. + * @member {string} resourceUrl + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.resourceUrl = ""; + + /** + * Resource parent. + * @member {string} parent + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.parent = ""; + + /** + * Resource data. + * @member {google.protobuf.IStruct|null|undefined} data + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.data = null; + + /** + * Creates a new Resource instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {google.cloud.asset.v1.IResource=} [properties] Properties to set + * @returns {google.cloud.asset.v1.Resource} Resource instance + */ + Resource.create = function create(properties) { + return new Resource(properties); + }; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {google.cloud.asset.v1.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && message.hasOwnProperty("version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.discoveryDocumentUri); + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.discoveryName); + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceUrl); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); + if (message.data != null && message.hasOwnProperty("data")) + $root.google.protobuf.Struct.encode(message.data, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {google.cloud.asset.v1.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.Resource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = reader.string(); + break; + case 2: + message.discoveryDocumentUri = reader.string(); + break; + case 3: + message.discoveryName = reader.string(); + break; + case 4: + message.resourceUrl = reader.string(); + break; + case 5: + message.parent = reader.string(); + break; + case 6: + message.data = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Resource message. + * @function verify + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Resource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + if (!$util.isString(message.discoveryDocumentUri)) + return "discoveryDocumentUri: string expected"; + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + if (!$util.isString(message.discoveryName)) + return "discoveryName: string expected"; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + if (!$util.isString(message.resourceUrl)) + return "resourceUrl: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.data != null && message.hasOwnProperty("data")) { + var error = $root.google.protobuf.Struct.verify(message.data); + if (error) + return "data." + error; + } + return null; + }; + + /** + * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.Resource} Resource + */ + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.Resource) + return object; + var message = new $root.google.cloud.asset.v1.Resource(); + if (object.version != null) + message.version = String(object.version); + if (object.discoveryDocumentUri != null) + message.discoveryDocumentUri = String(object.discoveryDocumentUri); + if (object.discoveryName != null) + message.discoveryName = String(object.discoveryName); + if (object.resourceUrl != null) + message.resourceUrl = String(object.resourceUrl); + if (object.parent != null) + message.parent = String(object.parent); + if (object.data != null) { + if (typeof object.data !== "object") + throw TypeError(".google.cloud.asset.v1.Resource.data: object expected"); + message.data = $root.google.protobuf.Struct.fromObject(object.data); + } + return message; + }; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {google.cloud.asset.v1.Resource} message Resource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Resource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.discoveryDocumentUri = ""; + object.discoveryName = ""; + object.resourceUrl = ""; + object.parent = ""; + object.data = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + object.discoveryDocumentUri = message.discoveryDocumentUri; + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + object.discoveryName = message.discoveryName; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + object.resourceUrl = message.resourceUrl; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.data != null && message.hasOwnProperty("data")) + object.data = $root.google.protobuf.Struct.toObject(message.data, options); + return object; + }; + + /** + * Converts this Resource to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.Resource + * @instance + * @returns {Object.} JSON object + */ + Resource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Resource; + })(); + v1.AssetService = (function() { /** @@ -4092,24 +5160,36 @@ return Feed; })(); - v1.TemporalAsset = (function() { + return v1; + })(); + + asset.v1beta1 = (function() { + + /** + * Namespace v1beta1. + * @memberof google.cloud.asset + * @namespace + */ + var v1beta1 = {}; + + v1beta1.TemporalAsset = (function() { /** * Properties of a TemporalAsset. - * @memberof google.cloud.asset.v1 + * @memberof google.cloud.asset.v1beta1 * @interface ITemporalAsset - * @property {google.cloud.asset.v1.ITimeWindow|null} [window] TemporalAsset window + * @property {google.cloud.asset.v1beta1.ITimeWindow|null} [window] TemporalAsset window * @property {boolean|null} [deleted] TemporalAsset deleted - * @property {google.cloud.asset.v1.IAsset|null} [asset] TemporalAsset asset + * @property {google.cloud.asset.v1beta1.IAsset|null} [asset] TemporalAsset asset */ /** * Constructs a new TemporalAsset. - * @memberof google.cloud.asset.v1 + * @memberof google.cloud.asset.v1beta1 * @classdesc Represents a TemporalAsset. * @implements ITemporalAsset * @constructor - * @param {google.cloud.asset.v1.ITemporalAsset=} [properties] Properties to set + * @param {google.cloud.asset.v1beta1.ITemporalAsset=} [properties] Properties to set */ function TemporalAsset(properties) { if (properties) @@ -4120,8 +5200,8 @@ /** * TemporalAsset window. - * @member {google.cloud.asset.v1.ITimeWindow|null|undefined} window - * @memberof google.cloud.asset.v1.TemporalAsset + * @member {google.cloud.asset.v1beta1.ITimeWindow|null|undefined} window + * @memberof google.cloud.asset.v1beta1.TemporalAsset * @instance */ TemporalAsset.prototype.window = null; @@ -4129,15 +5209,15 @@ /** * TemporalAsset deleted. * @member {boolean} deleted - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1beta1.TemporalAsset * @instance */ TemporalAsset.prototype.deleted = false; /** * TemporalAsset asset. - * @member {google.cloud.asset.v1.IAsset|null|undefined} asset - * @memberof google.cloud.asset.v1.TemporalAsset + * @member {google.cloud.asset.v1beta1.IAsset|null|undefined} asset + * @memberof google.cloud.asset.v1beta1.TemporalAsset * @instance */ TemporalAsset.prototype.asset = null; @@ -4145,21 +5225,21 @@ /** * Creates a new TemporalAsset instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1beta1.TemporalAsset * @static - * @param {google.cloud.asset.v1.ITemporalAsset=} [properties] Properties to set - * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset instance + * @param {google.cloud.asset.v1beta1.ITemporalAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1beta1.TemporalAsset} TemporalAsset instance */ TemporalAsset.create = function create(properties) { return new TemporalAsset(properties); }; /** - * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1beta1.TemporalAsset.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1beta1.TemporalAsset * @static - * @param {google.cloud.asset.v1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {google.cloud.asset.v1beta1.ITemporalAsset} message TemporalAsset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -4167,20 +5247,20 @@ if (!writer) writer = $Writer.create(); if (message.window != null && message.hasOwnProperty("window")) - $root.google.cloud.asset.v1.TimeWindow.encode(message.window, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.asset.v1beta1.TimeWindow.encode(message.window, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.deleted != null && message.hasOwnProperty("deleted")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deleted); if (message.asset != null && message.hasOwnProperty("asset")) - $root.google.cloud.asset.v1.Asset.encode(message.asset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.cloud.asset.v1beta1.Asset.encode(message.asset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.TemporalAsset.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1beta1.TemporalAsset * @static - * @param {google.cloud.asset.v1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {google.cloud.asset.v1beta1.ITemporalAsset} message TemporalAsset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -4191,29 +5271,29 @@ /** * Decodes a TemporalAsset message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1beta1.TemporalAsset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + * @returns {google.cloud.asset.v1beta1.TemporalAsset} TemporalAsset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ TemporalAsset.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.TemporalAsset(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1beta1.TemporalAsset(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.window = $root.google.cloud.asset.v1.TimeWindow.decode(reader, reader.uint32()); + message.window = $root.google.cloud.asset.v1beta1.TimeWindow.decode(reader, reader.uint32()); break; case 2: message.deleted = reader.bool(); break; case 3: - message.asset = $root.google.cloud.asset.v1.Asset.decode(reader, reader.uint32()); + message.asset = $root.google.cloud.asset.v1beta1.Asset.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -4226,10 +5306,10 @@ /** * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1beta1.TemporalAsset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + * @returns {google.cloud.asset.v1beta1.TemporalAsset} TemporalAsset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -4242,7 +5322,7 @@ /** * Verifies a TemporalAsset message. * @function verify - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1beta1.TemporalAsset * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -4251,7 +5331,7 @@ if (typeof message !== "object" || message === null) return "object expected"; if (message.window != null && message.hasOwnProperty("window")) { - var error = $root.google.cloud.asset.v1.TimeWindow.verify(message.window); + var error = $root.google.cloud.asset.v1beta1.TimeWindow.verify(message.window); if (error) return "window." + error; } @@ -4259,7 +5339,7 @@ if (typeof message.deleted !== "boolean") return "deleted: boolean expected"; if (message.asset != null && message.hasOwnProperty("asset")) { - var error = $root.google.cloud.asset.v1.Asset.verify(message.asset); + var error = $root.google.cloud.asset.v1beta1.Asset.verify(message.asset); if (error) return "asset." + error; } @@ -4269,26 +5349,26 @@ /** * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1beta1.TemporalAsset * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + * @returns {google.cloud.asset.v1beta1.TemporalAsset} TemporalAsset */ TemporalAsset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.TemporalAsset) + if (object instanceof $root.google.cloud.asset.v1beta1.TemporalAsset) return object; - var message = new $root.google.cloud.asset.v1.TemporalAsset(); + var message = new $root.google.cloud.asset.v1beta1.TemporalAsset(); if (object.window != null) { if (typeof object.window !== "object") - throw TypeError(".google.cloud.asset.v1.TemporalAsset.window: object expected"); - message.window = $root.google.cloud.asset.v1.TimeWindow.fromObject(object.window); + throw TypeError(".google.cloud.asset.v1beta1.TemporalAsset.window: object expected"); + message.window = $root.google.cloud.asset.v1beta1.TimeWindow.fromObject(object.window); } if (object.deleted != null) message.deleted = Boolean(object.deleted); if (object.asset != null) { if (typeof object.asset !== "object") - throw TypeError(".google.cloud.asset.v1.TemporalAsset.asset: object expected"); - message.asset = $root.google.cloud.asset.v1.Asset.fromObject(object.asset); + throw TypeError(".google.cloud.asset.v1beta1.TemporalAsset.asset: object expected"); + message.asset = $root.google.cloud.asset.v1beta1.Asset.fromObject(object.asset); } return message; }; @@ -4296,9 +5376,9 @@ /** * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1beta1.TemporalAsset * @static - * @param {google.cloud.asset.v1.TemporalAsset} message TemporalAsset + * @param {google.cloud.asset.v1beta1.TemporalAsset} message TemporalAsset * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -4312,18 +5392,18 @@ object.asset = null; } if (message.window != null && message.hasOwnProperty("window")) - object.window = $root.google.cloud.asset.v1.TimeWindow.toObject(message.window, options); + object.window = $root.google.cloud.asset.v1beta1.TimeWindow.toObject(message.window, options); if (message.deleted != null && message.hasOwnProperty("deleted")) object.deleted = message.deleted; if (message.asset != null && message.hasOwnProperty("asset")) - object.asset = $root.google.cloud.asset.v1.Asset.toObject(message.asset, options); + object.asset = $root.google.cloud.asset.v1beta1.Asset.toObject(message.asset, options); return object; }; /** * Converts this TemporalAsset to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.TemporalAsset + * @memberof google.cloud.asset.v1beta1.TemporalAsset * @instance * @returns {Object.} JSON object */ @@ -4334,11 +5414,11 @@ return TemporalAsset; })(); - v1.TimeWindow = (function() { + v1beta1.TimeWindow = (function() { /** * Properties of a TimeWindow. - * @memberof google.cloud.asset.v1 + * @memberof google.cloud.asset.v1beta1 * @interface ITimeWindow * @property {google.protobuf.ITimestamp|null} [startTime] TimeWindow startTime * @property {google.protobuf.ITimestamp|null} [endTime] TimeWindow endTime @@ -4346,11 +5426,11 @@ /** * Constructs a new TimeWindow. - * @memberof google.cloud.asset.v1 + * @memberof google.cloud.asset.v1beta1 * @classdesc Represents a TimeWindow. * @implements ITimeWindow * @constructor - * @param {google.cloud.asset.v1.ITimeWindow=} [properties] Properties to set + * @param {google.cloud.asset.v1beta1.ITimeWindow=} [properties] Properties to set */ function TimeWindow(properties) { if (properties) @@ -4362,7 +5442,7 @@ /** * TimeWindow startTime. * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1beta1.TimeWindow * @instance */ TimeWindow.prototype.startTime = null; @@ -4370,7 +5450,7 @@ /** * TimeWindow endTime. * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1beta1.TimeWindow * @instance */ TimeWindow.prototype.endTime = null; @@ -4378,21 +5458,21 @@ /** * Creates a new TimeWindow instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1beta1.TimeWindow * @static - * @param {google.cloud.asset.v1.ITimeWindow=} [properties] Properties to set - * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow instance + * @param {google.cloud.asset.v1beta1.ITimeWindow=} [properties] Properties to set + * @returns {google.cloud.asset.v1beta1.TimeWindow} TimeWindow instance */ TimeWindow.create = function create(properties) { return new TimeWindow(properties); }; /** - * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1beta1.TimeWindow.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1beta1.TimeWindow * @static - * @param {google.cloud.asset.v1.ITimeWindow} message TimeWindow message or plain object to encode + * @param {google.cloud.asset.v1beta1.ITimeWindow} message TimeWindow message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -4407,11 +5487,11 @@ }; /** - * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. + * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.TimeWindow.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1beta1.TimeWindow * @static - * @param {google.cloud.asset.v1.ITimeWindow} message TimeWindow message or plain object to encode + * @param {google.cloud.asset.v1beta1.ITimeWindow} message TimeWindow message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -4422,18 +5502,18 @@ /** * Decodes a TimeWindow message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1beta1.TimeWindow * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow + * @returns {google.cloud.asset.v1beta1.TimeWindow} TimeWindow * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ TimeWindow.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.TimeWindow(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1beta1.TimeWindow(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -4454,10 +5534,10 @@ /** * Decodes a TimeWindow message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1beta1.TimeWindow * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow + * @returns {google.cloud.asset.v1beta1.TimeWindow} TimeWindow * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -4470,7 +5550,7 @@ /** * Verifies a TimeWindow message. * @function verify - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1beta1.TimeWindow * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -4494,23 +5574,23 @@ /** * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1beta1.TimeWindow * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow + * @returns {google.cloud.asset.v1beta1.TimeWindow} TimeWindow */ TimeWindow.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.TimeWindow) + if (object instanceof $root.google.cloud.asset.v1beta1.TimeWindow) return object; - var message = new $root.google.cloud.asset.v1.TimeWindow(); + var message = new $root.google.cloud.asset.v1beta1.TimeWindow(); if (object.startTime != null) { if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.asset.v1.TimeWindow.startTime: object expected"); + throw TypeError(".google.cloud.asset.v1beta1.TimeWindow.startTime: object expected"); message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); } if (object.endTime != null) { if (typeof object.endTime !== "object") - throw TypeError(".google.cloud.asset.v1.TimeWindow.endTime: object expected"); + throw TypeError(".google.cloud.asset.v1beta1.TimeWindow.endTime: object expected"); message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); } return message; @@ -4519,9 +5599,9 @@ /** * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1beta1.TimeWindow * @static - * @param {google.cloud.asset.v1.TimeWindow} message TimeWindow + * @param {google.cloud.asset.v1beta1.TimeWindow} message TimeWindow * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -4543,7 +5623,7 @@ /** * Converts this TimeWindow to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.TimeWindow + * @memberof google.cloud.asset.v1beta1.TimeWindow * @instance * @returns {Object.} JSON object */ @@ -4554,29 +5634,27 @@ return TimeWindow; })(); - v1.Asset = (function() { + v1beta1.Asset = (function() { /** * Properties of an Asset. - * @memberof google.cloud.asset.v1 + * @memberof google.cloud.asset.v1beta1 * @interface IAsset * @property {string|null} [name] Asset name * @property {string|null} [assetType] Asset assetType - * @property {google.cloud.asset.v1.IResource|null} [resource] Asset resource + * @property {google.cloud.asset.v1beta1.IResource|null} [resource] Asset resource * @property {google.iam.v1.IPolicy|null} [iamPolicy] Asset iamPolicy - * @property {Array.|null} [ancestors] Asset ancestors */ /** * Constructs a new Asset. - * @memberof google.cloud.asset.v1 + * @memberof google.cloud.asset.v1beta1 * @classdesc Represents an Asset. * @implements IAsset * @constructor - * @param {google.cloud.asset.v1.IAsset=} [properties] Properties to set + * @param {google.cloud.asset.v1beta1.IAsset=} [properties] Properties to set */ function Asset(properties) { - this.ancestors = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4586,7 +5664,7 @@ /** * Asset name. * @member {string} name - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1beta1.Asset * @instance */ Asset.prototype.name = ""; @@ -4594,15 +5672,15 @@ /** * Asset assetType. * @member {string} assetType - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1beta1.Asset * @instance */ Asset.prototype.assetType = ""; /** * Asset resource. - * @member {google.cloud.asset.v1.IResource|null|undefined} resource - * @memberof google.cloud.asset.v1.Asset + * @member {google.cloud.asset.v1beta1.IResource|null|undefined} resource + * @memberof google.cloud.asset.v1beta1.Asset * @instance */ Asset.prototype.resource = null; @@ -4610,37 +5688,29 @@ /** * Asset iamPolicy. * @member {google.iam.v1.IPolicy|null|undefined} iamPolicy - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1beta1.Asset * @instance */ Asset.prototype.iamPolicy = null; - /** - * Asset ancestors. - * @member {Array.} ancestors - * @memberof google.cloud.asset.v1.Asset - * @instance - */ - Asset.prototype.ancestors = $util.emptyArray; - /** * Creates a new Asset instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1beta1.Asset * @static - * @param {google.cloud.asset.v1.IAsset=} [properties] Properties to set - * @returns {google.cloud.asset.v1.Asset} Asset instance + * @param {google.cloud.asset.v1beta1.IAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1beta1.Asset} Asset instance */ Asset.create = function create(properties) { return new Asset(properties); }; /** - * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1beta1.Asset.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1beta1.Asset * @static - * @param {google.cloud.asset.v1.IAsset} message Asset message or plain object to encode + * @param {google.cloud.asset.v1beta1.IAsset} message Asset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -4652,21 +5722,18 @@ if (message.assetType != null && message.hasOwnProperty("assetType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); if (message.resource != null && message.hasOwnProperty("resource")) - $root.google.cloud.asset.v1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.cloud.asset.v1beta1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) $root.google.iam.v1.Policy.encode(message.iamPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.ancestors != null && message.ancestors.length) - for (var i = 0; i < message.ancestors.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.ancestors[i]); return writer; }; /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.Asset.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1beta1.Asset * @static - * @param {google.cloud.asset.v1.IAsset} message Asset message or plain object to encode + * @param {google.cloud.asset.v1beta1.IAsset} message Asset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -4677,18 +5744,18 @@ /** * Decodes an Asset message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1beta1.Asset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.Asset} Asset + * @returns {google.cloud.asset.v1beta1.Asset} Asset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Asset.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.Asset(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1beta1.Asset(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -4699,16 +5766,11 @@ message.assetType = reader.string(); break; case 3: - message.resource = $root.google.cloud.asset.v1.Resource.decode(reader, reader.uint32()); + message.resource = $root.google.cloud.asset.v1beta1.Resource.decode(reader, reader.uint32()); break; case 4: message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); break; - case 10: - if (!(message.ancestors && message.ancestors.length)) - message.ancestors = []; - message.ancestors.push(reader.string()); - break; default: reader.skipType(tag & 7); break; @@ -4720,10 +5782,10 @@ /** * Decodes an Asset message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1beta1.Asset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.Asset} Asset + * @returns {google.cloud.asset.v1beta1.Asset} Asset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -4736,7 +5798,7 @@ /** * Verifies an Asset message. * @function verify - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1beta1.Asset * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -4751,7 +5813,7 @@ if (!$util.isString(message.assetType)) return "assetType: string expected"; if (message.resource != null && message.hasOwnProperty("resource")) { - var error = $root.google.cloud.asset.v1.Resource.verify(message.resource); + var error = $root.google.cloud.asset.v1beta1.Resource.verify(message.resource); if (error) return "resource." + error; } @@ -4760,58 +5822,44 @@ if (error) return "iamPolicy." + error; } - if (message.ancestors != null && message.hasOwnProperty("ancestors")) { - if (!Array.isArray(message.ancestors)) - return "ancestors: array expected"; - for (var i = 0; i < message.ancestors.length; ++i) - if (!$util.isString(message.ancestors[i])) - return "ancestors: string[] expected"; - } return null; }; /** * Creates an Asset message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1beta1.Asset * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.Asset} Asset + * @returns {google.cloud.asset.v1beta1.Asset} Asset */ Asset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.Asset) + if (object instanceof $root.google.cloud.asset.v1beta1.Asset) return object; - var message = new $root.google.cloud.asset.v1.Asset(); + var message = new $root.google.cloud.asset.v1beta1.Asset(); if (object.name != null) message.name = String(object.name); if (object.assetType != null) message.assetType = String(object.assetType); if (object.resource != null) { if (typeof object.resource !== "object") - throw TypeError(".google.cloud.asset.v1.Asset.resource: object expected"); - message.resource = $root.google.cloud.asset.v1.Resource.fromObject(object.resource); + throw TypeError(".google.cloud.asset.v1beta1.Asset.resource: object expected"); + message.resource = $root.google.cloud.asset.v1beta1.Resource.fromObject(object.resource); } if (object.iamPolicy != null) { if (typeof object.iamPolicy !== "object") - throw TypeError(".google.cloud.asset.v1.Asset.iamPolicy: object expected"); + throw TypeError(".google.cloud.asset.v1beta1.Asset.iamPolicy: object expected"); message.iamPolicy = $root.google.iam.v1.Policy.fromObject(object.iamPolicy); } - if (object.ancestors) { - if (!Array.isArray(object.ancestors)) - throw TypeError(".google.cloud.asset.v1.Asset.ancestors: array expected"); - message.ancestors = []; - for (var i = 0; i < object.ancestors.length; ++i) - message.ancestors[i] = String(object.ancestors[i]); - } return message; }; /** * Creates a plain object from an Asset message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1beta1.Asset * @static - * @param {google.cloud.asset.v1.Asset} message Asset + * @param {google.cloud.asset.v1beta1.Asset} message Asset * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -4819,8 +5867,6 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.ancestors = []; if (options.defaults) { object.name = ""; object.assetType = ""; @@ -4832,21 +5878,16 @@ if (message.assetType != null && message.hasOwnProperty("assetType")) object.assetType = message.assetType; if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = $root.google.cloud.asset.v1.Resource.toObject(message.resource, options); + object.resource = $root.google.cloud.asset.v1beta1.Resource.toObject(message.resource, options); if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) object.iamPolicy = $root.google.iam.v1.Policy.toObject(message.iamPolicy, options); - if (message.ancestors && message.ancestors.length) { - object.ancestors = []; - for (var j = 0; j < message.ancestors.length; ++j) - object.ancestors[j] = message.ancestors[j]; - } return object; }; /** * Converts this Asset to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.Asset + * @memberof google.cloud.asset.v1beta1.Asset * @instance * @returns {Object.} JSON object */ @@ -4857,11 +5898,11 @@ return Asset; })(); - v1.Resource = (function() { + v1beta1.Resource = (function() { /** * Properties of a Resource. - * @memberof google.cloud.asset.v1 + * @memberof google.cloud.asset.v1beta1 * @interface IResource * @property {string|null} [version] Resource version * @property {string|null} [discoveryDocumentUri] Resource discoveryDocumentUri @@ -4873,11 +5914,11 @@ /** * Constructs a new Resource. - * @memberof google.cloud.asset.v1 + * @memberof google.cloud.asset.v1beta1 * @classdesc Represents a Resource. * @implements IResource * @constructor - * @param {google.cloud.asset.v1.IResource=} [properties] Properties to set + * @param {google.cloud.asset.v1beta1.IResource=} [properties] Properties to set */ function Resource(properties) { if (properties) @@ -4889,7 +5930,7 @@ /** * Resource version. * @member {string} version - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1beta1.Resource * @instance */ Resource.prototype.version = ""; @@ -4897,7 +5938,7 @@ /** * Resource discoveryDocumentUri. * @member {string} discoveryDocumentUri - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1beta1.Resource * @instance */ Resource.prototype.discoveryDocumentUri = ""; @@ -4905,7 +5946,7 @@ /** * Resource discoveryName. * @member {string} discoveryName - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1beta1.Resource * @instance */ Resource.prototype.discoveryName = ""; @@ -4913,7 +5954,7 @@ /** * Resource resourceUrl. * @member {string} resourceUrl - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1beta1.Resource * @instance */ Resource.prototype.resourceUrl = ""; @@ -4921,7 +5962,7 @@ /** * Resource parent. * @member {string} parent - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1beta1.Resource * @instance */ Resource.prototype.parent = ""; @@ -4929,7 +5970,7 @@ /** * Resource data. * @member {google.protobuf.IStruct|null|undefined} data - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1beta1.Resource * @instance */ Resource.prototype.data = null; @@ -4937,21 +5978,21 @@ /** * Creates a new Resource instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1beta1.Resource * @static - * @param {google.cloud.asset.v1.IResource=} [properties] Properties to set - * @returns {google.cloud.asset.v1.Resource} Resource instance + * @param {google.cloud.asset.v1beta1.IResource=} [properties] Properties to set + * @returns {google.cloud.asset.v1beta1.Resource} Resource instance */ Resource.create = function create(properties) { return new Resource(properties); }; /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1beta1.Resource.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1beta1.Resource * @static - * @param {google.cloud.asset.v1.IResource} message Resource message or plain object to encode + * @param {google.cloud.asset.v1beta1.IResource} message Resource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -4974,11 +6015,11 @@ }; /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.Resource.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1beta1.Resource * @static - * @param {google.cloud.asset.v1.IResource} message Resource message or plain object to encode + * @param {google.cloud.asset.v1beta1.IResource} message Resource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -4989,18 +6030,18 @@ /** * Decodes a Resource message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1beta1.Resource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1.Resource} Resource + * @returns {google.cloud.asset.v1beta1.Resource} Resource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Resource.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.Resource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1beta1.Resource(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -5033,10 +6074,10 @@ /** * Decodes a Resource message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1beta1.Resource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.Resource} Resource + * @returns {google.cloud.asset.v1beta1.Resource} Resource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -5049,7 +6090,7 @@ /** * Verifies a Resource message. * @function verify - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1beta1.Resource * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -5083,15 +6124,15 @@ /** * Creates a Resource message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1beta1.Resource * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.Resource} Resource + * @returns {google.cloud.asset.v1beta1.Resource} Resource */ Resource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.Resource) + if (object instanceof $root.google.cloud.asset.v1beta1.Resource) return object; - var message = new $root.google.cloud.asset.v1.Resource(); + var message = new $root.google.cloud.asset.v1beta1.Resource(); if (object.version != null) message.version = String(object.version); if (object.discoveryDocumentUri != null) @@ -5104,7 +6145,7 @@ message.parent = String(object.parent); if (object.data != null) { if (typeof object.data !== "object") - throw TypeError(".google.cloud.asset.v1.Resource.data: object expected"); + throw TypeError(".google.cloud.asset.v1beta1.Resource.data: object expected"); message.data = $root.google.protobuf.Struct.fromObject(object.data); } return message; @@ -5113,9 +6154,9 @@ /** * Creates a plain object from a Resource message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1beta1.Resource * @static - * @param {google.cloud.asset.v1.Resource} message Resource + * @param {google.cloud.asset.v1beta1.Resource} message Resource * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -5149,7 +6190,7 @@ /** * Converts this Resource to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.Resource + * @memberof google.cloud.asset.v1beta1.Resource * @instance * @returns {Object.} JSON object */ @@ -5160,18 +6201,6 @@ return Resource; })(); - return v1; - })(); - - asset.v1beta1 = (function() { - - /** - * Namespace v1beta1. - * @memberof google.cloud.asset - * @namespace - */ - var v1beta1 = {}; - v1beta1.AssetService = (function() { /** @@ -6534,6 +7563,7 @@ * @memberof google.cloud.asset.v1beta1 * @interface IGcsDestination * @property {string|null} [uri] GcsDestination uri + * @property {string|null} [uriPrefix] GcsDestination uriPrefix */ /** @@ -6559,17 +7589,25 @@ */ GcsDestination.prototype.uri = ""; + /** + * GcsDestination uriPrefix. + * @member {string} uriPrefix + * @memberof google.cloud.asset.v1beta1.GcsDestination + * @instance + */ + GcsDestination.prototype.uriPrefix = ""; + // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * GcsDestination objectUri. - * @member {"uri"|undefined} objectUri + * @member {"uri"|"uriPrefix"|undefined} objectUri * @memberof google.cloud.asset.v1beta1.GcsDestination * @instance */ Object.defineProperty(GcsDestination.prototype, "objectUri", { - get: $util.oneOfGetter($oneOfFields = ["uri"]), + get: $util.oneOfGetter($oneOfFields = ["uri", "uriPrefix"]), set: $util.oneOfSetter($oneOfFields) }); @@ -6599,6 +7637,8 @@ writer = $Writer.create(); if (message.uri != null && message.hasOwnProperty("uri")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uriPrefix); return writer; }; @@ -6636,6 +7676,9 @@ case 1: message.uri = reader.string(); break; + case 2: + message.uriPrefix = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -6677,6 +7720,13 @@ if (!$util.isString(message.uri)) return "uri: string expected"; } + if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) { + if (properties.objectUri === 1) + return "objectUri: multiple values"; + properties.objectUri = 1; + if (!$util.isString(message.uriPrefix)) + return "uriPrefix: string expected"; + } return null; }; @@ -6694,6 +7744,8 @@ var message = new $root.google.cloud.asset.v1beta1.GcsDestination(); if (object.uri != null) message.uri = String(object.uri); + if (object.uriPrefix != null) + message.uriPrefix = String(object.uriPrefix); return message; }; @@ -6715,6 +7767,11 @@ if (options.oneofs) object.objectUri = "uri"; } + if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) { + object.uriPrefix = message.uriPrefix; + if (options.oneofs) + object.objectUri = "uriPrefix"; + } return object; }; @@ -6748,26 +7805,42 @@ return values; })(); - v1beta1.TemporalAsset = (function() { + return v1beta1; + })(); + + asset.v1p1beta1 = (function() { + + /** + * Namespace v1p1beta1. + * @memberof google.cloud.asset + * @namespace + */ + var v1p1beta1 = {}; + + v1p1beta1.StandardResourceMetadata = (function() { /** - * Properties of a TemporalAsset. - * @memberof google.cloud.asset.v1beta1 - * @interface ITemporalAsset - * @property {google.cloud.asset.v1beta1.ITimeWindow|null} [window] TemporalAsset window - * @property {boolean|null} [deleted] TemporalAsset deleted - * @property {google.cloud.asset.v1beta1.IAsset|null} [asset] TemporalAsset asset + * Properties of a StandardResourceMetadata. + * @memberof google.cloud.asset.v1p1beta1 + * @interface IStandardResourceMetadata + * @property {string|null} [name] StandardResourceMetadata name + * @property {string|null} [assetType] StandardResourceMetadata assetType + * @property {string|null} [project] StandardResourceMetadata project + * @property {string|null} [displayName] StandardResourceMetadata displayName + * @property {string|null} [description] StandardResourceMetadata description + * @property {Array.|null} [additionalAttributes] StandardResourceMetadata additionalAttributes */ /** - * Constructs a new TemporalAsset. - * @memberof google.cloud.asset.v1beta1 - * @classdesc Represents a TemporalAsset. - * @implements ITemporalAsset + * Constructs a new StandardResourceMetadata. + * @memberof google.cloud.asset.v1p1beta1 + * @classdesc Represents a StandardResourceMetadata. + * @implements IStandardResourceMetadata * @constructor - * @param {google.cloud.asset.v1beta1.ITemporalAsset=} [properties] Properties to set + * @param {google.cloud.asset.v1p1beta1.IStandardResourceMetadata=} [properties] Properties to set */ - function TemporalAsset(properties) { + function StandardResourceMetadata(properties) { + this.additionalAttributes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6775,101 +7848,143 @@ } /** - * TemporalAsset window. - * @member {google.cloud.asset.v1beta1.ITimeWindow|null|undefined} window - * @memberof google.cloud.asset.v1beta1.TemporalAsset + * StandardResourceMetadata name. + * @member {string} name + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata * @instance */ - TemporalAsset.prototype.window = null; + StandardResourceMetadata.prototype.name = ""; /** - * TemporalAsset deleted. - * @member {boolean} deleted - * @memberof google.cloud.asset.v1beta1.TemporalAsset + * StandardResourceMetadata assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata * @instance */ - TemporalAsset.prototype.deleted = false; + StandardResourceMetadata.prototype.assetType = ""; /** - * TemporalAsset asset. - * @member {google.cloud.asset.v1beta1.IAsset|null|undefined} asset - * @memberof google.cloud.asset.v1beta1.TemporalAsset + * StandardResourceMetadata project. + * @member {string} project + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata * @instance */ - TemporalAsset.prototype.asset = null; + StandardResourceMetadata.prototype.project = ""; /** - * Creates a new TemporalAsset instance using the specified properties. + * StandardResourceMetadata displayName. + * @member {string} displayName + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @instance + */ + StandardResourceMetadata.prototype.displayName = ""; + + /** + * StandardResourceMetadata description. + * @member {string} description + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @instance + */ + StandardResourceMetadata.prototype.description = ""; + + /** + * StandardResourceMetadata additionalAttributes. + * @member {Array.} additionalAttributes + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @instance + */ + StandardResourceMetadata.prototype.additionalAttributes = $util.emptyArray; + + /** + * Creates a new StandardResourceMetadata instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata * @static - * @param {google.cloud.asset.v1beta1.ITemporalAsset=} [properties] Properties to set - * @returns {google.cloud.asset.v1beta1.TemporalAsset} TemporalAsset instance + * @param {google.cloud.asset.v1p1beta1.IStandardResourceMetadata=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.StandardResourceMetadata} StandardResourceMetadata instance */ - TemporalAsset.create = function create(properties) { - return new TemporalAsset(properties); + StandardResourceMetadata.create = function create(properties) { + return new StandardResourceMetadata(properties); }; /** - * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1beta1.TemporalAsset.verify|verify} messages. + * Encodes the specified StandardResourceMetadata message. Does not implicitly {@link google.cloud.asset.v1p1beta1.StandardResourceMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata * @static - * @param {google.cloud.asset.v1beta1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.IStandardResourceMetadata} message StandardResourceMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TemporalAsset.encode = function encode(message, writer) { + StandardResourceMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.window != null && message.hasOwnProperty("window")) - $root.google.cloud.asset.v1beta1.TimeWindow.encode(message.window, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.deleted != null && message.hasOwnProperty("deleted")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deleted); - if (message.asset != null && message.hasOwnProperty("asset")) - $root.google.cloud.asset.v1beta1.Asset.encode(message.asset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.assetType != null && message.hasOwnProperty("assetType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); + if (message.project != null && message.hasOwnProperty("project")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.project); + if (message.displayName != null && message.hasOwnProperty("displayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); + if (message.description != null && message.hasOwnProperty("description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.additionalAttributes != null && message.additionalAttributes.length) + for (var i = 0; i < message.additionalAttributes.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.additionalAttributes[i]); return writer; }; /** - * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.TemporalAsset.verify|verify} messages. + * Encodes the specified StandardResourceMetadata message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.StandardResourceMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata * @static - * @param {google.cloud.asset.v1beta1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.IStandardResourceMetadata} message StandardResourceMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TemporalAsset.encodeDelimited = function encodeDelimited(message, writer) { + StandardResourceMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TemporalAsset message from the specified reader or buffer. + * Decodes a StandardResourceMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1beta1.TemporalAsset} TemporalAsset + * @returns {google.cloud.asset.v1p1beta1.StandardResourceMetadata} StandardResourceMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TemporalAsset.decode = function decode(reader, length) { + StandardResourceMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1beta1.TemporalAsset(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.window = $root.google.cloud.asset.v1beta1.TimeWindow.decode(reader, reader.uint32()); + message.name = reader.string(); break; case 2: - message.deleted = reader.bool(); + message.assetType = reader.string(); break; case 3: - message.asset = $root.google.cloud.asset.v1beta1.Asset.decode(reader, reader.uint32()); + message.project = reader.string(); + break; + case 4: + message.displayName = reader.string(); + break; + case 5: + message.description = reader.string(); + break; + case 10: + if (!(message.additionalAttributes && message.additionalAttributes.length)) + message.additionalAttributes = []; + message.additionalAttributes.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -6880,135 +7995,163 @@ }; /** - * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * Decodes a StandardResourceMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1beta1.TemporalAsset} TemporalAsset + * @returns {google.cloud.asset.v1p1beta1.StandardResourceMetadata} StandardResourceMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TemporalAsset.decodeDelimited = function decodeDelimited(reader) { + StandardResourceMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TemporalAsset message. + * Verifies a StandardResourceMetadata message. * @function verify - * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TemporalAsset.verify = function verify(message) { + StandardResourceMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.window != null && message.hasOwnProperty("window")) { - var error = $root.google.cloud.asset.v1beta1.TimeWindow.verify(message.window); - if (error) - return "window." + error; - } - if (message.deleted != null && message.hasOwnProperty("deleted")) - if (typeof message.deleted !== "boolean") - return "deleted: boolean expected"; - if (message.asset != null && message.hasOwnProperty("asset")) { - var error = $root.google.cloud.asset.v1beta1.Asset.verify(message.asset); - if (error) - return "asset." + error; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: 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.additionalAttributes != null && message.hasOwnProperty("additionalAttributes")) { + if (!Array.isArray(message.additionalAttributes)) + return "additionalAttributes: array expected"; + for (var i = 0; i < message.additionalAttributes.length; ++i) + if (!$util.isString(message.additionalAttributes[i])) + return "additionalAttributes: string[] expected"; } return null; }; /** - * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. + * Creates a StandardResourceMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1beta1.TemporalAsset} TemporalAsset + * @returns {google.cloud.asset.v1p1beta1.StandardResourceMetadata} StandardResourceMetadata */ - TemporalAsset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1beta1.TemporalAsset) + StandardResourceMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata) return object; - var message = new $root.google.cloud.asset.v1beta1.TemporalAsset(); - if (object.window != null) { - if (typeof object.window !== "object") - throw TypeError(".google.cloud.asset.v1beta1.TemporalAsset.window: object expected"); - message.window = $root.google.cloud.asset.v1beta1.TimeWindow.fromObject(object.window); - } - if (object.deleted != null) - message.deleted = Boolean(object.deleted); - if (object.asset != null) { - if (typeof object.asset !== "object") - throw TypeError(".google.cloud.asset.v1beta1.TemporalAsset.asset: object expected"); - message.asset = $root.google.cloud.asset.v1beta1.Asset.fromObject(object.asset); + var message = new $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata(); + if (object.name != null) + message.name = String(object.name); + if (object.assetType != null) + message.assetType = String(object.assetType); + if (object.project != null) + message.project = String(object.project); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.additionalAttributes) { + if (!Array.isArray(object.additionalAttributes)) + throw TypeError(".google.cloud.asset.v1p1beta1.StandardResourceMetadata.additionalAttributes: array expected"); + message.additionalAttributes = []; + for (var i = 0; i < object.additionalAttributes.length; ++i) + message.additionalAttributes[i] = String(object.additionalAttributes[i]); } return message; }; /** - * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * Creates a plain object from a StandardResourceMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata * @static - * @param {google.cloud.asset.v1beta1.TemporalAsset} message TemporalAsset + * @param {google.cloud.asset.v1p1beta1.StandardResourceMetadata} message StandardResourceMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TemporalAsset.toObject = function toObject(message, options) { + StandardResourceMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.additionalAttributes = []; if (options.defaults) { - object.window = null; - object.deleted = false; - object.asset = null; + object.name = ""; + object.assetType = ""; + object.project = ""; + object.displayName = ""; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.additionalAttributes && message.additionalAttributes.length) { + object.additionalAttributes = []; + for (var j = 0; j < message.additionalAttributes.length; ++j) + object.additionalAttributes[j] = message.additionalAttributes[j]; } - if (message.window != null && message.hasOwnProperty("window")) - object.window = $root.google.cloud.asset.v1beta1.TimeWindow.toObject(message.window, options); - if (message.deleted != null && message.hasOwnProperty("deleted")) - object.deleted = message.deleted; - if (message.asset != null && message.hasOwnProperty("asset")) - object.asset = $root.google.cloud.asset.v1beta1.Asset.toObject(message.asset, options); return object; }; /** - * Converts this TemporalAsset to JSON. + * Converts this StandardResourceMetadata to JSON. * @function toJSON - * @memberof google.cloud.asset.v1beta1.TemporalAsset + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata * @instance * @returns {Object.} JSON object */ - TemporalAsset.prototype.toJSON = function toJSON() { + StandardResourceMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TemporalAsset; + return StandardResourceMetadata; })(); - v1beta1.TimeWindow = (function() { + v1p1beta1.IamPolicySearchResult = (function() { /** - * Properties of a TimeWindow. - * @memberof google.cloud.asset.v1beta1 - * @interface ITimeWindow - * @property {google.protobuf.ITimestamp|null} [startTime] TimeWindow startTime - * @property {google.protobuf.ITimestamp|null} [endTime] TimeWindow endTime + * Properties of an IamPolicySearchResult. + * @memberof google.cloud.asset.v1p1beta1 + * @interface IIamPolicySearchResult + * @property {string|null} [resource] IamPolicySearchResult resource + * @property {string|null} [project] IamPolicySearchResult project + * @property {google.iam.v1.IPolicy|null} [policy] IamPolicySearchResult policy */ /** - * Constructs a new TimeWindow. - * @memberof google.cloud.asset.v1beta1 - * @classdesc Represents a TimeWindow. - * @implements ITimeWindow + * Constructs a new IamPolicySearchResult. + * @memberof google.cloud.asset.v1p1beta1 + * @classdesc Represents an IamPolicySearchResult. + * @implements IIamPolicySearchResult * @constructor - * @param {google.cloud.asset.v1beta1.ITimeWindow=} [properties] Properties to set + * @param {google.cloud.asset.v1p1beta1.IIamPolicySearchResult=} [properties] Properties to set */ - function TimeWindow(properties) { + function IamPolicySearchResult(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7016,88 +8159,101 @@ } /** - * TimeWindow startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.asset.v1beta1.TimeWindow + * IamPolicySearchResult resource. + * @member {string} resource + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult * @instance */ - TimeWindow.prototype.startTime = null; + IamPolicySearchResult.prototype.resource = ""; /** - * TimeWindow endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.asset.v1beta1.TimeWindow + * IamPolicySearchResult project. + * @member {string} project + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult * @instance */ - TimeWindow.prototype.endTime = null; + IamPolicySearchResult.prototype.project = ""; /** - * Creates a new TimeWindow instance using the specified properties. + * IamPolicySearchResult policy. + * @member {google.iam.v1.IPolicy|null|undefined} policy + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult + * @instance + */ + IamPolicySearchResult.prototype.policy = null; + + /** + * Creates a new IamPolicySearchResult instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1beta1.TimeWindow + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult * @static - * @param {google.cloud.asset.v1beta1.ITimeWindow=} [properties] Properties to set - * @returns {google.cloud.asset.v1beta1.TimeWindow} TimeWindow instance + * @param {google.cloud.asset.v1p1beta1.IIamPolicySearchResult=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.IamPolicySearchResult} IamPolicySearchResult instance */ - TimeWindow.create = function create(properties) { - return new TimeWindow(properties); + IamPolicySearchResult.create = function create(properties) { + return new IamPolicySearchResult(properties); }; /** - * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1beta1.TimeWindow.verify|verify} messages. + * Encodes the specified IamPolicySearchResult message. Does not implicitly {@link google.cloud.asset.v1p1beta1.IamPolicySearchResult.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1beta1.TimeWindow + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult * @static - * @param {google.cloud.asset.v1beta1.ITimeWindow} message TimeWindow message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.IIamPolicySearchResult} message IamPolicySearchResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeWindow.encode = function encode(message, writer) { + IamPolicySearchResult.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.startTime != null && message.hasOwnProperty("startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.endTime != null && message.hasOwnProperty("endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resource != null && message.hasOwnProperty("resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.project != null && message.hasOwnProperty("project")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.project); + if (message.policy != null && message.hasOwnProperty("policy")) + $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.TimeWindow.verify|verify} messages. + * Encodes the specified IamPolicySearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.IamPolicySearchResult.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1beta1.TimeWindow + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult * @static - * @param {google.cloud.asset.v1beta1.ITimeWindow} message TimeWindow message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.IIamPolicySearchResult} message IamPolicySearchResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeWindow.encodeDelimited = function encodeDelimited(message, writer) { + IamPolicySearchResult.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TimeWindow message from the specified reader or buffer. + * Decodes an IamPolicySearchResult message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1beta1.TimeWindow + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1beta1.TimeWindow} TimeWindow + * @returns {google.cloud.asset.v1p1beta1.IamPolicySearchResult} IamPolicySearchResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TimeWindow.decode = function decode(reader, length) { + IamPolicySearchResult.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1beta1.TimeWindow(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.resource = reader.string(); break; - case 2: - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + case 3: + message.project = reader.string(); + break; + case 4: + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -7108,129 +8264,301 @@ }; /** - * Decodes a TimeWindow message from the specified reader or buffer, length delimited. + * Decodes an IamPolicySearchResult message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1beta1.TimeWindow + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1beta1.TimeWindow} TimeWindow + * @returns {google.cloud.asset.v1p1beta1.IamPolicySearchResult} IamPolicySearchResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TimeWindow.decodeDelimited = function decodeDelimited(reader) { + IamPolicySearchResult.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TimeWindow message. + * Verifies an IamPolicySearchResult message. * @function verify - * @memberof google.cloud.asset.v1beta1.TimeWindow + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TimeWindow.verify = function verify(message) { + IamPolicySearchResult.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.iam.v1.Policy.verify(message.policy); if (error) - return "endTime." + error; + return "policy." + error; } return null; }; /** - * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. + * Creates an IamPolicySearchResult message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1beta1.TimeWindow - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1beta1.TimeWindow} TimeWindow - */ - TimeWindow.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1beta1.TimeWindow) - return object; - var message = new $root.google.cloud.asset.v1beta1.TimeWindow(); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.asset.v1beta1.TimeWindow.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.cloud.asset.v1beta1.TimeWindow.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p1beta1.IamPolicySearchResult} IamPolicySearchResult + */ + IamPolicySearchResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult) + return object; + var message = new $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.project != null) + message.project = String(object.project); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.cloud.asset.v1p1beta1.IamPolicySearchResult.policy: object expected"); + message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); } return message; }; /** - * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. + * Creates a plain object from an IamPolicySearchResult message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1beta1.TimeWindow + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult * @static - * @param {google.cloud.asset.v1beta1.TimeWindow} message TimeWindow + * @param {google.cloud.asset.v1p1beta1.IamPolicySearchResult} message IamPolicySearchResult * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TimeWindow.toObject = function toObject(message, options) { + IamPolicySearchResult.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.startTime = null; - object.endTime = null; + object.resource = ""; + object.project = ""; + object.policy = null; } - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); return object; }; /** - * Converts this TimeWindow to JSON. + * Converts this IamPolicySearchResult to JSON. * @function toJSON - * @memberof google.cloud.asset.v1beta1.TimeWindow + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult * @instance * @returns {Object.} JSON object */ - TimeWindow.prototype.toJSON = function toJSON() { + IamPolicySearchResult.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TimeWindow; + return IamPolicySearchResult; })(); - v1beta1.Asset = (function() { + v1p1beta1.AssetService = (function() { /** - * Properties of an Asset. - * @memberof google.cloud.asset.v1beta1 - * @interface IAsset - * @property {string|null} [name] Asset name - * @property {string|null} [assetType] Asset assetType - * @property {google.cloud.asset.v1beta1.IResource|null} [resource] Asset resource - * @property {google.iam.v1.IPolicy|null} [iamPolicy] Asset iamPolicy + * Constructs a new AssetService service. + * @memberof google.cloud.asset.v1p1beta1 + * @classdesc Represents an AssetService + * @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 AssetService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AssetService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AssetService; /** - * Constructs a new Asset. - * @memberof google.cloud.asset.v1beta1 - * @classdesc Represents an Asset. - * @implements IAsset + * Creates new AssetService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @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 {AssetService} RPC service. Useful where requests and/or responses are streamed. + */ + AssetService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService#searchResources}. + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @typedef SearchResourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1p1beta1.SearchResourcesResponse} [response] SearchResourcesResponse + */ + + /** + * Calls SearchResources. + * @function searchResources + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p1beta1.ISearchResourcesRequest} request SearchResourcesRequest message or plain object + * @param {google.cloud.asset.v1p1beta1.AssetService.SearchResourcesCallback} callback Node-style callback called with the error, if any, and SearchResourcesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.searchResources = function searchResources(request, callback) { + return this.rpcCall(searchResources, $root.google.cloud.asset.v1p1beta1.SearchResourcesRequest, $root.google.cloud.asset.v1p1beta1.SearchResourcesResponse, request, callback); + }, "name", { value: "SearchResources" }); + + /** + * Calls SearchResources. + * @function searchResources + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p1beta1.ISearchResourcesRequest} request SearchResourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService#searchIamPolicies}. + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @typedef SearchIamPoliciesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse} [response] SearchIamPoliciesResponse + */ + + /** + * Calls SearchIamPolicies. + * @function searchIamPolicies + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest} request SearchIamPoliciesRequest message or plain object + * @param {google.cloud.asset.v1p1beta1.AssetService.SearchIamPoliciesCallback} callback Node-style callback called with the error, if any, and SearchIamPoliciesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.searchIamPolicies = function searchIamPolicies(request, callback) { + return this.rpcCall(searchIamPolicies, $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest, $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse, request, callback); + }, "name", { value: "SearchIamPolicies" }); + + /** + * Calls SearchIamPolicies. + * @function searchIamPolicies + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest} request SearchIamPoliciesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService#searchAllResources}. + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @typedef SearchAllResourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1p1beta1.SearchAllResourcesResponse} [response] SearchAllResourcesResponse + */ + + /** + * Calls SearchAllResources. + * @function searchAllResources + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest} request SearchAllResourcesRequest message or plain object + * @param {google.cloud.asset.v1p1beta1.AssetService.SearchAllResourcesCallback} callback Node-style callback called with the error, if any, and SearchAllResourcesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.searchAllResources = function searchAllResources(request, callback) { + return this.rpcCall(searchAllResources, $root.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest, $root.google.cloud.asset.v1p1beta1.SearchAllResourcesResponse, request, callback); + }, "name", { value: "SearchAllResources" }); + + /** + * Calls SearchAllResources. + * @function searchAllResources + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest} request SearchAllResourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService#searchAllIamPolicies}. + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @typedef SearchAllIamPoliciesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse} [response] SearchAllIamPoliciesResponse + */ + + /** + * Calls SearchAllIamPolicies. + * @function searchAllIamPolicies + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest} request SearchAllIamPoliciesRequest message or plain object + * @param {google.cloud.asset.v1p1beta1.AssetService.SearchAllIamPoliciesCallback} callback Node-style callback called with the error, if any, and SearchAllIamPoliciesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.searchAllIamPolicies = function searchAllIamPolicies(request, callback) { + return this.rpcCall(searchAllIamPolicies, $root.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest, $root.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse, request, callback); + }, "name", { value: "SearchAllIamPolicies" }); + + /** + * Calls SearchAllIamPolicies. + * @function searchAllIamPolicies + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest} request SearchAllIamPoliciesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AssetService; + })(); + + v1p1beta1.SearchResourcesRequest = (function() { + + /** + * Properties of a SearchResourcesRequest. + * @memberof google.cloud.asset.v1p1beta1 + * @interface ISearchResourcesRequest + * @property {string|null} [scope] SearchResourcesRequest scope + * @property {string|null} [query] SearchResourcesRequest query + * @property {Array.|null} [assetTypes] SearchResourcesRequest assetTypes + * @property {number|null} [pageSize] SearchResourcesRequest pageSize + * @property {string|null} [pageToken] SearchResourcesRequest pageToken + */ + + /** + * Constructs a new SearchResourcesRequest. + * @memberof google.cloud.asset.v1p1beta1 + * @classdesc Represents a SearchResourcesRequest. + * @implements ISearchResourcesRequest * @constructor - * @param {google.cloud.asset.v1beta1.IAsset=} [properties] Properties to set + * @param {google.cloud.asset.v1p1beta1.ISearchResourcesRequest=} [properties] Properties to set */ - function Asset(properties) { + function SearchResourcesRequest(properties) { + this.assetTypes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7238,114 +8566,130 @@ } /** - * Asset name. - * @member {string} name - * @memberof google.cloud.asset.v1beta1.Asset + * SearchResourcesRequest scope. + * @member {string} scope + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @instance */ - Asset.prototype.name = ""; + SearchResourcesRequest.prototype.scope = ""; /** - * Asset assetType. - * @member {string} assetType - * @memberof google.cloud.asset.v1beta1.Asset + * SearchResourcesRequest query. + * @member {string} query + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @instance */ - Asset.prototype.assetType = ""; + SearchResourcesRequest.prototype.query = ""; /** - * Asset resource. - * @member {google.cloud.asset.v1beta1.IResource|null|undefined} resource - * @memberof google.cloud.asset.v1beta1.Asset + * SearchResourcesRequest assetTypes. + * @member {Array.} assetTypes + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @instance */ - Asset.prototype.resource = null; + SearchResourcesRequest.prototype.assetTypes = $util.emptyArray; /** - * Asset iamPolicy. - * @member {google.iam.v1.IPolicy|null|undefined} iamPolicy - * @memberof google.cloud.asset.v1beta1.Asset + * SearchResourcesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @instance */ - Asset.prototype.iamPolicy = null; + SearchResourcesRequest.prototype.pageSize = 0; /** - * Creates a new Asset instance using the specified properties. + * SearchResourcesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest + * @instance + */ + SearchResourcesRequest.prototype.pageToken = ""; + + /** + * Creates a new SearchResourcesRequest instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1beta1.Asset + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @static - * @param {google.cloud.asset.v1beta1.IAsset=} [properties] Properties to set - * @returns {google.cloud.asset.v1beta1.Asset} Asset instance + * @param {google.cloud.asset.v1p1beta1.ISearchResourcesRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.SearchResourcesRequest} SearchResourcesRequest instance */ - Asset.create = function create(properties) { - return new Asset(properties); + SearchResourcesRequest.create = function create(properties) { + return new SearchResourcesRequest(properties); }; /** - * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1beta1.Asset.verify|verify} messages. + * Encodes the specified SearchResourcesRequest message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1beta1.Asset + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @static - * @param {google.cloud.asset.v1beta1.IAsset} message Asset message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchResourcesRequest} message SearchResourcesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Asset.encode = function encode(message, writer) { + SearchResourcesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.assetType != null && message.hasOwnProperty("assetType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); - if (message.resource != null && message.hasOwnProperty("resource")) - $root.google.cloud.asset.v1beta1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) - $root.google.iam.v1.Policy.encode(message.iamPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.scope != null && message.hasOwnProperty("scope")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.scope); + if (message.query != null && message.hasOwnProperty("query")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); + if (message.assetTypes != null && message.assetTypes.length) + for (var i = 0; i < message.assetTypes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); return writer; }; /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.Asset.verify|verify} messages. + * Encodes the specified SearchResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1beta1.Asset + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @static - * @param {google.cloud.asset.v1beta1.IAsset} message Asset message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchResourcesRequest} message SearchResourcesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Asset.encodeDelimited = function encodeDelimited(message, writer) { + SearchResourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Asset message from the specified reader or buffer. + * Decodes a SearchResourcesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1beta1.Asset + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1beta1.Asset} Asset + * @returns {google.cloud.asset.v1p1beta1.SearchResourcesRequest} SearchResourcesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Asset.decode = function decode(reader, length) { + SearchResourcesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1beta1.Asset(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p1beta1.SearchResourcesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.scope = reader.string(); break; case 2: - message.assetType = reader.string(); + message.query = reader.string(); break; case 3: - message.resource = $root.google.cloud.asset.v1beta1.Resource.decode(reader, reader.uint32()); + if (!(message.assetTypes && message.assetTypes.length)) + message.assetTypes = []; + message.assetTypes.push(reader.string()); break; case 4: - message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + message.pageSize = reader.int32(); + break; + case 5: + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -7356,147 +8700,155 @@ }; /** - * Decodes an Asset message from the specified reader or buffer, length delimited. + * Decodes a SearchResourcesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1beta1.Asset + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1beta1.Asset} Asset + * @returns {google.cloud.asset.v1p1beta1.SearchResourcesRequest} SearchResourcesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Asset.decodeDelimited = function decodeDelimited(reader) { + SearchResourcesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Asset message. + * Verifies a SearchResourcesRequest message. * @function verify - * @memberof google.cloud.asset.v1beta1.Asset + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Asset.verify = function verify(message) { + SearchResourcesRequest.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.assetType != null && message.hasOwnProperty("assetType")) - if (!$util.isString(message.assetType)) - return "assetType: string expected"; - if (message.resource != null && message.hasOwnProperty("resource")) { - var error = $root.google.cloud.asset.v1beta1.Resource.verify(message.resource); - if (error) - return "resource." + error; - } - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { - var error = $root.google.iam.v1.Policy.verify(message.iamPolicy); - if (error) - return "iamPolicy." + error; + if (message.scope != null && message.hasOwnProperty("scope")) + if (!$util.isString(message.scope)) + return "scope: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { + if (!Array.isArray(message.assetTypes)) + return "assetTypes: array expected"; + for (var i = 0; i < message.assetTypes.length; ++i) + if (!$util.isString(message.assetTypes[i])) + return "assetTypes: string[] expected"; } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; return null; }; /** - * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * Creates a SearchResourcesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1beta1.Asset + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1beta1.Asset} Asset + * @returns {google.cloud.asset.v1p1beta1.SearchResourcesRequest} SearchResourcesRequest */ - Asset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1beta1.Asset) + SearchResourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchResourcesRequest) return object; - var message = new $root.google.cloud.asset.v1beta1.Asset(); - if (object.name != null) - message.name = String(object.name); - if (object.assetType != null) - message.assetType = String(object.assetType); - if (object.resource != null) { - if (typeof object.resource !== "object") - throw TypeError(".google.cloud.asset.v1beta1.Asset.resource: object expected"); - message.resource = $root.google.cloud.asset.v1beta1.Resource.fromObject(object.resource); - } - if (object.iamPolicy != null) { - if (typeof object.iamPolicy !== "object") - throw TypeError(".google.cloud.asset.v1beta1.Asset.iamPolicy: object expected"); - message.iamPolicy = $root.google.iam.v1.Policy.fromObject(object.iamPolicy); + var message = new $root.google.cloud.asset.v1p1beta1.SearchResourcesRequest(); + if (object.scope != null) + message.scope = String(object.scope); + if (object.query != null) + message.query = String(object.query); + if (object.assetTypes) { + if (!Array.isArray(object.assetTypes)) + throw TypeError(".google.cloud.asset.v1p1beta1.SearchResourcesRequest.assetTypes: array expected"); + message.assetTypes = []; + for (var i = 0; i < object.assetTypes.length; ++i) + message.assetTypes[i] = String(object.assetTypes[i]); } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); return message; }; /** - * Creates a plain object from an Asset message. Also converts values to other types if specified. + * Creates a plain object from a SearchResourcesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1beta1.Asset + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @static - * @param {google.cloud.asset.v1beta1.Asset} message Asset + * @param {google.cloud.asset.v1p1beta1.SearchResourcesRequest} message SearchResourcesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Asset.toObject = function toObject(message, options) { + SearchResourcesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.assetTypes = []; if (options.defaults) { - object.name = ""; - object.assetType = ""; - object.resource = null; - object.iamPolicy = null; + object.scope = ""; + object.query = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = message.scope; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.assetTypes && message.assetTypes.length) { + object.assetTypes = []; + for (var j = 0; j < message.assetTypes.length; ++j) + object.assetTypes[j] = message.assetTypes[j]; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.assetType != null && message.hasOwnProperty("assetType")) - object.assetType = message.assetType; - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = $root.google.cloud.asset.v1beta1.Resource.toObject(message.resource, options); - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) - object.iamPolicy = $root.google.iam.v1.Policy.toObject(message.iamPolicy, options); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; return object; }; /** - * Converts this Asset to JSON. + * Converts this SearchResourcesRequest to JSON. * @function toJSON - * @memberof google.cloud.asset.v1beta1.Asset + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest * @instance * @returns {Object.} JSON object */ - Asset.prototype.toJSON = function toJSON() { + SearchResourcesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Asset; + return SearchResourcesRequest; })(); - v1beta1.Resource = (function() { + v1p1beta1.SearchResourcesResponse = (function() { /** - * Properties of a Resource. - * @memberof google.cloud.asset.v1beta1 - * @interface IResource - * @property {string|null} [version] Resource version - * @property {string|null} [discoveryDocumentUri] Resource discoveryDocumentUri - * @property {string|null} [discoveryName] Resource discoveryName - * @property {string|null} [resourceUrl] Resource resourceUrl - * @property {string|null} [parent] Resource parent - * @property {google.protobuf.IStruct|null} [data] Resource data + * Properties of a SearchResourcesResponse. + * @memberof google.cloud.asset.v1p1beta1 + * @interface ISearchResourcesResponse + * @property {Array.|null} [results] SearchResourcesResponse results + * @property {string|null} [nextPageToken] SearchResourcesResponse nextPageToken */ /** - * Constructs a new Resource. - * @memberof google.cloud.asset.v1beta1 - * @classdesc Represents a Resource. - * @implements IResource + * Constructs a new SearchResourcesResponse. + * @memberof google.cloud.asset.v1p1beta1 + * @classdesc Represents a SearchResourcesResponse. + * @implements ISearchResourcesResponse * @constructor - * @param {google.cloud.asset.v1beta1.IResource=} [properties] Properties to set + * @param {google.cloud.asset.v1p1beta1.ISearchResourcesResponse=} [properties] Properties to set */ - function Resource(properties) { + function SearchResourcesResponse(properties) { + this.results = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7504,140 +8856,91 @@ } /** - * Resource version. - * @member {string} version - * @memberof google.cloud.asset.v1beta1.Resource - * @instance - */ - Resource.prototype.version = ""; - - /** - * Resource discoveryDocumentUri. - * @member {string} discoveryDocumentUri - * @memberof google.cloud.asset.v1beta1.Resource - * @instance - */ - Resource.prototype.discoveryDocumentUri = ""; - - /** - * Resource discoveryName. - * @member {string} discoveryName - * @memberof google.cloud.asset.v1beta1.Resource - * @instance - */ - Resource.prototype.discoveryName = ""; - - /** - * Resource resourceUrl. - * @member {string} resourceUrl - * @memberof google.cloud.asset.v1beta1.Resource - * @instance - */ - Resource.prototype.resourceUrl = ""; - - /** - * Resource parent. - * @member {string} parent - * @memberof google.cloud.asset.v1beta1.Resource + * SearchResourcesResponse results. + * @member {Array.} results + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse * @instance */ - Resource.prototype.parent = ""; + SearchResourcesResponse.prototype.results = $util.emptyArray; /** - * Resource data. - * @member {google.protobuf.IStruct|null|undefined} data - * @memberof google.cloud.asset.v1beta1.Resource + * SearchResourcesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse * @instance */ - Resource.prototype.data = null; + SearchResourcesResponse.prototype.nextPageToken = ""; /** - * Creates a new Resource instance using the specified properties. + * Creates a new SearchResourcesResponse instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1beta1.Resource + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse * @static - * @param {google.cloud.asset.v1beta1.IResource=} [properties] Properties to set - * @returns {google.cloud.asset.v1beta1.Resource} Resource instance + * @param {google.cloud.asset.v1p1beta1.ISearchResourcesResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.SearchResourcesResponse} SearchResourcesResponse instance */ - Resource.create = function create(properties) { - return new Resource(properties); + SearchResourcesResponse.create = function create(properties) { + return new SearchResourcesResponse(properties); }; /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1beta1.Resource.verify|verify} messages. + * Encodes the specified SearchResourcesResponse message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1beta1.Resource + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse * @static - * @param {google.cloud.asset.v1beta1.IResource} message Resource message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchResourcesResponse} message SearchResourcesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Resource.encode = function encode(message, writer) { + SearchResourcesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.version != null && message.hasOwnProperty("version")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); - if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.discoveryDocumentUri); - if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.discoveryName); - if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceUrl); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); - if (message.data != null && message.hasOwnProperty("data")) - $root.google.protobuf.Struct.encode(message.data, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1beta1.Resource.verify|verify} messages. + * Encodes the specified SearchResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1beta1.Resource + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse * @static - * @param {google.cloud.asset.v1beta1.IResource} message Resource message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchResourcesResponse} message SearchResourcesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Resource.encodeDelimited = function encodeDelimited(message, writer) { + SearchResourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Resource message from the specified reader or buffer. + * Decodes a SearchResourcesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1beta1.Resource + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1beta1.Resource} Resource + * @returns {google.cloud.asset.v1p1beta1.SearchResourcesResponse} SearchResourcesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Resource.decode = function decode(reader, length) { + SearchResourcesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1beta1.Resource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p1beta1.SearchResourcesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.version = reader.string(); + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.decode(reader, reader.uint32())); break; case 2: - message.discoveryDocumentUri = reader.string(); - break; - case 3: - message.discoveryName = reader.string(); - break; - case 4: - message.resourceUrl = reader.string(); - break; - case 5: - message.parent = reader.string(); - break; - case 6: - message.data = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -7648,435 +8951,622 @@ }; /** - * Decodes a Resource message from the specified reader or buffer, length delimited. + * Decodes a SearchResourcesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1beta1.Resource + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1beta1.Resource} Resource + * @returns {google.cloud.asset.v1p1beta1.SearchResourcesResponse} SearchResourcesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Resource.decodeDelimited = function decodeDelimited(reader) { + SearchResourcesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Resource message. + * Verifies a SearchResourcesResponse message. * @function verify - * @memberof google.cloud.asset.v1beta1.Resource + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Resource.verify = function verify(message) { + SearchResourcesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) - if (!$util.isString(message.discoveryDocumentUri)) - return "discoveryDocumentUri: string expected"; - if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) - if (!$util.isString(message.discoveryName)) - return "discoveryName: string expected"; - if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) - if (!$util.isString(message.resourceUrl)) - return "resourceUrl: string expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.data != null && message.hasOwnProperty("data")) { - var error = $root.google.protobuf.Struct.verify(message.data); - if (error) - return "data." + error; + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.verify(message.results[i]); + if (error) + return "results." + error; + } } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * Creates a SearchResourcesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1beta1.Resource + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1beta1.Resource} Resource + * @returns {google.cloud.asset.v1p1beta1.SearchResourcesResponse} SearchResourcesResponse */ - Resource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1beta1.Resource) + SearchResourcesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchResourcesResponse) return object; - var message = new $root.google.cloud.asset.v1beta1.Resource(); - if (object.version != null) - message.version = String(object.version); - if (object.discoveryDocumentUri != null) - message.discoveryDocumentUri = String(object.discoveryDocumentUri); - if (object.discoveryName != null) - message.discoveryName = String(object.discoveryName); - if (object.resourceUrl != null) - message.resourceUrl = String(object.resourceUrl); - if (object.parent != null) - message.parent = String(object.parent); - if (object.data != null) { - if (typeof object.data !== "object") - throw TypeError(".google.cloud.asset.v1beta1.Resource.data: object expected"); - message.data = $root.google.protobuf.Struct.fromObject(object.data); + var message = new $root.google.cloud.asset.v1p1beta1.SearchResourcesResponse(); + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.asset.v1p1beta1.SearchResourcesResponse.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.asset.v1p1beta1.SearchResourcesResponse.results: object expected"); + message.results[i] = $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.fromObject(object.results[i]); + } } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a Resource message. Also converts values to other types if specified. + * Creates a plain object from a SearchResourcesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1beta1.Resource + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse * @static - * @param {google.cloud.asset.v1beta1.Resource} message Resource + * @param {google.cloud.asset.v1p1beta1.SearchResourcesResponse} message SearchResourcesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Resource.toObject = function toObject(message, options) { + SearchResourcesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.version = ""; - object.discoveryDocumentUri = ""; - object.discoveryName = ""; - object.resourceUrl = ""; - object.parent = ""; - object.data = null; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) - object.discoveryDocumentUri = message.discoveryDocumentUri; - if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) - object.discoveryName = message.discoveryName; - if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) - object.resourceUrl = message.resourceUrl; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.data != null && message.hasOwnProperty("data")) - object.data = $root.google.protobuf.Struct.toObject(message.data, options); + if (options.arrays || options.defaults) + object.results = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.toObject(message.results[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this Resource to JSON. + * Converts this SearchResourcesResponse to JSON. * @function toJSON - * @memberof google.cloud.asset.v1beta1.Resource + * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse * @instance * @returns {Object.} JSON object */ - Resource.prototype.toJSON = function toJSON() { + SearchResourcesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Resource; + return SearchResourcesResponse; })(); - return v1beta1; - })(); - - asset.v1p2beta1 = (function() { - - /** - * Namespace v1p2beta1. - * @memberof google.cloud.asset - * @namespace - */ - var v1p2beta1 = {}; + v1p1beta1.SearchIamPoliciesRequest = (function() { - v1p2beta1.AssetService = (function() { + /** + * Properties of a SearchIamPoliciesRequest. + * @memberof google.cloud.asset.v1p1beta1 + * @interface ISearchIamPoliciesRequest + * @property {string|null} [scope] SearchIamPoliciesRequest scope + * @property {string|null} [query] SearchIamPoliciesRequest query + * @property {number|null} [pageSize] SearchIamPoliciesRequest pageSize + * @property {string|null} [pageToken] SearchIamPoliciesRequest pageToken + */ /** - * Constructs a new AssetService service. - * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents an AssetService - * @extends $protobuf.rpc.Service + * Constructs a new SearchIamPoliciesRequest. + * @memberof google.cloud.asset.v1p1beta1 + * @classdesc Represents a SearchIamPoliciesRequest. + * @implements ISearchIamPoliciesRequest * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest=} [properties] Properties to set */ - function AssetService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + function SearchIamPoliciesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - (AssetService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AssetService; + /** + * SearchIamPoliciesRequest scope. + * @member {string} scope + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest + * @instance + */ + SearchIamPoliciesRequest.prototype.scope = ""; /** - * Creates new AssetService service using the specified rpc implementation. + * SearchIamPoliciesRequest query. + * @member {string} query + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest + * @instance + */ + SearchIamPoliciesRequest.prototype.query = ""; + + /** + * SearchIamPoliciesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest + * @instance + */ + SearchIamPoliciesRequest.prototype.pageSize = 0; + + /** + * SearchIamPoliciesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest + * @instance + */ + SearchIamPoliciesRequest.prototype.pageToken = ""; + + /** + * Creates a new SearchIamPoliciesRequest instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.AssetService + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest * @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 {AssetService} RPC service. Useful where requests and/or responses are streamed. + * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest} SearchIamPoliciesRequest instance */ - AssetService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); + SearchIamPoliciesRequest.create = function create(properties) { + return new SearchIamPoliciesRequest(properties); }; /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#exportAssets}. - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @typedef ExportAssetsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Encodes the specified SearchIamPoliciesRequest message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest + * @static + * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest} message SearchIamPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + SearchIamPoliciesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.query != null && message.hasOwnProperty("query")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.query); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.scope != null && message.hasOwnProperty("scope")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.scope); + return writer; + }; /** - * Calls ExportAssets. - * @function exportAssets - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p2beta1.IExportAssetsRequest} request ExportAssetsRequest message or plain object - * @param {google.cloud.asset.v1p2beta1.AssetService.ExportAssetsCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Encodes the specified SearchIamPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest + * @static + * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest} message SearchIamPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(AssetService.prototype.exportAssets = function exportAssets(request, callback) { - return this.rpcCall(exportAssets, $root.google.cloud.asset.v1p2beta1.ExportAssetsRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ExportAssets" }); + SearchIamPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls ExportAssets. - * @function exportAssets - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p2beta1.IExportAssetsRequest} request ExportAssetsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes a SearchIamPoliciesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest} SearchIamPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + SearchIamPoliciesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: + message.scope = reader.string(); + break; + case 1: + message.query = 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; + }; /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#batchGetAssetsHistory}. - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @typedef BatchGetAssetsHistoryCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse} [response] BatchGetAssetsHistoryResponse + * Decodes a SearchIamPoliciesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest} SearchIamPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + SearchIamPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls BatchGetAssetsHistory. - * @function batchGetAssetsHistory - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryRequest} request BatchGetAssetsHistoryRequest message or plain object - * @param {google.cloud.asset.v1p2beta1.AssetService.BatchGetAssetsHistoryCallback} callback Node-style callback called with the error, if any, and BatchGetAssetsHistoryResponse - * @returns {undefined} - * @variation 1 + * Verifies a SearchIamPoliciesRequest message. + * @function verify + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(AssetService.prototype.batchGetAssetsHistory = function batchGetAssetsHistory(request, callback) { - return this.rpcCall(batchGetAssetsHistory, $root.google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest, $root.google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse, request, callback); - }, "name", { value: "BatchGetAssetsHistory" }); + SearchIamPoliciesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scope != null && message.hasOwnProperty("scope")) + if (!$util.isString(message.scope)) + return "scope: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: 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; + }; /** - * Calls BatchGetAssetsHistory. - * @function batchGetAssetsHistory - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryRequest} request BatchGetAssetsHistoryRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a SearchIamPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest} SearchIamPoliciesRequest */ + SearchIamPoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest) + return object; + var message = new $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest(); + if (object.scope != null) + message.scope = String(object.scope); + if (object.query != null) + message.query = String(object.query); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#createFeed}. - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @typedef CreateFeedCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.asset.v1p2beta1.Feed} [response] Feed + * Creates a plain object from a SearchIamPoliciesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest + * @static + * @param {google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest} message SearchIamPoliciesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + SearchIamPoliciesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.query = ""; + object.pageSize = 0; + object.pageToken = ""; + object.scope = ""; + } + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = message.scope; + return object; + }; /** - * Calls CreateFeed. - * @function createFeed - * @memberof google.cloud.asset.v1p2beta1.AssetService + * Converts this SearchIamPoliciesRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest * @instance - * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest} request CreateFeedRequest message or plain object - * @param {google.cloud.asset.v1p2beta1.AssetService.CreateFeedCallback} callback Node-style callback called with the error, if any, and Feed - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(AssetService.prototype.createFeed = function createFeed(request, callback) { - return this.rpcCall(createFeed, $root.google.cloud.asset.v1p2beta1.CreateFeedRequest, $root.google.cloud.asset.v1p2beta1.Feed, request, callback); - }, "name", { value: "CreateFeed" }); + SearchIamPoliciesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SearchIamPoliciesRequest; + })(); + + v1p1beta1.SearchIamPoliciesResponse = (function() { /** - * Calls CreateFeed. - * @function createFeed - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest} request CreateFeedRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Properties of a SearchIamPoliciesResponse. + * @memberof google.cloud.asset.v1p1beta1 + * @interface ISearchIamPoliciesResponse + * @property {Array.|null} [results] SearchIamPoliciesResponse results + * @property {string|null} [nextPageToken] SearchIamPoliciesResponse nextPageToken */ /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#getFeed}. - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @typedef GetFeedCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.asset.v1p2beta1.Feed} [response] Feed + * Constructs a new SearchIamPoliciesResponse. + * @memberof google.cloud.asset.v1p1beta1 + * @classdesc Represents a SearchIamPoliciesResponse. + * @implements ISearchIamPoliciesResponse + * @constructor + * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse=} [properties] Properties to set */ + function SearchIamPoliciesResponse(properties) { + this.results = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls GetFeed. - * @function getFeed - * @memberof google.cloud.asset.v1p2beta1.AssetService + * SearchIamPoliciesResponse results. + * @member {Array.} results + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse * @instance - * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest} request GetFeedRequest message or plain object - * @param {google.cloud.asset.v1p2beta1.AssetService.GetFeedCallback} callback Node-style callback called with the error, if any, and Feed - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AssetService.prototype.getFeed = function getFeed(request, callback) { - return this.rpcCall(getFeed, $root.google.cloud.asset.v1p2beta1.GetFeedRequest, $root.google.cloud.asset.v1p2beta1.Feed, request, callback); - }, "name", { value: "GetFeed" }); + SearchIamPoliciesResponse.prototype.results = $util.emptyArray; /** - * Calls GetFeed. - * @function getFeed - * @memberof google.cloud.asset.v1p2beta1.AssetService + * SearchIamPoliciesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse * @instance - * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest} request GetFeedRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + SearchIamPoliciesResponse.prototype.nextPageToken = ""; /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#listFeeds}. - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @typedef ListFeedsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.asset.v1p2beta1.ListFeedsResponse} [response] ListFeedsResponse + * Creates a new SearchIamPoliciesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse + * @static + * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse} SearchIamPoliciesResponse instance */ + SearchIamPoliciesResponse.create = function create(properties) { + return new SearchIamPoliciesResponse(properties); + }; /** - * Calls ListFeeds. - * @function listFeeds - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest} request ListFeedsRequest message or plain object - * @param {google.cloud.asset.v1p2beta1.AssetService.ListFeedsCallback} callback Node-style callback called with the error, if any, and ListFeedsResponse - * @returns {undefined} - * @variation 1 + * Encodes the specified SearchIamPoliciesResponse message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse + * @static + * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse} message SearchIamPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(AssetService.prototype.listFeeds = function listFeeds(request, callback) { - return this.rpcCall(listFeeds, $root.google.cloud.asset.v1p2beta1.ListFeedsRequest, $root.google.cloud.asset.v1p2beta1.ListFeedsResponse, request, callback); - }, "name", { value: "ListFeeds" }); + SearchIamPoliciesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; /** - * Calls ListFeeds. - * @function listFeeds - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest} request ListFeedsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified SearchIamPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse + * @static + * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse} message SearchIamPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + SearchIamPoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#updateFeed}. - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @typedef UpdateFeedCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.asset.v1p2beta1.Feed} [response] Feed + * Decodes a SearchIamPoliciesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse} SearchIamPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + SearchIamPoliciesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls UpdateFeed. - * @function updateFeed - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest} request UpdateFeedRequest message or plain object - * @param {google.cloud.asset.v1p2beta1.AssetService.UpdateFeedCallback} callback Node-style callback called with the error, if any, and Feed - * @returns {undefined} - * @variation 1 + * Decodes a SearchIamPoliciesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse} SearchIamPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(AssetService.prototype.updateFeed = function updateFeed(request, callback) { - return this.rpcCall(updateFeed, $root.google.cloud.asset.v1p2beta1.UpdateFeedRequest, $root.google.cloud.asset.v1p2beta1.Feed, request, callback); - }, "name", { value: "UpdateFeed" }); + SearchIamPoliciesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls UpdateFeed. - * @function updateFeed - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest} request UpdateFeedRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies a SearchIamPoliciesResponse message. + * @function verify + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + SearchIamPoliciesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.verify(message.results[i]); + if (error) + return "results." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; /** - * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#deleteFeed}. - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @typedef DeleteFeedCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty + * Creates a SearchIamPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse} SearchIamPoliciesResponse */ + SearchIamPoliciesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse) + return object; + var message = new $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse(); + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse.results: object expected"); + message.results[i] = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.fromObject(object.results[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; /** - * Calls DeleteFeed. - * @function deleteFeed - * @memberof google.cloud.asset.v1p2beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest} request DeleteFeedRequest message or plain object - * @param {google.cloud.asset.v1p2beta1.AssetService.DeleteFeedCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 + * Creates a plain object from a SearchIamPoliciesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse + * @static + * @param {google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse} message SearchIamPoliciesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(AssetService.prototype.deleteFeed = function deleteFeed(request, callback) { - return this.rpcCall(deleteFeed, $root.google.cloud.asset.v1p2beta1.DeleteFeedRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteFeed" }); + SearchIamPoliciesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.results = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.toObject(message.results[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; /** - * Calls DeleteFeed. - * @function deleteFeed - * @memberof google.cloud.asset.v1p2beta1.AssetService + * Converts this SearchIamPoliciesResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse * @instance - * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest} request DeleteFeedRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + SearchIamPoliciesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return AssetService; + return SearchIamPoliciesResponse; })(); - v1p2beta1.ExportAssetsRequest = (function() { + v1p1beta1.SearchAllResourcesRequest = (function() { /** - * Properties of an ExportAssetsRequest. - * @memberof google.cloud.asset.v1p2beta1 - * @interface IExportAssetsRequest - * @property {string|null} [parent] ExportAssetsRequest parent - * @property {google.protobuf.ITimestamp|null} [readTime] ExportAssetsRequest readTime - * @property {Array.|null} [assetTypes] ExportAssetsRequest assetTypes - * @property {google.cloud.asset.v1p2beta1.ContentType|null} [contentType] ExportAssetsRequest contentType - * @property {google.cloud.asset.v1p2beta1.IOutputConfig|null} [outputConfig] ExportAssetsRequest outputConfig + * Properties of a SearchAllResourcesRequest. + * @memberof google.cloud.asset.v1p1beta1 + * @interface ISearchAllResourcesRequest + * @property {string|null} [scope] SearchAllResourcesRequest scope + * @property {string|null} [query] SearchAllResourcesRequest query + * @property {Array.|null} [assetTypes] SearchAllResourcesRequest assetTypes + * @property {number|null} [pageSize] SearchAllResourcesRequest pageSize + * @property {string|null} [pageToken] SearchAllResourcesRequest pageToken */ /** - * Constructs a new ExportAssetsRequest. - * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents an ExportAssetsRequest. - * @implements IExportAssetsRequest + * Constructs a new SearchAllResourcesRequest. + * @memberof google.cloud.asset.v1p1beta1 + * @classdesc Represents a SearchAllResourcesRequest. + * @implements ISearchAllResourcesRequest * @constructor - * @param {google.cloud.asset.v1p2beta1.IExportAssetsRequest=} [properties] Properties to set + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest=} [properties] Properties to set */ - function ExportAssetsRequest(properties) { + function SearchAllResourcesRequest(properties) { this.assetTypes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) @@ -8085,119 +9575,119 @@ } /** - * ExportAssetsRequest parent. - * @member {string} parent - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * SearchAllResourcesRequest scope. + * @member {string} scope + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @instance */ - ExportAssetsRequest.prototype.parent = ""; + SearchAllResourcesRequest.prototype.scope = ""; /** - * ExportAssetsRequest readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * SearchAllResourcesRequest query. + * @member {string} query + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @instance */ - ExportAssetsRequest.prototype.readTime = null; + SearchAllResourcesRequest.prototype.query = ""; /** - * ExportAssetsRequest assetTypes. + * SearchAllResourcesRequest assetTypes. * @member {Array.} assetTypes - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @instance */ - ExportAssetsRequest.prototype.assetTypes = $util.emptyArray; + SearchAllResourcesRequest.prototype.assetTypes = $util.emptyArray; /** - * ExportAssetsRequest contentType. - * @member {google.cloud.asset.v1p2beta1.ContentType} contentType - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * SearchAllResourcesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @instance */ - ExportAssetsRequest.prototype.contentType = 0; + SearchAllResourcesRequest.prototype.pageSize = 0; /** - * ExportAssetsRequest outputConfig. - * @member {google.cloud.asset.v1p2beta1.IOutputConfig|null|undefined} outputConfig - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * SearchAllResourcesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @instance */ - ExportAssetsRequest.prototype.outputConfig = null; + SearchAllResourcesRequest.prototype.pageToken = ""; /** - * Creates a new ExportAssetsRequest instance using the specified properties. + * Creates a new SearchAllResourcesRequest instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @static - * @param {google.cloud.asset.v1p2beta1.IExportAssetsRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.ExportAssetsRequest} ExportAssetsRequest instance + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesRequest} SearchAllResourcesRequest instance */ - ExportAssetsRequest.create = function create(properties) { - return new ExportAssetsRequest(properties); + SearchAllResourcesRequest.create = function create(properties) { + return new SearchAllResourcesRequest(properties); }; /** - * Encodes the specified ExportAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ExportAssetsRequest.verify|verify} messages. + * Encodes the specified SearchAllResourcesRequest message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllResourcesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @static - * @param {google.cloud.asset.v1p2beta1.IExportAssetsRequest} message ExportAssetsRequest message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest} message SearchAllResourcesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportAssetsRequest.encode = function encode(message, writer) { + SearchAllResourcesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.readTime != null && message.hasOwnProperty("readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.scope != null && message.hasOwnProperty("scope")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.scope); + if (message.query != null && message.hasOwnProperty("query")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); if (message.assetTypes != null && message.assetTypes.length) for (var i = 0; i < message.assetTypes.length; ++i) writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); - if (message.contentType != null && message.hasOwnProperty("contentType")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.contentType); - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) - $root.google.cloud.asset.v1p2beta1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); return writer; }; /** - * Encodes the specified ExportAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ExportAssetsRequest.verify|verify} messages. + * Encodes the specified SearchAllResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllResourcesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @static - * @param {google.cloud.asset.v1p2beta1.IExportAssetsRequest} message ExportAssetsRequest message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest} message SearchAllResourcesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + SearchAllResourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExportAssetsRequest message from the specified reader or buffer. + * Decodes a SearchAllResourcesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.ExportAssetsRequest} ExportAssetsRequest + * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesRequest} SearchAllResourcesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportAssetsRequest.decode = function decode(reader, length) { + SearchAllResourcesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.ExportAssetsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.scope = reader.string(); break; case 2: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.query = reader.string(); break; case 3: if (!(message.assetTypes && message.assetTypes.length)) @@ -8205,10 +9695,10 @@ message.assetTypes.push(reader.string()); break; case 4: - message.contentType = reader.int32(); + message.pageSize = reader.int32(); break; case 5: - message.outputConfig = $root.google.cloud.asset.v1p2beta1.OutputConfig.decode(reader, reader.uint32()); + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -8219,40 +9709,38 @@ }; /** - * Decodes an ExportAssetsRequest message from the specified reader or buffer, length delimited. + * Decodes a SearchAllResourcesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.ExportAssetsRequest} ExportAssetsRequest + * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesRequest} SearchAllResourcesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + SearchAllResourcesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExportAssetsRequest message. + * Verifies a SearchAllResourcesRequest message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExportAssetsRequest.verify = function verify(message) { + SearchAllResourcesRequest.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.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } + if (message.scope != null && message.hasOwnProperty("scope")) + if (!$util.isString(message.scope)) + return "scope: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { if (!Array.isArray(message.assetTypes)) return "assetTypes: array expected"; @@ -8260,156 +9748,116 @@ if (!$util.isString(message.assetTypes[i])) return "assetTypes: string[] expected"; } - if (message.contentType != null && message.hasOwnProperty("contentType")) - switch (message.contentType) { - default: - return "contentType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { - var error = $root.google.cloud.asset.v1p2beta1.OutputConfig.verify(message.outputConfig); - if (error) - return "outputConfig." + error; - } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; return null; }; /** - * Creates an ExportAssetsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SearchAllResourcesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.ExportAssetsRequest} ExportAssetsRequest + * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesRequest} SearchAllResourcesRequest */ - ExportAssetsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.ExportAssetsRequest) + SearchAllResourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest) return object; - var message = new $root.google.cloud.asset.v1p2beta1.ExportAssetsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.ExportAssetsRequest.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } + var message = new $root.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest(); + if (object.scope != null) + message.scope = String(object.scope); + if (object.query != null) + message.query = String(object.query); if (object.assetTypes) { if (!Array.isArray(object.assetTypes)) - throw TypeError(".google.cloud.asset.v1p2beta1.ExportAssetsRequest.assetTypes: array expected"); + throw TypeError(".google.cloud.asset.v1p1beta1.SearchAllResourcesRequest.assetTypes: array expected"); message.assetTypes = []; for (var i = 0; i < object.assetTypes.length; ++i) message.assetTypes[i] = String(object.assetTypes[i]); } - switch (object.contentType) { - case "CONTENT_TYPE_UNSPECIFIED": - case 0: - message.contentType = 0; - break; - case "RESOURCE": - case 1: - message.contentType = 1; - break; - case "IAM_POLICY": - case 2: - message.contentType = 2; - break; - case "IAM_POLICY_NAME": - case 3: - message.contentType = 3; - break; - case "ORG_POLICY": - case 4: - message.contentType = 4; - break; - case "ACCESS_POLICY": - case 5: - message.contentType = 5; - break; - } - if (object.outputConfig != null) { - if (typeof object.outputConfig !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.ExportAssetsRequest.outputConfig: object expected"); - message.outputConfig = $root.google.cloud.asset.v1p2beta1.OutputConfig.fromObject(object.outputConfig); - } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); return message; }; /** - * Creates a plain object from an ExportAssetsRequest message. Also converts values to other types if specified. + * Creates a plain object from a SearchAllResourcesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @static - * @param {google.cloud.asset.v1p2beta1.ExportAssetsRequest} message ExportAssetsRequest + * @param {google.cloud.asset.v1p1beta1.SearchAllResourcesRequest} message SearchAllResourcesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExportAssetsRequest.toObject = function toObject(message, options) { + SearchAllResourcesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.assetTypes = []; if (options.defaults) { - object.parent = ""; - object.readTime = null; - object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; - object.outputConfig = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + object.scope = ""; + object.query = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = message.scope; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; if (message.assetTypes && message.assetTypes.length) { object.assetTypes = []; for (var j = 0; j < message.assetTypes.length; ++j) object.assetTypes[j] = message.assetTypes[j]; } - if (message.contentType != null && message.hasOwnProperty("contentType")) - object.contentType = options.enums === String ? $root.google.cloud.asset.v1p2beta1.ContentType[message.contentType] : message.contentType; - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) - object.outputConfig = $root.google.cloud.asset.v1p2beta1.OutputConfig.toObject(message.outputConfig, options); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; return object; }; /** - * Converts this ExportAssetsRequest to JSON. + * Converts this SearchAllResourcesRequest to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest * @instance * @returns {Object.} JSON object */ - ExportAssetsRequest.prototype.toJSON = function toJSON() { + SearchAllResourcesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ExportAssetsRequest; + return SearchAllResourcesRequest; })(); - v1p2beta1.ExportAssetsResponse = (function() { + v1p1beta1.SearchAllResourcesResponse = (function() { /** - * Properties of an ExportAssetsResponse. - * @memberof google.cloud.asset.v1p2beta1 - * @interface IExportAssetsResponse - * @property {google.protobuf.ITimestamp|null} [readTime] ExportAssetsResponse readTime - * @property {google.cloud.asset.v1p2beta1.IOutputConfig|null} [outputConfig] ExportAssetsResponse outputConfig + * Properties of a SearchAllResourcesResponse. + * @memberof google.cloud.asset.v1p1beta1 + * @interface ISearchAllResourcesResponse + * @property {Array.|null} [results] SearchAllResourcesResponse results + * @property {string|null} [nextPageToken] SearchAllResourcesResponse nextPageToken */ /** - * Constructs a new ExportAssetsResponse. - * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents an ExportAssetsResponse. - * @implements IExportAssetsResponse + * Constructs a new SearchAllResourcesResponse. + * @memberof google.cloud.asset.v1p1beta1 + * @classdesc Represents a SearchAllResourcesResponse. + * @implements ISearchAllResourcesResponse * @constructor - * @param {google.cloud.asset.v1p2beta1.IExportAssetsResponse=} [properties] Properties to set + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse=} [properties] Properties to set */ - function ExportAssetsResponse(properties) { + function SearchAllResourcesResponse(properties) { + this.results = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8417,88 +9865,91 @@ } /** - * ExportAssetsResponse readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * SearchAllResourcesResponse results. + * @member {Array.} results + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse * @instance */ - ExportAssetsResponse.prototype.readTime = null; + SearchAllResourcesResponse.prototype.results = $util.emptyArray; /** - * ExportAssetsResponse outputConfig. - * @member {google.cloud.asset.v1p2beta1.IOutputConfig|null|undefined} outputConfig - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * SearchAllResourcesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse * @instance */ - ExportAssetsResponse.prototype.outputConfig = null; + SearchAllResourcesResponse.prototype.nextPageToken = ""; /** - * Creates a new ExportAssetsResponse instance using the specified properties. + * Creates a new SearchAllResourcesResponse instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse * @static - * @param {google.cloud.asset.v1p2beta1.IExportAssetsResponse=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.ExportAssetsResponse} ExportAssetsResponse instance + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesResponse} SearchAllResourcesResponse instance */ - ExportAssetsResponse.create = function create(properties) { - return new ExportAssetsResponse(properties); + SearchAllResourcesResponse.create = function create(properties) { + return new SearchAllResourcesResponse(properties); }; /** - * Encodes the specified ExportAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ExportAssetsResponse.verify|verify} messages. + * Encodes the specified SearchAllResourcesResponse message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllResourcesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse * @static - * @param {google.cloud.asset.v1p2beta1.IExportAssetsResponse} message ExportAssetsResponse message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse} message SearchAllResourcesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportAssetsResponse.encode = function encode(message, writer) { + SearchAllResourcesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.readTime != null && message.hasOwnProperty("readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) - $root.google.cloud.asset.v1p2beta1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified ExportAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ExportAssetsResponse.verify|verify} messages. + * Encodes the specified SearchAllResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllResourcesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse * @static - * @param {google.cloud.asset.v1p2beta1.IExportAssetsResponse} message ExportAssetsResponse message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse} message SearchAllResourcesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + SearchAllResourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExportAssetsResponse message from the specified reader or buffer. + * Decodes a SearchAllResourcesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.ExportAssetsResponse} ExportAssetsResponse + * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesResponse} SearchAllResourcesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportAssetsResponse.decode = function decode(reader, length) { + SearchAllResourcesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.ExportAssetsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p1beta1.SearchAllResourcesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.decode(reader, reader.uint32())); break; case 2: - message.outputConfig = $root.google.cloud.asset.v1p2beta1.OutputConfig.decode(reader, reader.uint32()); + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -8509,130 +9960,136 @@ }; /** - * Decodes an ExportAssetsResponse message from the specified reader or buffer, length delimited. + * Decodes a SearchAllResourcesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.ExportAssetsResponse} ExportAssetsResponse + * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesResponse} SearchAllResourcesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + SearchAllResourcesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExportAssetsResponse message. + * Verifies a SearchAllResourcesResponse message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExportAssetsResponse.verify = function verify(message) { + SearchAllResourcesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { - var error = $root.google.cloud.asset.v1p2beta1.OutputConfig.verify(message.outputConfig); - if (error) - return "outputConfig." + error; + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.verify(message.results[i]); + if (error) + return "results." + error; + } } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates an ExportAssetsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SearchAllResourcesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.ExportAssetsResponse} ExportAssetsResponse + * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesResponse} SearchAllResourcesResponse */ - ExportAssetsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.ExportAssetsResponse) + SearchAllResourcesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchAllResourcesResponse) return object; - var message = new $root.google.cloud.asset.v1p2beta1.ExportAssetsResponse(); - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.ExportAssetsResponse.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } - if (object.outputConfig != null) { - if (typeof object.outputConfig !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.ExportAssetsResponse.outputConfig: object expected"); - message.outputConfig = $root.google.cloud.asset.v1p2beta1.OutputConfig.fromObject(object.outputConfig); + var message = new $root.google.cloud.asset.v1p1beta1.SearchAllResourcesResponse(); + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.asset.v1p1beta1.SearchAllResourcesResponse.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.asset.v1p1beta1.SearchAllResourcesResponse.results: object expected"); + message.results[i] = $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.fromObject(object.results[i]); + } } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from an ExportAssetsResponse message. Also converts values to other types if specified. + * Creates a plain object from a SearchAllResourcesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse * @static - * @param {google.cloud.asset.v1p2beta1.ExportAssetsResponse} message ExportAssetsResponse + * @param {google.cloud.asset.v1p1beta1.SearchAllResourcesResponse} message SearchAllResourcesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExportAssetsResponse.toObject = function toObject(message, options) { + SearchAllResourcesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.readTime = null; - object.outputConfig = null; - } - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) - object.outputConfig = $root.google.cloud.asset.v1p2beta1.OutputConfig.toObject(message.outputConfig, options); + if (options.arrays || options.defaults) + object.results = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.toObject(message.results[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this ExportAssetsResponse to JSON. + * Converts this SearchAllResourcesResponse to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse * @instance * @returns {Object.} JSON object */ - ExportAssetsResponse.prototype.toJSON = function toJSON() { + SearchAllResourcesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ExportAssetsResponse; + return SearchAllResourcesResponse; })(); - v1p2beta1.BatchGetAssetsHistoryRequest = (function() { + v1p1beta1.SearchAllIamPoliciesRequest = (function() { /** - * Properties of a BatchGetAssetsHistoryRequest. - * @memberof google.cloud.asset.v1p2beta1 - * @interface IBatchGetAssetsHistoryRequest - * @property {string|null} [parent] BatchGetAssetsHistoryRequest parent - * @property {Array.|null} [assetNames] BatchGetAssetsHistoryRequest assetNames - * @property {google.cloud.asset.v1p2beta1.ContentType|null} [contentType] BatchGetAssetsHistoryRequest contentType - * @property {google.cloud.asset.v1p2beta1.ITimeWindow|null} [readTimeWindow] BatchGetAssetsHistoryRequest readTimeWindow + * Properties of a SearchAllIamPoliciesRequest. + * @memberof google.cloud.asset.v1p1beta1 + * @interface ISearchAllIamPoliciesRequest + * @property {string|null} [scope] SearchAllIamPoliciesRequest scope + * @property {string|null} [query] SearchAllIamPoliciesRequest query + * @property {number|null} [pageSize] SearchAllIamPoliciesRequest pageSize + * @property {string|null} [pageToken] SearchAllIamPoliciesRequest pageToken */ /** - * Constructs a new BatchGetAssetsHistoryRequest. - * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a BatchGetAssetsHistoryRequest. - * @implements IBatchGetAssetsHistoryRequest + * Constructs a new SearchAllIamPoliciesRequest. + * @memberof google.cloud.asset.v1p1beta1 + * @classdesc Represents a SearchAllIamPoliciesRequest. + * @implements ISearchAllIamPoliciesRequest * @constructor - * @param {google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryRequest=} [properties] Properties to set + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest=} [properties] Properties to set */ - function BatchGetAssetsHistoryRequest(properties) { - this.assetNames = []; + function SearchAllIamPoliciesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8640,117 +10097,114 @@ } /** - * BatchGetAssetsHistoryRequest parent. - * @member {string} parent - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest + * SearchAllIamPoliciesRequest scope. + * @member {string} scope + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest * @instance */ - BatchGetAssetsHistoryRequest.prototype.parent = ""; + SearchAllIamPoliciesRequest.prototype.scope = ""; /** - * BatchGetAssetsHistoryRequest assetNames. - * @member {Array.} assetNames - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest + * SearchAllIamPoliciesRequest query. + * @member {string} query + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest * @instance */ - BatchGetAssetsHistoryRequest.prototype.assetNames = $util.emptyArray; + SearchAllIamPoliciesRequest.prototype.query = ""; /** - * BatchGetAssetsHistoryRequest contentType. - * @member {google.cloud.asset.v1p2beta1.ContentType} contentType - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest + * SearchAllIamPoliciesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest * @instance */ - BatchGetAssetsHistoryRequest.prototype.contentType = 0; + SearchAllIamPoliciesRequest.prototype.pageSize = 0; /** - * BatchGetAssetsHistoryRequest readTimeWindow. - * @member {google.cloud.asset.v1p2beta1.ITimeWindow|null|undefined} readTimeWindow - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest + * SearchAllIamPoliciesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest * @instance */ - BatchGetAssetsHistoryRequest.prototype.readTimeWindow = null; + SearchAllIamPoliciesRequest.prototype.pageToken = ""; /** - * Creates a new BatchGetAssetsHistoryRequest instance using the specified properties. + * Creates a new SearchAllIamPoliciesRequest instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest * @static - * @param {google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest instance + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest} SearchAllIamPoliciesRequest instance */ - BatchGetAssetsHistoryRequest.create = function create(properties) { - return new BatchGetAssetsHistoryRequest(properties); + SearchAllIamPoliciesRequest.create = function create(properties) { + return new SearchAllIamPoliciesRequest(properties); }; /** - * Encodes the specified BatchGetAssetsHistoryRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest.verify|verify} messages. + * Encodes the specified SearchAllIamPoliciesRequest message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest * @static - * @param {google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryRequest} message BatchGetAssetsHistoryRequest message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest} message SearchAllIamPoliciesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchGetAssetsHistoryRequest.encode = function encode(message, writer) { + SearchAllIamPoliciesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.assetNames != null && message.assetNames.length) - for (var i = 0; i < message.assetNames.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetNames[i]); - if (message.contentType != null && message.hasOwnProperty("contentType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.contentType); - if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) - $root.google.cloud.asset.v1p2beta1.TimeWindow.encode(message.readTimeWindow, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.scope != null && message.hasOwnProperty("scope")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.scope); + if (message.query != null && message.hasOwnProperty("query")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); return writer; }; /** - * Encodes the specified BatchGetAssetsHistoryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest.verify|verify} messages. + * Encodes the specified SearchAllIamPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest * @static - * @param {google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryRequest} message BatchGetAssetsHistoryRequest message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest} message SearchAllIamPoliciesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchGetAssetsHistoryRequest.encodeDelimited = function encodeDelimited(message, writer) { + SearchAllIamPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer. + * Decodes a SearchAllIamPoliciesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest + * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest} SearchAllIamPoliciesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchGetAssetsHistoryRequest.decode = function decode(reader, length) { + SearchAllIamPoliciesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.scope = reader.string(); break; case 2: - if (!(message.assetNames && message.assetNames.length)) - message.assetNames = []; - message.assetNames.push(reader.string()); + message.query = reader.string(); break; case 3: - message.contentType = reader.int32(); + message.pageSize = reader.int32(); break; case 4: - message.readTimeWindow = $root.google.cloud.asset.v1p2beta1.TimeWindow.decode(reader, reader.uint32()); + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -8761,184 +10215,134 @@ }; /** - * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer, length delimited. + * Decodes a SearchAllIamPoliciesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest + * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest} SearchAllIamPoliciesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchGetAssetsHistoryRequest.decodeDelimited = function decodeDelimited(reader) { + SearchAllIamPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchGetAssetsHistoryRequest message. + * Verifies a SearchAllIamPoliciesRequest message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchGetAssetsHistoryRequest.verify = function verify(message) { + SearchAllIamPoliciesRequest.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.assetNames != null && message.hasOwnProperty("assetNames")) { - if (!Array.isArray(message.assetNames)) - return "assetNames: array expected"; - for (var i = 0; i < message.assetNames.length; ++i) - if (!$util.isString(message.assetNames[i])) - return "assetNames: string[] expected"; - } - if (message.contentType != null && message.hasOwnProperty("contentType")) - switch (message.contentType) { - default: - return "contentType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) { - var error = $root.google.cloud.asset.v1p2beta1.TimeWindow.verify(message.readTimeWindow); - if (error) - return "readTimeWindow." + error; - } + if (message.scope != null && message.hasOwnProperty("scope")) + if (!$util.isString(message.scope)) + return "scope: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: 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 BatchGetAssetsHistoryRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SearchAllIamPoliciesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest + * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest} SearchAllIamPoliciesRequest */ - BatchGetAssetsHistoryRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest) + SearchAllIamPoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest) return object; - var message = new $root.google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.assetNames) { - if (!Array.isArray(object.assetNames)) - throw TypeError(".google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest.assetNames: array expected"); - message.assetNames = []; - for (var i = 0; i < object.assetNames.length; ++i) - message.assetNames[i] = String(object.assetNames[i]); - } - switch (object.contentType) { - case "CONTENT_TYPE_UNSPECIFIED": - case 0: - message.contentType = 0; - break; - case "RESOURCE": - case 1: - message.contentType = 1; - break; - case "IAM_POLICY": - case 2: - message.contentType = 2; - break; - case "IAM_POLICY_NAME": - case 3: - message.contentType = 3; - break; - case "ORG_POLICY": - case 4: - message.contentType = 4; - break; - case "ACCESS_POLICY": - case 5: - message.contentType = 5; - break; - } - if (object.readTimeWindow != null) { - if (typeof object.readTimeWindow !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest.readTimeWindow: object expected"); - message.readTimeWindow = $root.google.cloud.asset.v1p2beta1.TimeWindow.fromObject(object.readTimeWindow); - } + var message = new $root.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest(); + if (object.scope != null) + message.scope = String(object.scope); + if (object.query != null) + message.query = String(object.query); + 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 BatchGetAssetsHistoryRequest message. Also converts values to other types if specified. + * Creates a plain object from a SearchAllIamPoliciesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest * @static - * @param {google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest} message BatchGetAssetsHistoryRequest + * @param {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest} message SearchAllIamPoliciesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchGetAssetsHistoryRequest.toObject = function toObject(message, options) { + SearchAllIamPoliciesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.assetNames = []; if (options.defaults) { - object.parent = ""; - object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; - object.readTimeWindow = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.assetNames && message.assetNames.length) { - object.assetNames = []; - for (var j = 0; j < message.assetNames.length; ++j) - object.assetNames[j] = message.assetNames[j]; - } - if (message.contentType != null && message.hasOwnProperty("contentType")) - object.contentType = options.enums === String ? $root.google.cloud.asset.v1p2beta1.ContentType[message.contentType] : message.contentType; - if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) - object.readTimeWindow = $root.google.cloud.asset.v1p2beta1.TimeWindow.toObject(message.readTimeWindow, options); + object.scope = ""; + object.query = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = message.scope; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + 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 BatchGetAssetsHistoryRequest to JSON. + * Converts this SearchAllIamPoliciesRequest to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest * @instance * @returns {Object.} JSON object */ - BatchGetAssetsHistoryRequest.prototype.toJSON = function toJSON() { + SearchAllIamPoliciesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return BatchGetAssetsHistoryRequest; + return SearchAllIamPoliciesRequest; })(); - v1p2beta1.BatchGetAssetsHistoryResponse = (function() { + v1p1beta1.SearchAllIamPoliciesResponse = (function() { /** - * Properties of a BatchGetAssetsHistoryResponse. - * @memberof google.cloud.asset.v1p2beta1 - * @interface IBatchGetAssetsHistoryResponse - * @property {Array.|null} [assets] BatchGetAssetsHistoryResponse assets + * Properties of a SearchAllIamPoliciesResponse. + * @memberof google.cloud.asset.v1p1beta1 + * @interface ISearchAllIamPoliciesResponse + * @property {Array.|null} [results] SearchAllIamPoliciesResponse results + * @property {string|null} [nextPageToken] SearchAllIamPoliciesResponse nextPageToken */ /** - * Constructs a new BatchGetAssetsHistoryResponse. - * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a BatchGetAssetsHistoryResponse. - * @implements IBatchGetAssetsHistoryResponse + * Constructs a new SearchAllIamPoliciesResponse. + * @memberof google.cloud.asset.v1p1beta1 + * @classdesc Represents a SearchAllIamPoliciesResponse. + * @implements ISearchAllIamPoliciesResponse * @constructor - * @param {google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryResponse=} [properties] Properties to set + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse=} [properties] Properties to set */ - function BatchGetAssetsHistoryResponse(properties) { - this.assets = []; + function SearchAllIamPoliciesResponse(properties) { + this.results = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8946,78 +10350,91 @@ } /** - * BatchGetAssetsHistoryResponse assets. - * @member {Array.} assets - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * SearchAllIamPoliciesResponse results. + * @member {Array.} results + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse * @instance */ - BatchGetAssetsHistoryResponse.prototype.assets = $util.emptyArray; + SearchAllIamPoliciesResponse.prototype.results = $util.emptyArray; /** - * Creates a new BatchGetAssetsHistoryResponse instance using the specified properties. + * SearchAllIamPoliciesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse + * @instance + */ + SearchAllIamPoliciesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new SearchAllIamPoliciesResponse instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse * @static - * @param {google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryResponse=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse instance + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse} SearchAllIamPoliciesResponse instance */ - BatchGetAssetsHistoryResponse.create = function create(properties) { - return new BatchGetAssetsHistoryResponse(properties); + SearchAllIamPoliciesResponse.create = function create(properties) { + return new SearchAllIamPoliciesResponse(properties); }; /** - * Encodes the specified BatchGetAssetsHistoryResponse message. Does not implicitly {@link google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * Encodes the specified SearchAllIamPoliciesResponse message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse * @static - * @param {google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryResponse} message BatchGetAssetsHistoryResponse message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse} message SearchAllIamPoliciesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchGetAssetsHistoryResponse.encode = function encode(message, writer) { + SearchAllIamPoliciesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.assets != null && message.assets.length) - for (var i = 0; i < message.assets.length; ++i) - $root.google.cloud.asset.v1p2beta1.TemporalAsset.encode(message.assets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified BatchGetAssetsHistoryResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * Encodes the specified SearchAllIamPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse * @static - * @param {google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryResponse} message BatchGetAssetsHistoryResponse message or plain object to encode + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse} message SearchAllIamPoliciesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchGetAssetsHistoryResponse.encodeDelimited = function encodeDelimited(message, writer) { + SearchAllIamPoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer. + * Decodes a SearchAllIamPoliciesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse + * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse} SearchAllIamPoliciesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchGetAssetsHistoryResponse.decode = function decode(reader, length) { + SearchAllIamPoliciesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.assets && message.assets.length)) - message.assets = []; - message.assets.push($root.google.cloud.asset.v1p2beta1.TemporalAsset.decode(reader, reader.uint32())); + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -9028,126 +10445,147 @@ }; /** - * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer, length delimited. + * Decodes a SearchAllIamPoliciesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse + * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse} SearchAllIamPoliciesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchGetAssetsHistoryResponse.decodeDelimited = function decodeDelimited(reader) { + SearchAllIamPoliciesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchGetAssetsHistoryResponse message. + * Verifies a SearchAllIamPoliciesResponse message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchGetAssetsHistoryResponse.verify = function verify(message) { + SearchAllIamPoliciesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.assets != null && message.hasOwnProperty("assets")) { - if (!Array.isArray(message.assets)) - return "assets: array expected"; - for (var i = 0; i < message.assets.length; ++i) { - var error = $root.google.cloud.asset.v1p2beta1.TemporalAsset.verify(message.assets[i]); + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.verify(message.results[i]); if (error) - return "assets." + error; + return "results." + error; } } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a BatchGetAssetsHistoryResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SearchAllIamPoliciesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse + * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse} SearchAllIamPoliciesResponse */ - BatchGetAssetsHistoryResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse) + SearchAllIamPoliciesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse) return object; - var message = new $root.google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse(); - if (object.assets) { - if (!Array.isArray(object.assets)) - throw TypeError(".google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse.assets: array expected"); - message.assets = []; - for (var i = 0; i < object.assets.length; ++i) { - if (typeof object.assets[i] !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse.assets: object expected"); - message.assets[i] = $root.google.cloud.asset.v1p2beta1.TemporalAsset.fromObject(object.assets[i]); + var message = new $root.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse(); + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse.results: object expected"); + message.results[i] = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.fromObject(object.results[i]); } } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a BatchGetAssetsHistoryResponse message. Also converts values to other types if specified. + * Creates a plain object from a SearchAllIamPoliciesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse * @static - * @param {google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse} message BatchGetAssetsHistoryResponse + * @param {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse} message SearchAllIamPoliciesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchGetAssetsHistoryResponse.toObject = function toObject(message, options) { + SearchAllIamPoliciesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.assets = []; - if (message.assets && message.assets.length) { - object.assets = []; - for (var j = 0; j < message.assets.length; ++j) - object.assets[j] = $root.google.cloud.asset.v1p2beta1.TemporalAsset.toObject(message.assets[j], options); - } + object.results = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.toObject(message.results[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this BatchGetAssetsHistoryResponse to JSON. + * Converts this SearchAllIamPoliciesResponse to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse * @instance * @returns {Object.} JSON object */ - BatchGetAssetsHistoryResponse.prototype.toJSON = function toJSON() { + SearchAllIamPoliciesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return BatchGetAssetsHistoryResponse; + return SearchAllIamPoliciesResponse; })(); - v1p2beta1.CreateFeedRequest = (function() { + return v1p1beta1; + })(); + + asset.v1p2beta1 = (function() { + + /** + * Namespace v1p2beta1. + * @memberof google.cloud.asset + * @namespace + */ + var v1p2beta1 = {}; + + v1p2beta1.TemporalAsset = (function() { /** - * Properties of a CreateFeedRequest. + * Properties of a TemporalAsset. * @memberof google.cloud.asset.v1p2beta1 - * @interface ICreateFeedRequest - * @property {string|null} [parent] CreateFeedRequest parent - * @property {string|null} [feedId] CreateFeedRequest feedId - * @property {google.cloud.asset.v1p2beta1.IFeed|null} [feed] CreateFeedRequest feed + * @interface ITemporalAsset + * @property {google.cloud.asset.v1p2beta1.ITimeWindow|null} [window] TemporalAsset window + * @property {boolean|null} [deleted] TemporalAsset deleted + * @property {google.cloud.asset.v1p2beta1.IAsset|null} [asset] TemporalAsset asset */ /** - * Constructs a new CreateFeedRequest. + * Constructs a new TemporalAsset. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a CreateFeedRequest. - * @implements ICreateFeedRequest + * @classdesc Represents a TemporalAsset. + * @implements ITemporalAsset * @constructor - * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.ITemporalAsset=} [properties] Properties to set */ - function CreateFeedRequest(properties) { + function TemporalAsset(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9155,101 +10593,101 @@ } /** - * CreateFeedRequest parent. - * @member {string} parent - * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * TemporalAsset window. + * @member {google.cloud.asset.v1p2beta1.ITimeWindow|null|undefined} window + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset * @instance */ - CreateFeedRequest.prototype.parent = ""; + TemporalAsset.prototype.window = null; /** - * CreateFeedRequest feedId. - * @member {string} feedId - * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * TemporalAsset deleted. + * @member {boolean} deleted + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset * @instance */ - CreateFeedRequest.prototype.feedId = ""; + TemporalAsset.prototype.deleted = false; /** - * CreateFeedRequest feed. - * @member {google.cloud.asset.v1p2beta1.IFeed|null|undefined} feed - * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * TemporalAsset asset. + * @member {google.cloud.asset.v1p2beta1.IAsset|null|undefined} asset + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset * @instance */ - CreateFeedRequest.prototype.feed = null; + TemporalAsset.prototype.asset = null; /** - * Creates a new CreateFeedRequest instance using the specified properties. + * Creates a new TemporalAsset instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset * @static - * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.CreateFeedRequest} CreateFeedRequest instance + * @param {google.cloud.asset.v1p2beta1.ITemporalAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.TemporalAsset} TemporalAsset instance */ - CreateFeedRequest.create = function create(properties) { - return new CreateFeedRequest(properties); + TemporalAsset.create = function create(properties) { + return new TemporalAsset(properties); }; /** - * Encodes the specified CreateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.CreateFeedRequest.verify|verify} messages. + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1p2beta1.TemporalAsset.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset * @static - * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest} message CreateFeedRequest message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.ITemporalAsset} message TemporalAsset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateFeedRequest.encode = function encode(message, writer) { + TemporalAsset.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.feedId != null && message.hasOwnProperty("feedId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.feedId); - if (message.feed != null && message.hasOwnProperty("feed")) - $root.google.cloud.asset.v1p2beta1.Feed.encode(message.feed, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.window != null && message.hasOwnProperty("window")) + $root.google.cloud.asset.v1p2beta1.TimeWindow.encode(message.window, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.deleted != null && message.hasOwnProperty("deleted")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deleted); + if (message.asset != null && message.hasOwnProperty("asset")) + $root.google.cloud.asset.v1p2beta1.Asset.encode(message.asset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified CreateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.CreateFeedRequest.verify|verify} messages. + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.TemporalAsset.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset * @static - * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest} message CreateFeedRequest message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.ITemporalAsset} message TemporalAsset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { + TemporalAsset.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateFeedRequest message from the specified reader or buffer. + * Decodes a TemporalAsset message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.CreateFeedRequest} CreateFeedRequest + * @returns {google.cloud.asset.v1p2beta1.TemporalAsset} TemporalAsset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateFeedRequest.decode = function decode(reader, length) { + TemporalAsset.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.CreateFeedRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.TemporalAsset(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.window = $root.google.cloud.asset.v1p2beta1.TimeWindow.decode(reader, reader.uint32()); break; case 2: - message.feedId = reader.string(); + message.deleted = reader.bool(); break; case 3: - message.feed = $root.google.cloud.asset.v1p2beta1.Feed.decode(reader, reader.uint32()); + message.asset = $root.google.cloud.asset.v1p2beta1.Asset.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -9260,129 +10698,135 @@ }; /** - * Decodes a CreateFeedRequest message from the specified reader or buffer, length delimited. + * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.CreateFeedRequest} CreateFeedRequest + * @returns {google.cloud.asset.v1p2beta1.TemporalAsset} TemporalAsset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateFeedRequest.decodeDelimited = function decodeDelimited(reader) { + TemporalAsset.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateFeedRequest message. + * Verifies a TemporalAsset message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateFeedRequest.verify = function verify(message) { + TemporalAsset.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.feedId != null && message.hasOwnProperty("feedId")) - if (!$util.isString(message.feedId)) - return "feedId: string expected"; - if (message.feed != null && message.hasOwnProperty("feed")) { - var error = $root.google.cloud.asset.v1p2beta1.Feed.verify(message.feed); + if (message.window != null && message.hasOwnProperty("window")) { + var error = $root.google.cloud.asset.v1p2beta1.TimeWindow.verify(message.window); if (error) - return "feed." + error; + return "window." + error; + } + if (message.deleted != null && message.hasOwnProperty("deleted")) + if (typeof message.deleted !== "boolean") + return "deleted: boolean expected"; + if (message.asset != null && message.hasOwnProperty("asset")) { + var error = $root.google.cloud.asset.v1p2beta1.Asset.verify(message.asset); + if (error) + return "asset." + error; } return null; }; /** - * Creates a CreateFeedRequest message from a plain object. Also converts values to their respective internal types. + * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.CreateFeedRequest} CreateFeedRequest + * @returns {google.cloud.asset.v1p2beta1.TemporalAsset} TemporalAsset */ - CreateFeedRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.CreateFeedRequest) + TemporalAsset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.TemporalAsset) return object; - var message = new $root.google.cloud.asset.v1p2beta1.CreateFeedRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.feedId != null) - message.feedId = String(object.feedId); - if (object.feed != null) { - if (typeof object.feed !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.CreateFeedRequest.feed: object expected"); - message.feed = $root.google.cloud.asset.v1p2beta1.Feed.fromObject(object.feed); + var message = new $root.google.cloud.asset.v1p2beta1.TemporalAsset(); + if (object.window != null) { + if (typeof object.window !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.TemporalAsset.window: object expected"); + message.window = $root.google.cloud.asset.v1p2beta1.TimeWindow.fromObject(object.window); + } + if (object.deleted != null) + message.deleted = Boolean(object.deleted); + if (object.asset != null) { + if (typeof object.asset !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.TemporalAsset.asset: object expected"); + message.asset = $root.google.cloud.asset.v1p2beta1.Asset.fromObject(object.asset); } return message; }; /** - * Creates a plain object from a CreateFeedRequest message. Also converts values to other types if specified. + * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset * @static - * @param {google.cloud.asset.v1p2beta1.CreateFeedRequest} message CreateFeedRequest + * @param {google.cloud.asset.v1p2beta1.TemporalAsset} message TemporalAsset * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateFeedRequest.toObject = function toObject(message, options) { + TemporalAsset.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.feedId = ""; - object.feed = null; + object.window = null; + object.deleted = false; + object.asset = null; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.feedId != null && message.hasOwnProperty("feedId")) - object.feedId = message.feedId; - if (message.feed != null && message.hasOwnProperty("feed")) - object.feed = $root.google.cloud.asset.v1p2beta1.Feed.toObject(message.feed, options); + if (message.window != null && message.hasOwnProperty("window")) + object.window = $root.google.cloud.asset.v1p2beta1.TimeWindow.toObject(message.window, options); + if (message.deleted != null && message.hasOwnProperty("deleted")) + object.deleted = message.deleted; + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = $root.google.cloud.asset.v1p2beta1.Asset.toObject(message.asset, options); return object; }; /** - * Converts this CreateFeedRequest to JSON. + * Converts this TemporalAsset to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset * @instance * @returns {Object.} JSON object */ - CreateFeedRequest.prototype.toJSON = function toJSON() { + TemporalAsset.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateFeedRequest; + return TemporalAsset; })(); - v1p2beta1.GetFeedRequest = (function() { + v1p2beta1.TimeWindow = (function() { /** - * Properties of a GetFeedRequest. + * Properties of a TimeWindow. * @memberof google.cloud.asset.v1p2beta1 - * @interface IGetFeedRequest - * @property {string|null} [name] GetFeedRequest name + * @interface ITimeWindow + * @property {google.protobuf.ITimestamp|null} [startTime] TimeWindow startTime + * @property {google.protobuf.ITimestamp|null} [endTime] TimeWindow endTime */ /** - * Constructs a new GetFeedRequest. + * Constructs a new TimeWindow. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a GetFeedRequest. - * @implements IGetFeedRequest + * @classdesc Represents a TimeWindow. + * @implements ITimeWindow * @constructor - * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.ITimeWindow=} [properties] Properties to set */ - function GetFeedRequest(properties) { + function TimeWindow(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9390,75 +10834,88 @@ } /** - * GetFeedRequest name. - * @member {string} name - * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * TimeWindow startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.asset.v1p2beta1.TimeWindow * @instance */ - GetFeedRequest.prototype.name = ""; + TimeWindow.prototype.startTime = null; /** - * Creates a new GetFeedRequest instance using the specified properties. + * TimeWindow endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @instance + */ + TimeWindow.prototype.endTime = null; + + /** + * Creates a new TimeWindow instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @memberof google.cloud.asset.v1p2beta1.TimeWindow * @static - * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.GetFeedRequest} GetFeedRequest instance + * @param {google.cloud.asset.v1p2beta1.ITimeWindow=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.TimeWindow} TimeWindow instance */ - GetFeedRequest.create = function create(properties) { - return new GetFeedRequest(properties); + TimeWindow.create = function create(properties) { + return new TimeWindow(properties); }; /** - * Encodes the specified GetFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.GetFeedRequest.verify|verify} messages. + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1p2beta1.TimeWindow.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @memberof google.cloud.asset.v1p2beta1.TimeWindow * @static - * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest} message GetFeedRequest message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.ITimeWindow} message TimeWindow message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetFeedRequest.encode = function encode(message, writer) { + TimeWindow.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.startTime != null && message.hasOwnProperty("startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && message.hasOwnProperty("endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified GetFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.GetFeedRequest.verify|verify} messages. + * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.TimeWindow.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @memberof google.cloud.asset.v1p2beta1.TimeWindow * @static - * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest} message GetFeedRequest message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.ITimeWindow} message TimeWindow message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { + TimeWindow.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetFeedRequest message from the specified reader or buffer. + * Decodes a TimeWindow message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @memberof google.cloud.asset.v1p2beta1.TimeWindow * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.GetFeedRequest} GetFeedRequest + * @returns {google.cloud.asset.v1p2beta1.TimeWindow} TimeWindow * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetFeedRequest.decode = function decode(reader, length) { + TimeWindow.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.GetFeedRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.TimeWindow(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 2: + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -9469,107 +10926,131 @@ }; /** - * Decodes a GetFeedRequest message from the specified reader or buffer, length delimited. + * Decodes a TimeWindow message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @memberof google.cloud.asset.v1p2beta1.TimeWindow * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.GetFeedRequest} GetFeedRequest + * @returns {google.cloud.asset.v1p2beta1.TimeWindow} TimeWindow * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetFeedRequest.decodeDelimited = function decodeDelimited(reader) { + TimeWindow.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetFeedRequest message. + * Verifies a TimeWindow message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @memberof google.cloud.asset.v1p2beta1.TimeWindow * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetFeedRequest.verify = function verify(message) { + TimeWindow.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.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } return null; }; /** - * Creates a GetFeedRequest message from a plain object. Also converts values to their respective internal types. + * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @memberof google.cloud.asset.v1p2beta1.TimeWindow * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.GetFeedRequest} GetFeedRequest + * @returns {google.cloud.asset.v1p2beta1.TimeWindow} TimeWindow */ - GetFeedRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.GetFeedRequest) + TimeWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.TimeWindow) return object; - var message = new $root.google.cloud.asset.v1p2beta1.GetFeedRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.asset.v1p2beta1.TimeWindow(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.TimeWindow.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.TimeWindow.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } return message; }; /** - * Creates a plain object from a GetFeedRequest message. Also converts values to other types if specified. + * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @memberof google.cloud.asset.v1p2beta1.TimeWindow * @static - * @param {google.cloud.asset.v1p2beta1.GetFeedRequest} message GetFeedRequest + * @param {google.cloud.asset.v1p2beta1.TimeWindow} message TimeWindow * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetFeedRequest.toObject = function toObject(message, options) { + TimeWindow.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); return object; }; /** - * Converts this GetFeedRequest to JSON. + * Converts this TimeWindow to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @memberof google.cloud.asset.v1p2beta1.TimeWindow * @instance * @returns {Object.} JSON object */ - GetFeedRequest.prototype.toJSON = function toJSON() { + TimeWindow.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetFeedRequest; + return TimeWindow; })(); - v1p2beta1.ListFeedsRequest = (function() { + v1p2beta1.Asset = (function() { /** - * Properties of a ListFeedsRequest. + * Properties of an Asset. * @memberof google.cloud.asset.v1p2beta1 - * @interface IListFeedsRequest - * @property {string|null} [parent] ListFeedsRequest parent + * @interface IAsset + * @property {string|null} [name] Asset name + * @property {string|null} [assetType] Asset assetType + * @property {google.cloud.asset.v1p2beta1.IResource|null} [resource] Asset resource + * @property {google.iam.v1.IPolicy|null} [iamPolicy] Asset iamPolicy + * @property {Array.|null} [ancestors] Asset ancestors */ /** - * Constructs a new ListFeedsRequest. + * Constructs a new Asset. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a ListFeedsRequest. - * @implements IListFeedsRequest + * @classdesc Represents an Asset. + * @implements IAsset * @constructor - * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.IAsset=} [properties] Properties to set */ - function ListFeedsRequest(properties) { + function Asset(properties) { + this.ancestors = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9577,75 +11058,130 @@ } /** - * ListFeedsRequest parent. - * @member {string} parent - * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * Asset name. + * @member {string} name + * @memberof google.cloud.asset.v1p2beta1.Asset * @instance */ - ListFeedsRequest.prototype.parent = ""; + Asset.prototype.name = ""; /** - * Creates a new ListFeedsRequest instance using the specified properties. + * Asset assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1p2beta1.Asset + * @instance + */ + Asset.prototype.assetType = ""; + + /** + * Asset resource. + * @member {google.cloud.asset.v1p2beta1.IResource|null|undefined} resource + * @memberof google.cloud.asset.v1p2beta1.Asset + * @instance + */ + Asset.prototype.resource = null; + + /** + * Asset iamPolicy. + * @member {google.iam.v1.IPolicy|null|undefined} iamPolicy + * @memberof google.cloud.asset.v1p2beta1.Asset + * @instance + */ + Asset.prototype.iamPolicy = null; + + /** + * Asset ancestors. + * @member {Array.} ancestors + * @memberof google.cloud.asset.v1p2beta1.Asset + * @instance + */ + Asset.prototype.ancestors = $util.emptyArray; + + /** + * Creates a new Asset instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @memberof google.cloud.asset.v1p2beta1.Asset * @static - * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.ListFeedsRequest} ListFeedsRequest instance + * @param {google.cloud.asset.v1p2beta1.IAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.Asset} Asset instance */ - ListFeedsRequest.create = function create(properties) { - return new ListFeedsRequest(properties); + Asset.create = function create(properties) { + return new Asset(properties); }; /** - * Encodes the specified ListFeedsRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsRequest.verify|verify} messages. + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Asset.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @memberof google.cloud.asset.v1p2beta1.Asset * @static - * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest} message ListFeedsRequest message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IAsset} message Asset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListFeedsRequest.encode = function encode(message, writer) { + Asset.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.assetType != null && message.hasOwnProperty("assetType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); + if (message.resource != null && message.hasOwnProperty("resource")) + $root.google.cloud.asset.v1p2beta1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + $root.google.iam.v1.Policy.encode(message.iamPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.ancestors != null && message.ancestors.length) + for (var i = 0; i < message.ancestors.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.ancestors[i]); return writer; }; /** - * Encodes the specified ListFeedsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsRequest.verify|verify} messages. + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Asset.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @memberof google.cloud.asset.v1p2beta1.Asset * @static - * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest} message ListFeedsRequest message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IAsset} message Asset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListFeedsRequest.encodeDelimited = function encodeDelimited(message, writer) { + Asset.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListFeedsRequest message from the specified reader or buffer. + * Decodes an Asset message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @memberof google.cloud.asset.v1p2beta1.Asset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.ListFeedsRequest} ListFeedsRequest + * @returns {google.cloud.asset.v1p2beta1.Asset} Asset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListFeedsRequest.decode = function decode(reader, length) { + Asset.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.ListFeedsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.Asset(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.name = reader.string(); + break; + case 2: + message.assetType = reader.string(); + break; + case 3: + message.resource = $root.google.cloud.asset.v1p2beta1.Resource.decode(reader, reader.uint32()); + break; + case 4: + message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + case 6: + if (!(message.ancestors && message.ancestors.length)) + message.ancestors = []; + message.ancestors.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -9656,108 +11192,168 @@ }; /** - * Decodes a ListFeedsRequest message from the specified reader or buffer, length delimited. + * Decodes an Asset message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @memberof google.cloud.asset.v1p2beta1.Asset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.ListFeedsRequest} ListFeedsRequest + * @returns {google.cloud.asset.v1p2beta1.Asset} Asset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListFeedsRequest.decodeDelimited = function decodeDelimited(reader) { + Asset.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListFeedsRequest message. + * Verifies an Asset message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @memberof google.cloud.asset.v1p2beta1.Asset * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListFeedsRequest.verify = function verify(message) { + Asset.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.asset.v1p2beta1.Resource.verify(message.resource); + if (error) + return "resource." + error; + } + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { + var error = $root.google.iam.v1.Policy.verify(message.iamPolicy); + if (error) + return "iamPolicy." + error; + } + if (message.ancestors != null && message.hasOwnProperty("ancestors")) { + if (!Array.isArray(message.ancestors)) + return "ancestors: array expected"; + for (var i = 0; i < message.ancestors.length; ++i) + if (!$util.isString(message.ancestors[i])) + return "ancestors: string[] expected"; + } return null; }; /** - * Creates a ListFeedsRequest message from a plain object. Also converts values to their respective internal types. + * Creates an Asset message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @memberof google.cloud.asset.v1p2beta1.Asset * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.ListFeedsRequest} ListFeedsRequest + * @returns {google.cloud.asset.v1p2beta1.Asset} Asset */ - ListFeedsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.ListFeedsRequest) + Asset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.Asset) return object; - var message = new $root.google.cloud.asset.v1p2beta1.ListFeedsRequest(); - if (object.parent != null) - message.parent = String(object.parent); + var message = new $root.google.cloud.asset.v1p2beta1.Asset(); + if (object.name != null) + message.name = String(object.name); + if (object.assetType != null) + message.assetType = String(object.assetType); + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.Asset.resource: object expected"); + message.resource = $root.google.cloud.asset.v1p2beta1.Resource.fromObject(object.resource); + } + if (object.iamPolicy != null) { + if (typeof object.iamPolicy !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.Asset.iamPolicy: object expected"); + message.iamPolicy = $root.google.iam.v1.Policy.fromObject(object.iamPolicy); + } + if (object.ancestors) { + if (!Array.isArray(object.ancestors)) + throw TypeError(".google.cloud.asset.v1p2beta1.Asset.ancestors: array expected"); + message.ancestors = []; + for (var i = 0; i < object.ancestors.length; ++i) + message.ancestors[i] = String(object.ancestors[i]); + } return message; }; /** - * Creates a plain object from a ListFeedsRequest message. Also converts values to other types if specified. + * Creates a plain object from an Asset message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @memberof google.cloud.asset.v1p2beta1.Asset * @static - * @param {google.cloud.asset.v1p2beta1.ListFeedsRequest} message ListFeedsRequest + * @param {google.cloud.asset.v1p2beta1.Asset} message Asset * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListFeedsRequest.toObject = function toObject(message, options) { + Asset.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.parent = ""; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; + if (options.arrays || options.defaults) + object.ancestors = []; + if (options.defaults) { + object.name = ""; + object.assetType = ""; + object.resource = null; + object.iamPolicy = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.asset.v1p2beta1.Resource.toObject(message.resource, options); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + object.iamPolicy = $root.google.iam.v1.Policy.toObject(message.iamPolicy, options); + if (message.ancestors && message.ancestors.length) { + object.ancestors = []; + for (var j = 0; j < message.ancestors.length; ++j) + object.ancestors[j] = message.ancestors[j]; + } return object; }; /** - * Converts this ListFeedsRequest to JSON. + * Converts this Asset to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @memberof google.cloud.asset.v1p2beta1.Asset * @instance * @returns {Object.} JSON object */ - ListFeedsRequest.prototype.toJSON = function toJSON() { + Asset.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListFeedsRequest; + return Asset; })(); - v1p2beta1.ListFeedsResponse = (function() { + v1p2beta1.Resource = (function() { /** - * Properties of a ListFeedsResponse. + * Properties of a Resource. * @memberof google.cloud.asset.v1p2beta1 - * @interface IListFeedsResponse - * @property {Array.|null} [feeds] ListFeedsResponse feeds + * @interface IResource + * @property {string|null} [version] Resource version + * @property {string|null} [discoveryDocumentUri] Resource discoveryDocumentUri + * @property {string|null} [discoveryName] Resource discoveryName + * @property {string|null} [resourceUrl] Resource resourceUrl + * @property {string|null} [parent] Resource parent + * @property {google.protobuf.IStruct|null} [data] Resource data */ /** - * Constructs a new ListFeedsResponse. + * Constructs a new Resource. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a ListFeedsResponse. - * @implements IListFeedsResponse + * @classdesc Represents a Resource. + * @implements IResource * @constructor - * @param {google.cloud.asset.v1p2beta1.IListFeedsResponse=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.IResource=} [properties] Properties to set */ - function ListFeedsResponse(properties) { - this.feeds = []; + function Resource(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9765,78 +11361,140 @@ } /** - * ListFeedsResponse feeds. - * @member {Array.} feeds - * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * Resource version. + * @member {string} version + * @memberof google.cloud.asset.v1p2beta1.Resource * @instance */ - ListFeedsResponse.prototype.feeds = $util.emptyArray; + Resource.prototype.version = ""; /** - * Creates a new ListFeedsResponse instance using the specified properties. + * Resource discoveryDocumentUri. + * @member {string} discoveryDocumentUri + * @memberof google.cloud.asset.v1p2beta1.Resource + * @instance + */ + Resource.prototype.discoveryDocumentUri = ""; + + /** + * Resource discoveryName. + * @member {string} discoveryName + * @memberof google.cloud.asset.v1p2beta1.Resource + * @instance + */ + Resource.prototype.discoveryName = ""; + + /** + * Resource resourceUrl. + * @member {string} resourceUrl + * @memberof google.cloud.asset.v1p2beta1.Resource + * @instance + */ + Resource.prototype.resourceUrl = ""; + + /** + * Resource parent. + * @member {string} parent + * @memberof google.cloud.asset.v1p2beta1.Resource + * @instance + */ + Resource.prototype.parent = ""; + + /** + * Resource data. + * @member {google.protobuf.IStruct|null|undefined} data + * @memberof google.cloud.asset.v1p2beta1.Resource + * @instance + */ + Resource.prototype.data = null; + + /** + * Creates a new Resource instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @memberof google.cloud.asset.v1p2beta1.Resource * @static - * @param {google.cloud.asset.v1p2beta1.IListFeedsResponse=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.ListFeedsResponse} ListFeedsResponse instance + * @param {google.cloud.asset.v1p2beta1.IResource=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.Resource} Resource instance */ - ListFeedsResponse.create = function create(properties) { - return new ListFeedsResponse(properties); + Resource.create = function create(properties) { + return new Resource(properties); }; /** - * Encodes the specified ListFeedsResponse message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsResponse.verify|verify} messages. + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Resource.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @memberof google.cloud.asset.v1p2beta1.Resource * @static - * @param {google.cloud.asset.v1p2beta1.IListFeedsResponse} message ListFeedsResponse message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IResource} message Resource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListFeedsResponse.encode = function encode(message, writer) { + Resource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.feeds != null && message.feeds.length) - for (var i = 0; i < message.feeds.length; ++i) - $root.google.cloud.asset.v1p2beta1.Feed.encode(message.feeds[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.version != null && message.hasOwnProperty("version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.discoveryDocumentUri); + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.discoveryName); + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceUrl); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); + if (message.data != null && message.hasOwnProperty("data")) + $root.google.protobuf.Struct.encode(message.data, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListFeedsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsResponse.verify|verify} messages. + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Resource.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @memberof google.cloud.asset.v1p2beta1.Resource * @static - * @param {google.cloud.asset.v1p2beta1.IListFeedsResponse} message ListFeedsResponse message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IResource} message Resource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListFeedsResponse.encodeDelimited = function encodeDelimited(message, writer) { + Resource.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListFeedsResponse message from the specified reader or buffer. + * Decodes a Resource message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @memberof google.cloud.asset.v1p2beta1.Resource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.ListFeedsResponse} ListFeedsResponse + * @returns {google.cloud.asset.v1p2beta1.Resource} Resource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListFeedsResponse.decode = function decode(reader, length) { + Resource.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.ListFeedsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.Resource(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.feeds && message.feeds.length)) - message.feeds = []; - message.feeds.push($root.google.cloud.asset.v1p2beta1.Feed.decode(reader, reader.uint32())); + message.version = reader.string(); + break; + case 2: + message.discoveryDocumentUri = reader.string(); + break; + case 3: + message.discoveryName = reader.string(); + break; + case 4: + message.resourceUrl = reader.string(); + break; + case 5: + message.parent = reader.string(); + break; + case 6: + message.data = $root.google.protobuf.Struct.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -9847,344 +11505,355 @@ }; /** - * Decodes a ListFeedsResponse message from the specified reader or buffer, length delimited. + * Decodes a Resource message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @memberof google.cloud.asset.v1p2beta1.Resource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.ListFeedsResponse} ListFeedsResponse + * @returns {google.cloud.asset.v1p2beta1.Resource} Resource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListFeedsResponse.decodeDelimited = function decodeDelimited(reader) { + Resource.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListFeedsResponse message. + * Verifies a Resource message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @memberof google.cloud.asset.v1p2beta1.Resource * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListFeedsResponse.verify = function verify(message) { + Resource.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.feeds != null && message.hasOwnProperty("feeds")) { - if (!Array.isArray(message.feeds)) - return "feeds: array expected"; - for (var i = 0; i < message.feeds.length; ++i) { - var error = $root.google.cloud.asset.v1p2beta1.Feed.verify(message.feeds[i]); - if (error) - return "feeds." + error; - } + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + if (!$util.isString(message.discoveryDocumentUri)) + return "discoveryDocumentUri: string expected"; + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + if (!$util.isString(message.discoveryName)) + return "discoveryName: string expected"; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + if (!$util.isString(message.resourceUrl)) + return "resourceUrl: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.data != null && message.hasOwnProperty("data")) { + var error = $root.google.protobuf.Struct.verify(message.data); + if (error) + return "data." + error; } return null; }; /** - * Creates a ListFeedsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a Resource message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @memberof google.cloud.asset.v1p2beta1.Resource * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.ListFeedsResponse} ListFeedsResponse + * @returns {google.cloud.asset.v1p2beta1.Resource} Resource */ - ListFeedsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.ListFeedsResponse) + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.Resource) return object; - var message = new $root.google.cloud.asset.v1p2beta1.ListFeedsResponse(); - if (object.feeds) { - if (!Array.isArray(object.feeds)) - throw TypeError(".google.cloud.asset.v1p2beta1.ListFeedsResponse.feeds: array expected"); - message.feeds = []; - for (var i = 0; i < object.feeds.length; ++i) { - if (typeof object.feeds[i] !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.ListFeedsResponse.feeds: object expected"); - message.feeds[i] = $root.google.cloud.asset.v1p2beta1.Feed.fromObject(object.feeds[i]); - } + var message = new $root.google.cloud.asset.v1p2beta1.Resource(); + if (object.version != null) + message.version = String(object.version); + if (object.discoveryDocumentUri != null) + message.discoveryDocumentUri = String(object.discoveryDocumentUri); + if (object.discoveryName != null) + message.discoveryName = String(object.discoveryName); + if (object.resourceUrl != null) + message.resourceUrl = String(object.resourceUrl); + if (object.parent != null) + message.parent = String(object.parent); + if (object.data != null) { + if (typeof object.data !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.Resource.data: object expected"); + message.data = $root.google.protobuf.Struct.fromObject(object.data); } return message; }; /** - * Creates a plain object from a ListFeedsResponse message. Also converts values to other types if specified. + * Creates a plain object from a Resource message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @memberof google.cloud.asset.v1p2beta1.Resource * @static - * @param {google.cloud.asset.v1p2beta1.ListFeedsResponse} message ListFeedsResponse + * @param {google.cloud.asset.v1p2beta1.Resource} message Resource * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListFeedsResponse.toObject = function toObject(message, options) { + Resource.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.feeds = []; - if (message.feeds && message.feeds.length) { - object.feeds = []; - for (var j = 0; j < message.feeds.length; ++j) - object.feeds[j] = $root.google.cloud.asset.v1p2beta1.Feed.toObject(message.feeds[j], options); + if (options.defaults) { + object.version = ""; + object.discoveryDocumentUri = ""; + object.discoveryName = ""; + object.resourceUrl = ""; + object.parent = ""; + object.data = null; } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + object.discoveryDocumentUri = message.discoveryDocumentUri; + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + object.discoveryName = message.discoveryName; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + object.resourceUrl = message.resourceUrl; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.data != null && message.hasOwnProperty("data")) + object.data = $root.google.protobuf.Struct.toObject(message.data, options); return object; }; /** - * Converts this ListFeedsResponse to JSON. + * Converts this Resource to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @memberof google.cloud.asset.v1p2beta1.Resource * @instance * @returns {Object.} JSON object */ - ListFeedsResponse.prototype.toJSON = function toJSON() { + Resource.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListFeedsResponse; + return Resource; })(); - v1p2beta1.UpdateFeedRequest = (function() { + v1p2beta1.AssetService = (function() { /** - * Properties of an UpdateFeedRequest. + * Constructs a new AssetService service. * @memberof google.cloud.asset.v1p2beta1 - * @interface IUpdateFeedRequest - * @property {google.cloud.asset.v1p2beta1.IFeed|null} [feed] UpdateFeedRequest feed - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateFeedRequest updateMask + * @classdesc Represents an AssetService + * @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 AssetService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AssetService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AssetService; /** - * Constructs a new UpdateFeedRequest. - * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents an UpdateFeedRequest. - * @implements IUpdateFeedRequest - * @constructor - * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest=} [properties] Properties to set + * Creates new AssetService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @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 {AssetService} RPC service. Useful where requests and/or responses are streamed. */ - function UpdateFeedRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + AssetService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; /** - * UpdateFeedRequest feed. - * @member {google.cloud.asset.v1p2beta1.IFeed|null|undefined} feed - * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#createFeed}. + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @typedef CreateFeedCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1p2beta1.Feed} [response] Feed + */ + + /** + * Calls CreateFeed. + * @function createFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService * @instance + * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest} request CreateFeedRequest message or plain object + * @param {google.cloud.asset.v1p2beta1.AssetService.CreateFeedCallback} callback Node-style callback called with the error, if any, and Feed + * @returns {undefined} + * @variation 1 */ - UpdateFeedRequest.prototype.feed = null; + Object.defineProperty(AssetService.prototype.createFeed = function createFeed(request, callback) { + return this.rpcCall(createFeed, $root.google.cloud.asset.v1p2beta1.CreateFeedRequest, $root.google.cloud.asset.v1p2beta1.Feed, request, callback); + }, "name", { value: "CreateFeed" }); /** - * UpdateFeedRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * Calls CreateFeed. + * @function createFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService * @instance + * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest} request CreateFeedRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - UpdateFeedRequest.prototype.updateMask = null; /** - * Creates a new UpdateFeedRequest instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest - * @static - * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.UpdateFeedRequest} UpdateFeedRequest instance + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#getFeed}. + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @typedef GetFeedCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1p2beta1.Feed} [response] Feed */ - UpdateFeedRequest.create = function create(properties) { - return new UpdateFeedRequest(properties); - }; /** - * Encodes the specified UpdateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.UpdateFeedRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest - * @static - * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest} message UpdateFeedRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls GetFeed. + * @function getFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest} request GetFeedRequest message or plain object + * @param {google.cloud.asset.v1p2beta1.AssetService.GetFeedCallback} callback Node-style callback called with the error, if any, and Feed + * @returns {undefined} + * @variation 1 */ - UpdateFeedRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.feed != null && message.hasOwnProperty("feed")) - $root.google.cloud.asset.v1p2beta1.Feed.encode(message.feed, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + Object.defineProperty(AssetService.prototype.getFeed = function getFeed(request, callback) { + return this.rpcCall(getFeed, $root.google.cloud.asset.v1p2beta1.GetFeedRequest, $root.google.cloud.asset.v1p2beta1.Feed, request, callback); + }, "name", { value: "GetFeed" }); /** - * Encodes the specified UpdateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.UpdateFeedRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest - * @static - * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest} message UpdateFeedRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls GetFeed. + * @function getFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest} request GetFeedRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - UpdateFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; /** - * Decodes an UpdateFeedRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.UpdateFeedRequest} UpdateFeedRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#listFeeds}. + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @typedef ListFeedsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1p2beta1.ListFeedsResponse} [response] ListFeedsResponse */ - UpdateFeedRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.UpdateFeedRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.feed = $root.google.cloud.asset.v1p2beta1.Feed.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 UpdateFeedRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.UpdateFeedRequest} UpdateFeedRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls ListFeeds. + * @function listFeeds + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest} request ListFeedsRequest message or plain object + * @param {google.cloud.asset.v1p2beta1.AssetService.ListFeedsCallback} callback Node-style callback called with the error, if any, and ListFeedsResponse + * @returns {undefined} + * @variation 1 */ - UpdateFeedRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Object.defineProperty(AssetService.prototype.listFeeds = function listFeeds(request, callback) { + return this.rpcCall(listFeeds, $root.google.cloud.asset.v1p2beta1.ListFeedsRequest, $root.google.cloud.asset.v1p2beta1.ListFeedsResponse, request, callback); + }, "name", { value: "ListFeeds" }); /** - * Verifies an UpdateFeedRequest message. - * @function verify - * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls ListFeeds. + * @function listFeeds + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest} request ListFeedsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#updateFeed}. + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @typedef UpdateFeedCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1p2beta1.Feed} [response] Feed + */ + + /** + * Calls UpdateFeed. + * @function updateFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest} request UpdateFeedRequest message or plain object + * @param {google.cloud.asset.v1p2beta1.AssetService.UpdateFeedCallback} callback Node-style callback called with the error, if any, and Feed + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.updateFeed = function updateFeed(request, callback) { + return this.rpcCall(updateFeed, $root.google.cloud.asset.v1p2beta1.UpdateFeedRequest, $root.google.cloud.asset.v1p2beta1.Feed, request, callback); + }, "name", { value: "UpdateFeed" }); + + /** + * Calls UpdateFeed. + * @function updateFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest} request UpdateFeedRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - UpdateFeedRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.feed != null && message.hasOwnProperty("feed")) { - var error = $root.google.cloud.asset.v1p2beta1.Feed.verify(message.feed); - if (error) - return "feed." + 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 UpdateFeedRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.UpdateFeedRequest} UpdateFeedRequest + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService#deleteFeed}. + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @typedef DeleteFeedCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty */ - UpdateFeedRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.UpdateFeedRequest) - return object; - var message = new $root.google.cloud.asset.v1p2beta1.UpdateFeedRequest(); - if (object.feed != null) { - if (typeof object.feed !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.UpdateFeedRequest.feed: object expected"); - message.feed = $root.google.cloud.asset.v1p2beta1.Feed.fromObject(object.feed); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.UpdateFeedRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; /** - * Creates a plain object from an UpdateFeedRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest - * @static - * @param {google.cloud.asset.v1p2beta1.UpdateFeedRequest} message UpdateFeedRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Calls DeleteFeed. + * @function deleteFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest} request DeleteFeedRequest message or plain object + * @param {google.cloud.asset.v1p2beta1.AssetService.DeleteFeedCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 */ - UpdateFeedRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.feed = null; - object.updateMask = null; - } - if (message.feed != null && message.hasOwnProperty("feed")) - object.feed = $root.google.cloud.asset.v1p2beta1.Feed.toObject(message.feed, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; + Object.defineProperty(AssetService.prototype.deleteFeed = function deleteFeed(request, callback) { + return this.rpcCall(deleteFeed, $root.google.cloud.asset.v1p2beta1.DeleteFeedRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteFeed" }); /** - * Converts this UpdateFeedRequest to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * Calls DeleteFeed. + * @function deleteFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService * @instance - * @returns {Object.} JSON object + * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest} request DeleteFeedRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - UpdateFeedRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - return UpdateFeedRequest; + return AssetService; })(); - v1p2beta1.DeleteFeedRequest = (function() { + v1p2beta1.CreateFeedRequest = (function() { /** - * Properties of a DeleteFeedRequest. + * Properties of a CreateFeedRequest. * @memberof google.cloud.asset.v1p2beta1 - * @interface IDeleteFeedRequest - * @property {string|null} [name] DeleteFeedRequest name + * @interface ICreateFeedRequest + * @property {string|null} [parent] CreateFeedRequest parent + * @property {string|null} [feedId] CreateFeedRequest feedId + * @property {google.cloud.asset.v1p2beta1.IFeed|null} [feed] CreateFeedRequest feed */ /** - * Constructs a new DeleteFeedRequest. + * Constructs a new CreateFeedRequest. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a DeleteFeedRequest. - * @implements IDeleteFeedRequest + * @classdesc Represents a CreateFeedRequest. + * @implements ICreateFeedRequest * @constructor - * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest=} [properties] Properties to set */ - function DeleteFeedRequest(properties) { + function CreateFeedRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10192,75 +11861,101 @@ } /** - * DeleteFeedRequest name. - * @member {string} name - * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * CreateFeedRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest * @instance */ - DeleteFeedRequest.prototype.name = ""; + CreateFeedRequest.prototype.parent = ""; /** - * Creates a new DeleteFeedRequest instance using the specified properties. + * CreateFeedRequest feedId. + * @member {string} feedId + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @instance + */ + CreateFeedRequest.prototype.feedId = ""; + + /** + * CreateFeedRequest feed. + * @member {google.cloud.asset.v1p2beta1.IFeed|null|undefined} feed + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @instance + */ + CreateFeedRequest.prototype.feed = null; + + /** + * Creates a new CreateFeedRequest instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.DeleteFeedRequest} DeleteFeedRequest instance + * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.CreateFeedRequest} CreateFeedRequest instance */ - DeleteFeedRequest.create = function create(properties) { - return new DeleteFeedRequest(properties); + CreateFeedRequest.create = function create(properties) { + return new CreateFeedRequest(properties); }; /** - * Encodes the specified DeleteFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.DeleteFeedRequest.verify|verify} messages. + * Encodes the specified CreateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.CreateFeedRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest} message DeleteFeedRequest message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest} message CreateFeedRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteFeedRequest.encode = function encode(message, writer) { + CreateFeedRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.feedId != null && message.hasOwnProperty("feedId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.feedId); + if (message.feed != null && message.hasOwnProperty("feed")) + $root.google.cloud.asset.v1p2beta1.Feed.encode(message.feed, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified DeleteFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.DeleteFeedRequest.verify|verify} messages. + * Encodes the specified CreateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.CreateFeedRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest} message DeleteFeedRequest message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest} message CreateFeedRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteFeedRequest message from the specified reader or buffer. + * Decodes a CreateFeedRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.DeleteFeedRequest} DeleteFeedRequest + * @returns {google.cloud.asset.v1p2beta1.CreateFeedRequest} CreateFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteFeedRequest.decode = function decode(reader, length) { + CreateFeedRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.DeleteFeedRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.CreateFeedRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.parent = reader.string(); + break; + case 2: + message.feedId = reader.string(); + break; + case 3: + message.feed = $root.google.cloud.asset.v1p2beta1.Feed.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -10271,108 +11966,129 @@ }; /** - * Decodes a DeleteFeedRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateFeedRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.DeleteFeedRequest} DeleteFeedRequest + * @returns {google.cloud.asset.v1p2beta1.CreateFeedRequest} CreateFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteFeedRequest.decodeDelimited = function decodeDelimited(reader) { + CreateFeedRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteFeedRequest message. + * Verifies a CreateFeedRequest message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteFeedRequest.verify = function verify(message) { + CreateFeedRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.feedId != null && message.hasOwnProperty("feedId")) + if (!$util.isString(message.feedId)) + return "feedId: string expected"; + if (message.feed != null && message.hasOwnProperty("feed")) { + var error = $root.google.cloud.asset.v1p2beta1.Feed.verify(message.feed); + if (error) + return "feed." + error; + } return null; }; /** - * Creates a DeleteFeedRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateFeedRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.DeleteFeedRequest} DeleteFeedRequest + * @returns {google.cloud.asset.v1p2beta1.CreateFeedRequest} CreateFeedRequest */ - DeleteFeedRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.DeleteFeedRequest) + CreateFeedRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.CreateFeedRequest) return object; - var message = new $root.google.cloud.asset.v1p2beta1.DeleteFeedRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.asset.v1p2beta1.CreateFeedRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.feedId != null) + message.feedId = String(object.feedId); + if (object.feed != null) { + if (typeof object.feed !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.CreateFeedRequest.feed: object expected"); + message.feed = $root.google.cloud.asset.v1p2beta1.Feed.fromObject(object.feed); + } return message; }; /** - * Creates a plain object from a DeleteFeedRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateFeedRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.DeleteFeedRequest} message DeleteFeedRequest + * @param {google.cloud.asset.v1p2beta1.CreateFeedRequest} message CreateFeedRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteFeedRequest.toObject = function toObject(message, options) { + CreateFeedRequest.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; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.feedId = ""; + object.feed = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.feedId != null && message.hasOwnProperty("feedId")) + object.feedId = message.feedId; + if (message.feed != null && message.hasOwnProperty("feed")) + object.feed = $root.google.cloud.asset.v1p2beta1.Feed.toObject(message.feed, options); return object; }; /** - * Converts this DeleteFeedRequest to JSON. + * Converts this CreateFeedRequest to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest * @instance * @returns {Object.} JSON object */ - DeleteFeedRequest.prototype.toJSON = function toJSON() { + CreateFeedRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeleteFeedRequest; + return CreateFeedRequest; })(); - v1p2beta1.OutputConfig = (function() { + v1p2beta1.GetFeedRequest = (function() { /** - * Properties of an OutputConfig. + * Properties of a GetFeedRequest. * @memberof google.cloud.asset.v1p2beta1 - * @interface IOutputConfig - * @property {google.cloud.asset.v1p2beta1.IGcsDestination|null} [gcsDestination] OutputConfig gcsDestination - * @property {google.cloud.asset.v1p2beta1.IBigQueryDestination|null} [bigqueryDestination] OutputConfig bigqueryDestination + * @interface IGetFeedRequest + * @property {string|null} [name] GetFeedRequest name */ /** - * Constructs a new OutputConfig. + * Constructs a new GetFeedRequest. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents an OutputConfig. - * @implements IOutputConfig + * @classdesc Represents a GetFeedRequest. + * @implements IGetFeedRequest * @constructor - * @param {google.cloud.asset.v1p2beta1.IOutputConfig=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest=} [properties] Properties to set */ - function OutputConfig(properties) { + function GetFeedRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10380,102 +12096,75 @@ } /** - * OutputConfig gcsDestination. - * @member {google.cloud.asset.v1p2beta1.IGcsDestination|null|undefined} gcsDestination - * @memberof google.cloud.asset.v1p2beta1.OutputConfig - * @instance - */ - OutputConfig.prototype.gcsDestination = null; - - /** - * OutputConfig bigqueryDestination. - * @member {google.cloud.asset.v1p2beta1.IBigQueryDestination|null|undefined} bigqueryDestination - * @memberof google.cloud.asset.v1p2beta1.OutputConfig - * @instance - */ - OutputConfig.prototype.bigqueryDestination = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * OutputConfig destination. - * @member {"gcsDestination"|"bigqueryDestination"|undefined} destination - * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * GetFeedRequest name. + * @member {string} name + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest * @instance */ - Object.defineProperty(OutputConfig.prototype, "destination", { - get: $util.oneOfGetter($oneOfFields = ["gcsDestination", "bigqueryDestination"]), - set: $util.oneOfSetter($oneOfFields) - }); + GetFeedRequest.prototype.name = ""; /** - * Creates a new OutputConfig instance using the specified properties. + * Creates a new GetFeedRequest instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.IOutputConfig=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.OutputConfig} OutputConfig instance + * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.GetFeedRequest} GetFeedRequest instance */ - OutputConfig.create = function create(properties) { - return new OutputConfig(properties); + GetFeedRequest.create = function create(properties) { + return new GetFeedRequest(properties); }; /** - * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1p2beta1.OutputConfig.verify|verify} messages. + * Encodes the specified GetFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.GetFeedRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest} message GetFeedRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OutputConfig.encode = function encode(message, writer) { + GetFeedRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) - $root.google.cloud.asset.v1p2beta1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) - $root.google.cloud.asset.v1p2beta1.BigQueryDestination.encode(message.bigqueryDestination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.OutputConfig.verify|verify} messages. + * Encodes the specified GetFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.GetFeedRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest} message GetFeedRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + GetFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OutputConfig message from the specified reader or buffer. + * Decodes a GetFeedRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.OutputConfig} OutputConfig + * @returns {google.cloud.asset.v1p2beta1.GetFeedRequest} GetFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OutputConfig.decode = function decode(reader, length) { + GetFeedRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.OutputConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.GetFeedRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.gcsDestination = $root.google.cloud.asset.v1p2beta1.GcsDestination.decode(reader, reader.uint32()); - break; - case 2: - message.bigqueryDestination = $root.google.cloud.asset.v1p2beta1.BigQueryDestination.decode(reader, reader.uint32()); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -10486,138 +12175,107 @@ }; /** - * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * Decodes a GetFeedRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.OutputConfig} OutputConfig + * @returns {google.cloud.asset.v1p2beta1.GetFeedRequest} GetFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OutputConfig.decodeDelimited = function decodeDelimited(reader) { + GetFeedRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an OutputConfig message. + * Verifies a GetFeedRequest message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - OutputConfig.verify = function verify(message) { + GetFeedRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { - properties.destination = 1; - { - var error = $root.google.cloud.asset.v1p2beta1.GcsDestination.verify(message.gcsDestination); - if (error) - return "gcsDestination." + error; - } - } - if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { - if (properties.destination === 1) - return "destination: multiple values"; - properties.destination = 1; - { - var error = $root.google.cloud.asset.v1p2beta1.BigQueryDestination.verify(message.bigqueryDestination); - if (error) - return "bigqueryDestination." + error; - } - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a GetFeedRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.OutputConfig} OutputConfig + * @returns {google.cloud.asset.v1p2beta1.GetFeedRequest} GetFeedRequest */ - OutputConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.OutputConfig) + GetFeedRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.GetFeedRequest) return object; - var message = new $root.google.cloud.asset.v1p2beta1.OutputConfig(); - if (object.gcsDestination != null) { - if (typeof object.gcsDestination !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.OutputConfig.gcsDestination: object expected"); - message.gcsDestination = $root.google.cloud.asset.v1p2beta1.GcsDestination.fromObject(object.gcsDestination); - } - if (object.bigqueryDestination != null) { - if (typeof object.bigqueryDestination !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.OutputConfig.bigqueryDestination: object expected"); - message.bigqueryDestination = $root.google.cloud.asset.v1p2beta1.BigQueryDestination.fromObject(object.bigqueryDestination); - } + var message = new $root.google.cloud.asset.v1p2beta1.GetFeedRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * Creates a plain object from a GetFeedRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.OutputConfig} message OutputConfig + * @param {google.cloud.asset.v1p2beta1.GetFeedRequest} message GetFeedRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OutputConfig.toObject = function toObject(message, options) { + GetFeedRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { - object.gcsDestination = $root.google.cloud.asset.v1p2beta1.GcsDestination.toObject(message.gcsDestination, options); - if (options.oneofs) - object.destination = "gcsDestination"; - } - if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { - object.bigqueryDestination = $root.google.cloud.asset.v1p2beta1.BigQueryDestination.toObject(message.bigqueryDestination, options); - if (options.oneofs) - object.destination = "bigqueryDestination"; - } + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this OutputConfig to JSON. + * Converts this GetFeedRequest to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest * @instance * @returns {Object.} JSON object */ - OutputConfig.prototype.toJSON = function toJSON() { + GetFeedRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return OutputConfig; + return GetFeedRequest; })(); - v1p2beta1.GcsDestination = (function() { + v1p2beta1.ListFeedsRequest = (function() { /** - * Properties of a GcsDestination. + * Properties of a ListFeedsRequest. * @memberof google.cloud.asset.v1p2beta1 - * @interface IGcsDestination - * @property {string|null} [uri] GcsDestination uri - * @property {string|null} [uriPrefix] GcsDestination uriPrefix + * @interface IListFeedsRequest + * @property {string|null} [parent] ListFeedsRequest parent */ /** - * Constructs a new GcsDestination. + * Constructs a new ListFeedsRequest. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a GcsDestination. - * @implements IGcsDestination + * @classdesc Represents a ListFeedsRequest. + * @implements IListFeedsRequest * @constructor - * @param {google.cloud.asset.v1p2beta1.IGcsDestination=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest=} [properties] Properties to set */ - function GcsDestination(properties) { + function ListFeedsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10625,102 +12283,75 @@ } /** - * GcsDestination uri. - * @member {string} uri - * @memberof google.cloud.asset.v1p2beta1.GcsDestination - * @instance - */ - GcsDestination.prototype.uri = ""; - - /** - * GcsDestination uriPrefix. - * @member {string} uriPrefix - * @memberof google.cloud.asset.v1p2beta1.GcsDestination - * @instance - */ - GcsDestination.prototype.uriPrefix = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GcsDestination objectUri. - * @member {"uri"|"uriPrefix"|undefined} objectUri - * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * ListFeedsRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest * @instance */ - Object.defineProperty(GcsDestination.prototype, "objectUri", { - get: $util.oneOfGetter($oneOfFields = ["uri", "uriPrefix"]), - set: $util.oneOfSetter($oneOfFields) - }); + ListFeedsRequest.prototype.parent = ""; /** - * Creates a new GcsDestination instance using the specified properties. + * Creates a new ListFeedsRequest instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest * @static - * @param {google.cloud.asset.v1p2beta1.IGcsDestination=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.GcsDestination} GcsDestination instance + * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.ListFeedsRequest} ListFeedsRequest instance */ - GcsDestination.create = function create(properties) { - return new GcsDestination(properties); + ListFeedsRequest.create = function create(properties) { + return new ListFeedsRequest(properties); }; /** - * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1p2beta1.GcsDestination.verify|verify} messages. + * Encodes the specified ListFeedsRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest * @static - * @param {google.cloud.asset.v1p2beta1.IGcsDestination} message GcsDestination message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest} message ListFeedsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GcsDestination.encode = function encode(message, writer) { + ListFeedsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.uri != null && message.hasOwnProperty("uri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); - if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.uriPrefix); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); return writer; }; /** - * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.GcsDestination.verify|verify} messages. + * Encodes the specified ListFeedsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest * @static - * @param {google.cloud.asset.v1p2beta1.IGcsDestination} message GcsDestination message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest} message ListFeedsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GcsDestination.encodeDelimited = function encodeDelimited(message, writer) { + ListFeedsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GcsDestination message from the specified reader or buffer. + * Decodes a ListFeedsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.GcsDestination} GcsDestination + * @returns {google.cloud.asset.v1p2beta1.ListFeedsRequest} ListFeedsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GcsDestination.decode = function decode(reader, length) { + ListFeedsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.GcsDestination(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.ListFeedsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.uri = reader.string(); - break; - case 2: - message.uriPrefix = reader.string(); + message.parent = reader.string(); break; default: reader.skipType(tag & 7); @@ -10731,127 +12362,108 @@ }; /** - * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * Decodes a ListFeedsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.GcsDestination} GcsDestination + * @returns {google.cloud.asset.v1p2beta1.ListFeedsRequest} ListFeedsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GcsDestination.decodeDelimited = function decodeDelimited(reader) { + ListFeedsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GcsDestination message. + * Verifies a ListFeedsRequest message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GcsDestination.verify = function verify(message) { + ListFeedsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.uri != null && message.hasOwnProperty("uri")) { - properties.objectUri = 1; - if (!$util.isString(message.uri)) - return "uri: string expected"; - } - if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) { - if (properties.objectUri === 1) - return "objectUri: multiple values"; - properties.objectUri = 1; - if (!$util.isString(message.uriPrefix)) - return "uriPrefix: string expected"; - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; return null; }; /** - * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * Creates a ListFeedsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.GcsDestination} GcsDestination + * @returns {google.cloud.asset.v1p2beta1.ListFeedsRequest} ListFeedsRequest */ - GcsDestination.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.GcsDestination) + ListFeedsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.ListFeedsRequest) return object; - var message = new $root.google.cloud.asset.v1p2beta1.GcsDestination(); - if (object.uri != null) - message.uri = String(object.uri); - if (object.uriPrefix != null) - message.uriPrefix = String(object.uriPrefix); + var message = new $root.google.cloud.asset.v1p2beta1.ListFeedsRequest(); + if (object.parent != null) + message.parent = String(object.parent); return message; }; /** - * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * Creates a plain object from a ListFeedsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest * @static - * @param {google.cloud.asset.v1p2beta1.GcsDestination} message GcsDestination + * @param {google.cloud.asset.v1p2beta1.ListFeedsRequest} message ListFeedsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GcsDestination.toObject = function toObject(message, options) { + ListFeedsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.uri != null && message.hasOwnProperty("uri")) { - object.uri = message.uri; - if (options.oneofs) - object.objectUri = "uri"; - } - if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) { - object.uriPrefix = message.uriPrefix; - if (options.oneofs) - object.objectUri = "uriPrefix"; - } + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; return object; }; /** - * Converts this GcsDestination to JSON. + * Converts this ListFeedsRequest to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest * @instance * @returns {Object.} JSON object */ - GcsDestination.prototype.toJSON = function toJSON() { + ListFeedsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GcsDestination; + return ListFeedsRequest; })(); - v1p2beta1.BigQueryDestination = (function() { + v1p2beta1.ListFeedsResponse = (function() { /** - * Properties of a BigQueryDestination. + * Properties of a ListFeedsResponse. * @memberof google.cloud.asset.v1p2beta1 - * @interface IBigQueryDestination - * @property {string|null} [dataset] BigQueryDestination dataset - * @property {string|null} [table] BigQueryDestination table - * @property {boolean|null} [force] BigQueryDestination force + * @interface IListFeedsResponse + * @property {Array.|null} [feeds] ListFeedsResponse feeds */ /** - * Constructs a new BigQueryDestination. + * Constructs a new ListFeedsResponse. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a BigQueryDestination. - * @implements IBigQueryDestination + * @classdesc Represents a ListFeedsResponse. + * @implements IListFeedsResponse * @constructor - * @param {google.cloud.asset.v1p2beta1.IBigQueryDestination=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.IListFeedsResponse=} [properties] Properties to set */ - function BigQueryDestination(properties) { + function ListFeedsResponse(properties) { + this.feeds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10859,101 +12471,78 @@ } /** - * BigQueryDestination dataset. - * @member {string} dataset - * @memberof google.cloud.asset.v1p2beta1.BigQueryDestination - * @instance - */ - BigQueryDestination.prototype.dataset = ""; - - /** - * BigQueryDestination table. - * @member {string} table - * @memberof google.cloud.asset.v1p2beta1.BigQueryDestination - * @instance - */ - BigQueryDestination.prototype.table = ""; - - /** - * BigQueryDestination force. - * @member {boolean} force - * @memberof google.cloud.asset.v1p2beta1.BigQueryDestination + * ListFeedsResponse feeds. + * @member {Array.} feeds + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse * @instance */ - BigQueryDestination.prototype.force = false; + ListFeedsResponse.prototype.feeds = $util.emptyArray; /** - * Creates a new BigQueryDestination instance using the specified properties. + * Creates a new ListFeedsResponse instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.BigQueryDestination + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse * @static - * @param {google.cloud.asset.v1p2beta1.IBigQueryDestination=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.BigQueryDestination} BigQueryDestination instance + * @param {google.cloud.asset.v1p2beta1.IListFeedsResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.ListFeedsResponse} ListFeedsResponse instance */ - BigQueryDestination.create = function create(properties) { - return new BigQueryDestination(properties); + ListFeedsResponse.create = function create(properties) { + return new ListFeedsResponse(properties); }; /** - * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.asset.v1p2beta1.BigQueryDestination.verify|verify} messages. + * Encodes the specified ListFeedsResponse message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.BigQueryDestination + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse * @static - * @param {google.cloud.asset.v1p2beta1.IBigQueryDestination} message BigQueryDestination message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IListFeedsResponse} message ListFeedsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BigQueryDestination.encode = function encode(message, writer) { + ListFeedsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.dataset != null && message.hasOwnProperty("dataset")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); - if (message.table != null && message.hasOwnProperty("table")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.table); - if (message.force != null && message.hasOwnProperty("force")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); + if (message.feeds != null && message.feeds.length) + for (var i = 0; i < message.feeds.length; ++i) + $root.google.cloud.asset.v1p2beta1.Feed.encode(message.feeds[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.BigQueryDestination.verify|verify} messages. + * Encodes the specified ListFeedsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.BigQueryDestination + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse * @static - * @param {google.cloud.asset.v1p2beta1.IBigQueryDestination} message BigQueryDestination message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IListFeedsResponse} message ListFeedsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BigQueryDestination.encodeDelimited = function encodeDelimited(message, writer) { + ListFeedsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BigQueryDestination message from the specified reader or buffer. + * Decodes a ListFeedsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.BigQueryDestination + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.BigQueryDestination} BigQueryDestination + * @returns {google.cloud.asset.v1p2beta1.ListFeedsResponse} ListFeedsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BigQueryDestination.decode = function decode(reader, length) { + ListFeedsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.BigQueryDestination(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.ListFeedsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.dataset = reader.string(); - break; - case 2: - message.table = reader.string(); - break; - case 3: - message.force = reader.bool(); + if (!(message.feeds && message.feeds.length)) + message.feeds = []; + message.feeds.push($root.google.cloud.asset.v1p2beta1.Feed.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -10964,124 +12553,125 @@ }; /** - * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. + * Decodes a ListFeedsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.BigQueryDestination + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.BigQueryDestination} BigQueryDestination + * @returns {google.cloud.asset.v1p2beta1.ListFeedsResponse} ListFeedsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BigQueryDestination.decodeDelimited = function decodeDelimited(reader) { + ListFeedsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BigQueryDestination message. + * Verifies a ListFeedsResponse message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.BigQueryDestination + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BigQueryDestination.verify = function verify(message) { + ListFeedsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.dataset != null && message.hasOwnProperty("dataset")) - if (!$util.isString(message.dataset)) - return "dataset: string expected"; - if (message.table != null && message.hasOwnProperty("table")) - if (!$util.isString(message.table)) - return "table: string expected"; - if (message.force != null && message.hasOwnProperty("force")) - if (typeof message.force !== "boolean") - return "force: boolean expected"; + if (message.feeds != null && message.hasOwnProperty("feeds")) { + if (!Array.isArray(message.feeds)) + return "feeds: array expected"; + for (var i = 0; i < message.feeds.length; ++i) { + var error = $root.google.cloud.asset.v1p2beta1.Feed.verify(message.feeds[i]); + if (error) + return "feeds." + error; + } + } return null; }; /** - * Creates a BigQueryDestination message from a plain object. Also converts values to their respective internal types. + * Creates a ListFeedsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.BigQueryDestination + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.BigQueryDestination} BigQueryDestination + * @returns {google.cloud.asset.v1p2beta1.ListFeedsResponse} ListFeedsResponse */ - BigQueryDestination.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.BigQueryDestination) + ListFeedsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.ListFeedsResponse) return object; - var message = new $root.google.cloud.asset.v1p2beta1.BigQueryDestination(); - if (object.dataset != null) - message.dataset = String(object.dataset); - if (object.table != null) - message.table = String(object.table); - if (object.force != null) - message.force = Boolean(object.force); + var message = new $root.google.cloud.asset.v1p2beta1.ListFeedsResponse(); + if (object.feeds) { + if (!Array.isArray(object.feeds)) + throw TypeError(".google.cloud.asset.v1p2beta1.ListFeedsResponse.feeds: array expected"); + message.feeds = []; + for (var i = 0; i < object.feeds.length; ++i) { + if (typeof object.feeds[i] !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.ListFeedsResponse.feeds: object expected"); + message.feeds[i] = $root.google.cloud.asset.v1p2beta1.Feed.fromObject(object.feeds[i]); + } + } return message; }; /** - * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. + * Creates a plain object from a ListFeedsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.BigQueryDestination + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse * @static - * @param {google.cloud.asset.v1p2beta1.BigQueryDestination} message BigQueryDestination + * @param {google.cloud.asset.v1p2beta1.ListFeedsResponse} message ListFeedsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BigQueryDestination.toObject = function toObject(message, options) { + ListFeedsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.dataset = ""; - object.table = ""; - object.force = false; + if (options.arrays || options.defaults) + object.feeds = []; + if (message.feeds && message.feeds.length) { + object.feeds = []; + for (var j = 0; j < message.feeds.length; ++j) + object.feeds[j] = $root.google.cloud.asset.v1p2beta1.Feed.toObject(message.feeds[j], options); } - if (message.dataset != null && message.hasOwnProperty("dataset")) - object.dataset = message.dataset; - if (message.table != null && message.hasOwnProperty("table")) - object.table = message.table; - if (message.force != null && message.hasOwnProperty("force")) - object.force = message.force; return object; }; /** - * Converts this BigQueryDestination to JSON. + * Converts this ListFeedsResponse to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.BigQueryDestination + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse * @instance * @returns {Object.} JSON object */ - BigQueryDestination.prototype.toJSON = function toJSON() { + ListFeedsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return BigQueryDestination; + return ListFeedsResponse; })(); - v1p2beta1.PubsubDestination = (function() { + v1p2beta1.UpdateFeedRequest = (function() { /** - * Properties of a PubsubDestination. + * Properties of an UpdateFeedRequest. * @memberof google.cloud.asset.v1p2beta1 - * @interface IPubsubDestination - * @property {string|null} [topic] PubsubDestination topic + * @interface IUpdateFeedRequest + * @property {google.cloud.asset.v1p2beta1.IFeed|null} [feed] UpdateFeedRequest feed + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateFeedRequest updateMask */ /** - * Constructs a new PubsubDestination. + * Constructs a new UpdateFeedRequest. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a PubsubDestination. - * @implements IPubsubDestination + * @classdesc Represents an UpdateFeedRequest. + * @implements IUpdateFeedRequest * @constructor - * @param {google.cloud.asset.v1p2beta1.IPubsubDestination=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest=} [properties] Properties to set */ - function PubsubDestination(properties) { + function UpdateFeedRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11089,75 +12679,88 @@ } /** - * PubsubDestination topic. - * @member {string} topic - * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * UpdateFeedRequest feed. + * @member {google.cloud.asset.v1p2beta1.IFeed|null|undefined} feed + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest * @instance */ - PubsubDestination.prototype.topic = ""; + UpdateFeedRequest.prototype.feed = null; /** - * Creates a new PubsubDestination instance using the specified properties. + * UpdateFeedRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * @instance + */ + UpdateFeedRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateFeedRequest instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.IPubsubDestination=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.PubsubDestination} PubsubDestination instance + * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.UpdateFeedRequest} UpdateFeedRequest instance */ - PubsubDestination.create = function create(properties) { - return new PubsubDestination(properties); + UpdateFeedRequest.create = function create(properties) { + return new UpdateFeedRequest(properties); }; /** - * Encodes the specified PubsubDestination message. Does not implicitly {@link google.cloud.asset.v1p2beta1.PubsubDestination.verify|verify} messages. + * Encodes the specified UpdateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.UpdateFeedRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.IPubsubDestination} message PubsubDestination message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest} message UpdateFeedRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PubsubDestination.encode = function encode(message, writer) { + UpdateFeedRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.topic != null && message.hasOwnProperty("topic")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); + if (message.feed != null && message.hasOwnProperty("feed")) + $root.google.cloud.asset.v1p2beta1.Feed.encode(message.feed, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified PubsubDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.PubsubDestination.verify|verify} messages. + * Encodes the specified UpdateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.UpdateFeedRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.IPubsubDestination} message PubsubDestination message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest} message UpdateFeedRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PubsubDestination.encodeDelimited = function encodeDelimited(message, writer) { + UpdateFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PubsubDestination message from the specified reader or buffer. + * Decodes an UpdateFeedRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.PubsubDestination} PubsubDestination + * @returns {google.cloud.asset.v1p2beta1.UpdateFeedRequest} UpdateFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PubsubDestination.decode = function decode(reader, length) { + UpdateFeedRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.PubsubDestination(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.UpdateFeedRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.topic = reader.string(); + message.feed = $root.google.cloud.asset.v1p2beta1.Feed.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -11168,129 +12771,126 @@ }; /** - * Decodes a PubsubDestination message from the specified reader or buffer, length delimited. + * Decodes an UpdateFeedRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.PubsubDestination} PubsubDestination + * @returns {google.cloud.asset.v1p2beta1.UpdateFeedRequest} UpdateFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PubsubDestination.decodeDelimited = function decodeDelimited(reader) { + UpdateFeedRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PubsubDestination message. + * Verifies an UpdateFeedRequest message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PubsubDestination.verify = function verify(message) { + UpdateFeedRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.topic != null && message.hasOwnProperty("topic")) - if (!$util.isString(message.topic)) - return "topic: string expected"; + if (message.feed != null && message.hasOwnProperty("feed")) { + var error = $root.google.cloud.asset.v1p2beta1.Feed.verify(message.feed); + if (error) + return "feed." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } return null; }; /** - * Creates a PubsubDestination message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateFeedRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.PubsubDestination} PubsubDestination + * @returns {google.cloud.asset.v1p2beta1.UpdateFeedRequest} UpdateFeedRequest */ - PubsubDestination.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.PubsubDestination) + UpdateFeedRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.UpdateFeedRequest) return object; - var message = new $root.google.cloud.asset.v1p2beta1.PubsubDestination(); - if (object.topic != null) - message.topic = String(object.topic); + var message = new $root.google.cloud.asset.v1p2beta1.UpdateFeedRequest(); + if (object.feed != null) { + if (typeof object.feed !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.UpdateFeedRequest.feed: object expected"); + message.feed = $root.google.cloud.asset.v1p2beta1.Feed.fromObject(object.feed); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.UpdateFeedRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } return message; }; /** - * Creates a plain object from a PubsubDestination message. Also converts values to other types if specified. + * Creates a plain object from an UpdateFeedRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.PubsubDestination} message PubsubDestination + * @param {google.cloud.asset.v1p2beta1.UpdateFeedRequest} message UpdateFeedRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PubsubDestination.toObject = function toObject(message, options) { + UpdateFeedRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.topic = ""; - if (message.topic != null && message.hasOwnProperty("topic")) - object.topic = message.topic; + if (options.defaults) { + object.feed = null; + object.updateMask = null; + } + if (message.feed != null && message.hasOwnProperty("feed")) + object.feed = $root.google.cloud.asset.v1p2beta1.Feed.toObject(message.feed, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this PubsubDestination to JSON. + * Converts this UpdateFeedRequest to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest * @instance * @returns {Object.} JSON object */ - PubsubDestination.prototype.toJSON = function toJSON() { + UpdateFeedRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return PubsubDestination; - })(); - - /** - * ContentType enum. - * @name google.cloud.asset.v1p2beta1.ContentType - * @enum {string} - * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value - * @property {number} RESOURCE=1 RESOURCE value - * @property {number} IAM_POLICY=2 IAM_POLICY value - * @property {number} IAM_POLICY_NAME=3 IAM_POLICY_NAME value - * @property {number} ORG_POLICY=4 ORG_POLICY value - * @property {number} ACCESS_POLICY=5 ACCESS_POLICY value - */ - v1p2beta1.ContentType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CONTENT_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RESOURCE"] = 1; - values[valuesById[2] = "IAM_POLICY"] = 2; - values[valuesById[3] = "IAM_POLICY_NAME"] = 3; - values[valuesById[4] = "ORG_POLICY"] = 4; - values[valuesById[5] = "ACCESS_POLICY"] = 5; - return values; + return UpdateFeedRequest; })(); - v1p2beta1.FeedOutputConfig = (function() { + v1p2beta1.DeleteFeedRequest = (function() { /** - * Properties of a FeedOutputConfig. + * Properties of a DeleteFeedRequest. * @memberof google.cloud.asset.v1p2beta1 - * @interface IFeedOutputConfig - * @property {google.cloud.asset.v1p2beta1.IPubsubDestination|null} [pubsubDestination] FeedOutputConfig pubsubDestination + * @interface IDeleteFeedRequest + * @property {string|null} [name] DeleteFeedRequest name */ /** - * Constructs a new FeedOutputConfig. + * Constructs a new DeleteFeedRequest. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a FeedOutputConfig. - * @implements IFeedOutputConfig + * @classdesc Represents a DeleteFeedRequest. + * @implements IDeleteFeedRequest * @constructor - * @param {google.cloud.asset.v1p2beta1.IFeedOutputConfig=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest=} [properties] Properties to set */ - function FeedOutputConfig(properties) { + function DeleteFeedRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11298,89 +12898,75 @@ } /** - * FeedOutputConfig pubsubDestination. - * @member {google.cloud.asset.v1p2beta1.IPubsubDestination|null|undefined} pubsubDestination - * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig - * @instance - */ - FeedOutputConfig.prototype.pubsubDestination = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * FeedOutputConfig destination. - * @member {"pubsubDestination"|undefined} destination - * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * DeleteFeedRequest name. + * @member {string} name + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest * @instance */ - Object.defineProperty(FeedOutputConfig.prototype, "destination", { - get: $util.oneOfGetter($oneOfFields = ["pubsubDestination"]), - set: $util.oneOfSetter($oneOfFields) - }); + DeleteFeedRequest.prototype.name = ""; /** - * Creates a new FeedOutputConfig instance using the specified properties. + * Creates a new DeleteFeedRequest instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.IFeedOutputConfig=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.FeedOutputConfig} FeedOutputConfig instance + * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.DeleteFeedRequest} DeleteFeedRequest instance */ - FeedOutputConfig.create = function create(properties) { - return new FeedOutputConfig(properties); + DeleteFeedRequest.create = function create(properties) { + return new DeleteFeedRequest(properties); }; /** - * Encodes the specified FeedOutputConfig message. Does not implicitly {@link google.cloud.asset.v1p2beta1.FeedOutputConfig.verify|verify} messages. + * Encodes the specified DeleteFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.DeleteFeedRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.IFeedOutputConfig} message FeedOutputConfig message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest} message DeleteFeedRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FeedOutputConfig.encode = function encode(message, writer) { + DeleteFeedRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.pubsubDestination != null && message.hasOwnProperty("pubsubDestination")) - $root.google.cloud.asset.v1p2beta1.PubsubDestination.encode(message.pubsubDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified FeedOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.FeedOutputConfig.verify|verify} messages. + * Encodes the specified DeleteFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.DeleteFeedRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.IFeedOutputConfig} message FeedOutputConfig message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest} message DeleteFeedRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FeedOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + DeleteFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FeedOutputConfig message from the specified reader or buffer. + * Decodes a DeleteFeedRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.FeedOutputConfig} FeedOutputConfig + * @returns {google.cloud.asset.v1p2beta1.DeleteFeedRequest} DeleteFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FeedOutputConfig.decode = function decode(reader, length) { + DeleteFeedRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.FeedOutputConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.DeleteFeedRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.pubsubDestination = $root.google.cloud.asset.v1p2beta1.PubsubDestination.decode(reader, reader.uint32()); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -11391,123 +12977,107 @@ }; /** - * Decodes a FeedOutputConfig message from the specified reader or buffer, length delimited. + * Decodes a DeleteFeedRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.FeedOutputConfig} FeedOutputConfig + * @returns {google.cloud.asset.v1p2beta1.DeleteFeedRequest} DeleteFeedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FeedOutputConfig.decodeDelimited = function decodeDelimited(reader) { + DeleteFeedRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FeedOutputConfig message. + * Verifies a DeleteFeedRequest message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - FeedOutputConfig.verify = function verify(message) { + DeleteFeedRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.pubsubDestination != null && message.hasOwnProperty("pubsubDestination")) { - properties.destination = 1; - { - var error = $root.google.cloud.asset.v1p2beta1.PubsubDestination.verify(message.pubsubDestination); - if (error) - return "pubsubDestination." + error; - } - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a FeedOutputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteFeedRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.FeedOutputConfig} FeedOutputConfig + * @returns {google.cloud.asset.v1p2beta1.DeleteFeedRequest} DeleteFeedRequest */ - FeedOutputConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.FeedOutputConfig) + DeleteFeedRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.DeleteFeedRequest) return object; - var message = new $root.google.cloud.asset.v1p2beta1.FeedOutputConfig(); - if (object.pubsubDestination != null) { - if (typeof object.pubsubDestination !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.FeedOutputConfig.pubsubDestination: object expected"); - message.pubsubDestination = $root.google.cloud.asset.v1p2beta1.PubsubDestination.fromObject(object.pubsubDestination); - } + var message = new $root.google.cloud.asset.v1p2beta1.DeleteFeedRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a FeedOutputConfig message. Also converts values to other types if specified. + * Creates a plain object from a DeleteFeedRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest * @static - * @param {google.cloud.asset.v1p2beta1.FeedOutputConfig} message FeedOutputConfig + * @param {google.cloud.asset.v1p2beta1.DeleteFeedRequest} message DeleteFeedRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FeedOutputConfig.toObject = function toObject(message, options) { + DeleteFeedRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.pubsubDestination != null && message.hasOwnProperty("pubsubDestination")) { - object.pubsubDestination = $root.google.cloud.asset.v1p2beta1.PubsubDestination.toObject(message.pubsubDestination, options); - if (options.oneofs) - object.destination = "pubsubDestination"; - } + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this FeedOutputConfig to JSON. + * Converts this DeleteFeedRequest to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest * @instance * @returns {Object.} JSON object */ - FeedOutputConfig.prototype.toJSON = function toJSON() { + DeleteFeedRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return FeedOutputConfig; + return DeleteFeedRequest; })(); - v1p2beta1.Feed = (function() { + v1p2beta1.OutputConfig = (function() { /** - * Properties of a Feed. + * Properties of an OutputConfig. * @memberof google.cloud.asset.v1p2beta1 - * @interface IFeed - * @property {string|null} [name] Feed name - * @property {Array.|null} [assetNames] Feed assetNames - * @property {Array.|null} [assetTypes] Feed assetTypes - * @property {google.cloud.asset.v1p2beta1.ContentType|null} [contentType] Feed contentType - * @property {google.cloud.asset.v1p2beta1.IFeedOutputConfig|null} [feedOutputConfig] Feed feedOutputConfig + * @interface IOutputConfig + * @property {google.cloud.asset.v1p2beta1.IGcsDestination|null} [gcsDestination] OutputConfig gcsDestination */ /** - * Constructs a new Feed. + * Constructs a new OutputConfig. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a Feed. - * @implements IFeed + * @classdesc Represents an OutputConfig. + * @implements IOutputConfig * @constructor - * @param {google.cloud.asset.v1p2beta1.IFeed=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.IOutputConfig=} [properties] Properties to set */ - function Feed(properties) { - this.assetNames = []; - this.assetTypes = []; + function OutputConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11515,133 +13085,89 @@ } /** - * Feed name. - * @member {string} name - * @memberof google.cloud.asset.v1p2beta1.Feed - * @instance - */ - Feed.prototype.name = ""; - - /** - * Feed assetNames. - * @member {Array.} assetNames - * @memberof google.cloud.asset.v1p2beta1.Feed - * @instance - */ - Feed.prototype.assetNames = $util.emptyArray; - - /** - * Feed assetTypes. - * @member {Array.} assetTypes - * @memberof google.cloud.asset.v1p2beta1.Feed + * OutputConfig gcsDestination. + * @member {google.cloud.asset.v1p2beta1.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.asset.v1p2beta1.OutputConfig * @instance */ - Feed.prototype.assetTypes = $util.emptyArray; + OutputConfig.prototype.gcsDestination = null; - /** - * Feed contentType. - * @member {google.cloud.asset.v1p2beta1.ContentType} contentType - * @memberof google.cloud.asset.v1p2beta1.Feed - * @instance - */ - Feed.prototype.contentType = 0; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Feed feedOutputConfig. - * @member {google.cloud.asset.v1p2beta1.IFeedOutputConfig|null|undefined} feedOutputConfig - * @memberof google.cloud.asset.v1p2beta1.Feed + * OutputConfig destination. + * @member {"gcsDestination"|undefined} destination + * @memberof google.cloud.asset.v1p2beta1.OutputConfig * @instance */ - Feed.prototype.feedOutputConfig = null; + Object.defineProperty(OutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new Feed instance using the specified properties. + * Creates a new OutputConfig instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.Feed + * @memberof google.cloud.asset.v1p2beta1.OutputConfig * @static - * @param {google.cloud.asset.v1p2beta1.IFeed=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.Feed} Feed instance + * @param {google.cloud.asset.v1p2beta1.IOutputConfig=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.OutputConfig} OutputConfig instance */ - Feed.create = function create(properties) { - return new Feed(properties); + OutputConfig.create = function create(properties) { + return new OutputConfig(properties); }; /** - * Encodes the specified Feed message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Feed.verify|verify} messages. + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1p2beta1.OutputConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.Feed + * @memberof google.cloud.asset.v1p2beta1.OutputConfig * @static - * @param {google.cloud.asset.v1p2beta1.IFeed} message Feed message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IOutputConfig} message OutputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Feed.encode = function encode(message, writer) { + OutputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.assetNames != null && message.assetNames.length) - for (var i = 0; i < message.assetNames.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetNames[i]); - if (message.assetTypes != null && message.assetTypes.length) - for (var i = 0; i < message.assetTypes.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); - if (message.contentType != null && message.hasOwnProperty("contentType")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.contentType); - if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) - $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.encode(message.feedOutputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) + $root.google.cloud.asset.v1p2beta1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified Feed message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Feed.verify|verify} messages. + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.OutputConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.Feed + * @memberof google.cloud.asset.v1p2beta1.OutputConfig * @static - * @param {google.cloud.asset.v1p2beta1.IFeed} message Feed message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IOutputConfig} message OutputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Feed.encodeDelimited = function encodeDelimited(message, writer) { + OutputConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Feed message from the specified reader or buffer. + * Decodes an OutputConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.Feed + * @memberof google.cloud.asset.v1p2beta1.OutputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.Feed} Feed + * @returns {google.cloud.asset.v1p2beta1.OutputConfig} OutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Feed.decode = function decode(reader, length) { + OutputConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.Feed(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.OutputConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.assetNames && message.assetNames.length)) - message.assetNames = []; - message.assetNames.push(reader.string()); - break; - case 3: - if (!(message.assetTypes && message.assetTypes.length)) - message.assetTypes = []; - message.assetTypes.push(reader.string()); - break; - case 4: - message.contentType = reader.int32(); - break; - case 5: - message.feedOutputConfig = $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.decode(reader, reader.uint32()); + message.gcsDestination = $root.google.cloud.asset.v1p2beta1.GcsDestination.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -11652,206 +13178,117 @@ }; /** - * Decodes a Feed message from the specified reader or buffer, length delimited. + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.Feed + * @memberof google.cloud.asset.v1p2beta1.OutputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.Feed} Feed + * @returns {google.cloud.asset.v1p2beta1.OutputConfig} OutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Feed.decodeDelimited = function decodeDelimited(reader) { + OutputConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Feed message. + * Verifies an OutputConfig message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.Feed + * @memberof google.cloud.asset.v1p2beta1.OutputConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Feed.verify = function verify(message) { + OutputConfig.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.assetNames != null && message.hasOwnProperty("assetNames")) { - if (!Array.isArray(message.assetNames)) - return "assetNames: array expected"; - for (var i = 0; i < message.assetNames.length; ++i) - if (!$util.isString(message.assetNames[i])) - return "assetNames: string[] expected"; - } - if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { - if (!Array.isArray(message.assetTypes)) - return "assetTypes: array expected"; - for (var i = 0; i < message.assetTypes.length; ++i) - if (!$util.isString(message.assetTypes[i])) - return "assetTypes: string[] expected"; - } - if (message.contentType != null && message.hasOwnProperty("contentType")) - switch (message.contentType) { - default: - return "contentType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; + var properties = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.asset.v1p2beta1.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; } - if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) { - var error = $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.verify(message.feedOutputConfig); - if (error) - return "feedOutputConfig." + error; } return null; }; /** - * Creates a Feed message from a plain object. Also converts values to their respective internal types. + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.Feed + * @memberof google.cloud.asset.v1p2beta1.OutputConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.Feed} Feed + * @returns {google.cloud.asset.v1p2beta1.OutputConfig} OutputConfig */ - Feed.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.Feed) + OutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.OutputConfig) return object; - var message = new $root.google.cloud.asset.v1p2beta1.Feed(); - if (object.name != null) - message.name = String(object.name); - if (object.assetNames) { - if (!Array.isArray(object.assetNames)) - throw TypeError(".google.cloud.asset.v1p2beta1.Feed.assetNames: array expected"); - message.assetNames = []; - for (var i = 0; i < object.assetNames.length; ++i) - message.assetNames[i] = String(object.assetNames[i]); - } - if (object.assetTypes) { - if (!Array.isArray(object.assetTypes)) - throw TypeError(".google.cloud.asset.v1p2beta1.Feed.assetTypes: array expected"); - message.assetTypes = []; - for (var i = 0; i < object.assetTypes.length; ++i) - message.assetTypes[i] = String(object.assetTypes[i]); - } - switch (object.contentType) { - case "CONTENT_TYPE_UNSPECIFIED": - case 0: - message.contentType = 0; - break; - case "RESOURCE": - case 1: - message.contentType = 1; - break; - case "IAM_POLICY": - case 2: - message.contentType = 2; - break; - case "IAM_POLICY_NAME": - case 3: - message.contentType = 3; - break; - case "ORG_POLICY": - case 4: - message.contentType = 4; - break; - case "ACCESS_POLICY": - case 5: - message.contentType = 5; - break; - } - if (object.feedOutputConfig != null) { - if (typeof object.feedOutputConfig !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.Feed.feedOutputConfig: object expected"); - message.feedOutputConfig = $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.fromObject(object.feedOutputConfig); + var message = new $root.google.cloud.asset.v1p2beta1.OutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.OutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.asset.v1p2beta1.GcsDestination.fromObject(object.gcsDestination); } return message; }; /** - * Creates a plain object from a Feed message. Also converts values to other types if specified. + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.Feed + * @memberof google.cloud.asset.v1p2beta1.OutputConfig * @static - * @param {google.cloud.asset.v1p2beta1.Feed} message Feed + * @param {google.cloud.asset.v1p2beta1.OutputConfig} message OutputConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Feed.toObject = function toObject(message, options) { + OutputConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.assetNames = []; - object.assetTypes = []; - } - if (options.defaults) { - object.name = ""; - object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; - object.feedOutputConfig = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.assetNames && message.assetNames.length) { - object.assetNames = []; - for (var j = 0; j < message.assetNames.length; ++j) - object.assetNames[j] = message.assetNames[j]; - } - if (message.assetTypes && message.assetTypes.length) { - object.assetTypes = []; - for (var j = 0; j < message.assetTypes.length; ++j) - object.assetTypes[j] = message.assetTypes[j]; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.asset.v1p2beta1.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; } - if (message.contentType != null && message.hasOwnProperty("contentType")) - object.contentType = options.enums === String ? $root.google.cloud.asset.v1p2beta1.ContentType[message.contentType] : message.contentType; - if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) - object.feedOutputConfig = $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.toObject(message.feedOutputConfig, options); return object; }; /** - * Converts this Feed to JSON. + * Converts this OutputConfig to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.Feed + * @memberof google.cloud.asset.v1p2beta1.OutputConfig * @instance * @returns {Object.} JSON object */ - Feed.prototype.toJSON = function toJSON() { + OutputConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Feed; + return OutputConfig; })(); - v1p2beta1.TemporalAsset = (function() { + v1p2beta1.GcsDestination = (function() { /** - * Properties of a TemporalAsset. + * Properties of a GcsDestination. * @memberof google.cloud.asset.v1p2beta1 - * @interface ITemporalAsset - * @property {google.cloud.asset.v1p2beta1.ITimeWindow|null} [window] TemporalAsset window - * @property {boolean|null} [deleted] TemporalAsset deleted - * @property {google.cloud.asset.v1p2beta1.IAsset|null} [asset] TemporalAsset asset + * @interface IGcsDestination + * @property {string|null} [uri] GcsDestination uri */ /** - * Constructs a new TemporalAsset. + * Constructs a new GcsDestination. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a TemporalAsset. - * @implements ITemporalAsset + * @classdesc Represents a GcsDestination. + * @implements IGcsDestination * @constructor - * @param {google.cloud.asset.v1p2beta1.ITemporalAsset=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.IGcsDestination=} [properties] Properties to set */ - function TemporalAsset(properties) { + function GcsDestination(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11859,101 +13296,89 @@ } /** - * TemporalAsset window. - * @member {google.cloud.asset.v1p2beta1.ITimeWindow|null|undefined} window - * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * GcsDestination uri. + * @member {string} uri + * @memberof google.cloud.asset.v1p2beta1.GcsDestination * @instance */ - TemporalAsset.prototype.window = null; + GcsDestination.prototype.uri = ""; - /** - * TemporalAsset deleted. - * @member {boolean} deleted - * @memberof google.cloud.asset.v1p2beta1.TemporalAsset - * @instance - */ - TemporalAsset.prototype.deleted = false; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * TemporalAsset asset. - * @member {google.cloud.asset.v1p2beta1.IAsset|null|undefined} asset - * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * GcsDestination objectUri. + * @member {"uri"|undefined} objectUri + * @memberof google.cloud.asset.v1p2beta1.GcsDestination * @instance */ - TemporalAsset.prototype.asset = null; + Object.defineProperty(GcsDestination.prototype, "objectUri", { + get: $util.oneOfGetter($oneOfFields = ["uri"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new TemporalAsset instance using the specified properties. + * Creates a new GcsDestination instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @memberof google.cloud.asset.v1p2beta1.GcsDestination * @static - * @param {google.cloud.asset.v1p2beta1.ITemporalAsset=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.TemporalAsset} TemporalAsset instance + * @param {google.cloud.asset.v1p2beta1.IGcsDestination=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.GcsDestination} GcsDestination instance */ - TemporalAsset.create = function create(properties) { - return new TemporalAsset(properties); + GcsDestination.create = function create(properties) { + return new GcsDestination(properties); }; /** - * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1p2beta1.TemporalAsset.verify|verify} messages. + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1p2beta1.GcsDestination.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @memberof google.cloud.asset.v1p2beta1.GcsDestination * @static - * @param {google.cloud.asset.v1p2beta1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IGcsDestination} message GcsDestination message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TemporalAsset.encode = function encode(message, writer) { + GcsDestination.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.window != null && message.hasOwnProperty("window")) - $root.google.cloud.asset.v1p2beta1.TimeWindow.encode(message.window, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.deleted != null && message.hasOwnProperty("deleted")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deleted); - if (message.asset != null && message.hasOwnProperty("asset")) - $root.google.cloud.asset.v1p2beta1.Asset.encode(message.asset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.uri != null && message.hasOwnProperty("uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); return writer; }; /** - * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.TemporalAsset.verify|verify} messages. + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.GcsDestination.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @memberof google.cloud.asset.v1p2beta1.GcsDestination * @static - * @param {google.cloud.asset.v1p2beta1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IGcsDestination} message GcsDestination message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TemporalAsset.encodeDelimited = function encodeDelimited(message, writer) { + GcsDestination.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TemporalAsset message from the specified reader or buffer. + * Decodes a GcsDestination message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @memberof google.cloud.asset.v1p2beta1.GcsDestination * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.TemporalAsset} TemporalAsset + * @returns {google.cloud.asset.v1p2beta1.GcsDestination} GcsDestination * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TemporalAsset.decode = function decode(reader, length) { + GcsDestination.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.TemporalAsset(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.window = $root.google.cloud.asset.v1p2beta1.TimeWindow.decode(reader, reader.uint32()); - break; - case 2: - message.deleted = reader.bool(); - break; - case 3: - message.asset = $root.google.cloud.asset.v1p2beta1.Asset.decode(reader, reader.uint32()); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.GcsDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uri = reader.string(); break; default: reader.skipType(tag & 7); @@ -11964,135 +13389,111 @@ }; /** - * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @memberof google.cloud.asset.v1p2beta1.GcsDestination * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.TemporalAsset} TemporalAsset + * @returns {google.cloud.asset.v1p2beta1.GcsDestination} GcsDestination * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TemporalAsset.decodeDelimited = function decodeDelimited(reader) { + GcsDestination.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TemporalAsset message. + * Verifies a GcsDestination message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @memberof google.cloud.asset.v1p2beta1.GcsDestination * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TemporalAsset.verify = function verify(message) { + GcsDestination.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.window != null && message.hasOwnProperty("window")) { - var error = $root.google.cloud.asset.v1p2beta1.TimeWindow.verify(message.window); - if (error) - return "window." + error; - } - if (message.deleted != null && message.hasOwnProperty("deleted")) - if (typeof message.deleted !== "boolean") - return "deleted: boolean expected"; - if (message.asset != null && message.hasOwnProperty("asset")) { - var error = $root.google.cloud.asset.v1p2beta1.Asset.verify(message.asset); - if (error) - return "asset." + error; + var properties = {}; + if (message.uri != null && message.hasOwnProperty("uri")) { + properties.objectUri = 1; + if (!$util.isString(message.uri)) + return "uri: string expected"; } return null; }; /** - * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @memberof google.cloud.asset.v1p2beta1.GcsDestination * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.TemporalAsset} TemporalAsset + * @returns {google.cloud.asset.v1p2beta1.GcsDestination} GcsDestination */ - TemporalAsset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.TemporalAsset) + GcsDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.GcsDestination) return object; - var message = new $root.google.cloud.asset.v1p2beta1.TemporalAsset(); - if (object.window != null) { - if (typeof object.window !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.TemporalAsset.window: object expected"); - message.window = $root.google.cloud.asset.v1p2beta1.TimeWindow.fromObject(object.window); - } - if (object.deleted != null) - message.deleted = Boolean(object.deleted); - if (object.asset != null) { - if (typeof object.asset !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.TemporalAsset.asset: object expected"); - message.asset = $root.google.cloud.asset.v1p2beta1.Asset.fromObject(object.asset); - } + var message = new $root.google.cloud.asset.v1p2beta1.GcsDestination(); + if (object.uri != null) + message.uri = String(object.uri); return message; }; /** - * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @memberof google.cloud.asset.v1p2beta1.GcsDestination * @static - * @param {google.cloud.asset.v1p2beta1.TemporalAsset} message TemporalAsset + * @param {google.cloud.asset.v1p2beta1.GcsDestination} message GcsDestination * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TemporalAsset.toObject = function toObject(message, options) { + GcsDestination.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.window = null; - object.deleted = false; - object.asset = null; + if (message.uri != null && message.hasOwnProperty("uri")) { + object.uri = message.uri; + if (options.oneofs) + object.objectUri = "uri"; } - if (message.window != null && message.hasOwnProperty("window")) - object.window = $root.google.cloud.asset.v1p2beta1.TimeWindow.toObject(message.window, options); - if (message.deleted != null && message.hasOwnProperty("deleted")) - object.deleted = message.deleted; - if (message.asset != null && message.hasOwnProperty("asset")) - object.asset = $root.google.cloud.asset.v1p2beta1.Asset.toObject(message.asset, options); return object; }; /** - * Converts this TemporalAsset to JSON. + * Converts this GcsDestination to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @memberof google.cloud.asset.v1p2beta1.GcsDestination * @instance * @returns {Object.} JSON object */ - TemporalAsset.prototype.toJSON = function toJSON() { + GcsDestination.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TemporalAsset; + return GcsDestination; })(); - v1p2beta1.TimeWindow = (function() { + v1p2beta1.PubsubDestination = (function() { /** - * Properties of a TimeWindow. + * Properties of a PubsubDestination. * @memberof google.cloud.asset.v1p2beta1 - * @interface ITimeWindow - * @property {google.protobuf.ITimestamp|null} [startTime] TimeWindow startTime - * @property {google.protobuf.ITimestamp|null} [endTime] TimeWindow endTime + * @interface IPubsubDestination + * @property {string|null} [topic] PubsubDestination topic */ /** - * Constructs a new TimeWindow. + * Constructs a new PubsubDestination. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a TimeWindow. - * @implements ITimeWindow + * @classdesc Represents a PubsubDestination. + * @implements IPubsubDestination * @constructor - * @param {google.cloud.asset.v1p2beta1.ITimeWindow=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.IPubsubDestination=} [properties] Properties to set */ - function TimeWindow(properties) { + function PubsubDestination(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12100,88 +13501,75 @@ } /** - * TimeWindow startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.asset.v1p2beta1.TimeWindow - * @instance - */ - TimeWindow.prototype.startTime = null; - - /** - * TimeWindow endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * PubsubDestination topic. + * @member {string} topic + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination * @instance */ - TimeWindow.prototype.endTime = null; + PubsubDestination.prototype.topic = ""; /** - * Creates a new TimeWindow instance using the specified properties. + * Creates a new PubsubDestination instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination * @static - * @param {google.cloud.asset.v1p2beta1.ITimeWindow=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.TimeWindow} TimeWindow instance + * @param {google.cloud.asset.v1p2beta1.IPubsubDestination=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.PubsubDestination} PubsubDestination instance */ - TimeWindow.create = function create(properties) { - return new TimeWindow(properties); + PubsubDestination.create = function create(properties) { + return new PubsubDestination(properties); }; /** - * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1p2beta1.TimeWindow.verify|verify} messages. + * Encodes the specified PubsubDestination message. Does not implicitly {@link google.cloud.asset.v1p2beta1.PubsubDestination.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination * @static - * @param {google.cloud.asset.v1p2beta1.ITimeWindow} message TimeWindow message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IPubsubDestination} message PubsubDestination message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeWindow.encode = function encode(message, writer) { + PubsubDestination.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.startTime != null && message.hasOwnProperty("startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.endTime != null && message.hasOwnProperty("endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.topic != null && message.hasOwnProperty("topic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); return writer; }; /** - * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.TimeWindow.verify|verify} messages. + * Encodes the specified PubsubDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.PubsubDestination.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination * @static - * @param {google.cloud.asset.v1p2beta1.ITimeWindow} message TimeWindow message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IPubsubDestination} message PubsubDestination message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeWindow.encodeDelimited = function encodeDelimited(message, writer) { + PubsubDestination.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TimeWindow message from the specified reader or buffer. + * Decodes a PubsubDestination message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.TimeWindow} TimeWindow + * @returns {google.cloud.asset.v1p2beta1.PubsubDestination} PubsubDestination * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TimeWindow.decode = function decode(reader, length) { + PubsubDestination.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.TimeWindow(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.PubsubDestination(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 2: - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.topic = reader.string(); break; default: reader.skipType(tag & 7); @@ -12192,132 +13580,107 @@ }; /** - * Decodes a TimeWindow message from the specified reader or buffer, length delimited. + * Decodes a PubsubDestination message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.TimeWindow} TimeWindow + * @returns {google.cloud.asset.v1p2beta1.PubsubDestination} PubsubDestination * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TimeWindow.decodeDelimited = function decodeDelimited(reader) { + PubsubDestination.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TimeWindow message. + * Verifies a PubsubDestination message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TimeWindow.verify = function verify(message) { + PubsubDestination.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } + if (message.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: string expected"; return null; }; /** - * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. + * Creates a PubsubDestination message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.TimeWindow} TimeWindow + * @returns {google.cloud.asset.v1p2beta1.PubsubDestination} PubsubDestination */ - TimeWindow.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.TimeWindow) + PubsubDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.PubsubDestination) return object; - var message = new $root.google.cloud.asset.v1p2beta1.TimeWindow(); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.TimeWindow.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.TimeWindow.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } + var message = new $root.google.cloud.asset.v1p2beta1.PubsubDestination(); + if (object.topic != null) + message.topic = String(object.topic); return message; }; /** - * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. + * Creates a plain object from a PubsubDestination message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination * @static - * @param {google.cloud.asset.v1p2beta1.TimeWindow} message TimeWindow + * @param {google.cloud.asset.v1p2beta1.PubsubDestination} message PubsubDestination * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TimeWindow.toObject = function toObject(message, options) { + PubsubDestination.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.startTime = null; - object.endTime = null; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (options.defaults) + object.topic = ""; + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; return object; }; /** - * Converts this TimeWindow to JSON. + * Converts this PubsubDestination to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination * @instance * @returns {Object.} JSON object */ - TimeWindow.prototype.toJSON = function toJSON() { + PubsubDestination.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TimeWindow; + return PubsubDestination; })(); - v1p2beta1.Asset = (function() { + v1p2beta1.FeedOutputConfig = (function() { /** - * Properties of an Asset. + * Properties of a FeedOutputConfig. * @memberof google.cloud.asset.v1p2beta1 - * @interface IAsset - * @property {string|null} [name] Asset name - * @property {string|null} [assetType] Asset assetType - * @property {google.cloud.asset.v1p2beta1.IResource|null} [resource] Asset resource - * @property {google.iam.v1.IPolicy|null} [iamPolicy] Asset iamPolicy - * @property {Uint8Array|null} [iamPolicyName] Asset iamPolicyName - * @property {Array.|null} [ancestors] Asset ancestors + * @interface IFeedOutputConfig + * @property {google.cloud.asset.v1p2beta1.IPubsubDestination|null} [pubsubDestination] FeedOutputConfig pubsubDestination */ /** - * Constructs a new Asset. + * Constructs a new FeedOutputConfig. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents an Asset. - * @implements IAsset + * @classdesc Represents a FeedOutputConfig. + * @implements IFeedOutputConfig * @constructor - * @param {google.cloud.asset.v1p2beta1.IAsset=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.IFeedOutputConfig=} [properties] Properties to set */ - function Asset(properties) { - this.ancestors = []; + function FeedOutputConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12325,143 +13688,89 @@ } /** - * Asset name. - * @member {string} name - * @memberof google.cloud.asset.v1p2beta1.Asset - * @instance - */ - Asset.prototype.name = ""; - - /** - * Asset assetType. - * @member {string} assetType - * @memberof google.cloud.asset.v1p2beta1.Asset - * @instance - */ - Asset.prototype.assetType = ""; - - /** - * Asset resource. - * @member {google.cloud.asset.v1p2beta1.IResource|null|undefined} resource - * @memberof google.cloud.asset.v1p2beta1.Asset - * @instance - */ - Asset.prototype.resource = null; - - /** - * Asset iamPolicy. - * @member {google.iam.v1.IPolicy|null|undefined} iamPolicy - * @memberof google.cloud.asset.v1p2beta1.Asset + * FeedOutputConfig pubsubDestination. + * @member {google.cloud.asset.v1p2beta1.IPubsubDestination|null|undefined} pubsubDestination + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig * @instance */ - Asset.prototype.iamPolicy = null; + FeedOutputConfig.prototype.pubsubDestination = null; - /** - * Asset iamPolicyName. - * @member {Uint8Array} iamPolicyName - * @memberof google.cloud.asset.v1p2beta1.Asset - * @instance - */ - Asset.prototype.iamPolicyName = $util.newBuffer([]); + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Asset ancestors. - * @member {Array.} ancestors - * @memberof google.cloud.asset.v1p2beta1.Asset + * FeedOutputConfig destination. + * @member {"pubsubDestination"|undefined} destination + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig * @instance */ - Asset.prototype.ancestors = $util.emptyArray; + Object.defineProperty(FeedOutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["pubsubDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new Asset instance using the specified properties. + * Creates a new FeedOutputConfig instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.Asset + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig * @static - * @param {google.cloud.asset.v1p2beta1.IAsset=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.Asset} Asset instance + * @param {google.cloud.asset.v1p2beta1.IFeedOutputConfig=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.FeedOutputConfig} FeedOutputConfig instance */ - Asset.create = function create(properties) { - return new Asset(properties); + FeedOutputConfig.create = function create(properties) { + return new FeedOutputConfig(properties); }; /** - * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Asset.verify|verify} messages. + * Encodes the specified FeedOutputConfig message. Does not implicitly {@link google.cloud.asset.v1p2beta1.FeedOutputConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.Asset + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig * @static - * @param {google.cloud.asset.v1p2beta1.IAsset} message Asset message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IFeedOutputConfig} message FeedOutputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Asset.encode = function encode(message, writer) { + FeedOutputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.assetType != null && message.hasOwnProperty("assetType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); - if (message.resource != null && message.hasOwnProperty("resource")) - $root.google.cloud.asset.v1p2beta1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) - $root.google.iam.v1.Policy.encode(message.iamPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.iamPolicyName != null && message.hasOwnProperty("iamPolicyName")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.iamPolicyName); - if (message.ancestors != null && message.ancestors.length) - for (var i = 0; i < message.ancestors.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.ancestors[i]); + if (message.pubsubDestination != null && message.hasOwnProperty("pubsubDestination")) + $root.google.cloud.asset.v1p2beta1.PubsubDestination.encode(message.pubsubDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Asset.verify|verify} messages. + * Encodes the specified FeedOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.FeedOutputConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.Asset + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig * @static - * @param {google.cloud.asset.v1p2beta1.IAsset} message Asset message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IFeedOutputConfig} message FeedOutputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Asset.encodeDelimited = function encodeDelimited(message, writer) { + FeedOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Asset message from the specified reader or buffer. + * Decodes a FeedOutputConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.Asset + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.Asset} Asset + * @returns {google.cloud.asset.v1p2beta1.FeedOutputConfig} FeedOutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Asset.decode = function decode(reader, length) { + FeedOutputConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.Asset(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.FeedOutputConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); - break; - case 2: - message.assetType = reader.string(); - break; - case 3: - message.resource = $root.google.cloud.asset.v1p2beta1.Resource.decode(reader, reader.uint32()); - break; - case 4: - message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); - break; - case 5: - message.iamPolicyName = reader.bytes(); - break; - case 6: - if (!(message.ancestors && message.ancestors.length)) - message.ancestors = []; - message.ancestors.push(reader.string()); + message.pubsubDestination = $root.google.cloud.asset.v1p2beta1.PubsubDestination.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -12472,186 +13781,123 @@ }; /** - * Decodes an Asset message from the specified reader or buffer, length delimited. + * Decodes a FeedOutputConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.Asset + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.Asset} Asset + * @returns {google.cloud.asset.v1p2beta1.FeedOutputConfig} FeedOutputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Asset.decodeDelimited = function decodeDelimited(reader) { + FeedOutputConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Asset message. + * Verifies a FeedOutputConfig message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.Asset + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Asset.verify = function verify(message) { + FeedOutputConfig.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.assetType != null && message.hasOwnProperty("assetType")) - if (!$util.isString(message.assetType)) - return "assetType: string expected"; - if (message.resource != null && message.hasOwnProperty("resource")) { - var error = $root.google.cloud.asset.v1p2beta1.Resource.verify(message.resource); - if (error) - return "resource." + error; - } - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { - var error = $root.google.iam.v1.Policy.verify(message.iamPolicy); - if (error) - return "iamPolicy." + error; - } - if (message.iamPolicyName != null && message.hasOwnProperty("iamPolicyName")) - if (!(message.iamPolicyName && typeof message.iamPolicyName.length === "number" || $util.isString(message.iamPolicyName))) - return "iamPolicyName: buffer expected"; - if (message.ancestors != null && message.hasOwnProperty("ancestors")) { - if (!Array.isArray(message.ancestors)) - return "ancestors: array expected"; - for (var i = 0; i < message.ancestors.length; ++i) - if (!$util.isString(message.ancestors[i])) - return "ancestors: string[] expected"; + var properties = {}; + if (message.pubsubDestination != null && message.hasOwnProperty("pubsubDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.asset.v1p2beta1.PubsubDestination.verify(message.pubsubDestination); + if (error) + return "pubsubDestination." + error; + } } return null; }; /** - * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * Creates a FeedOutputConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.Asset + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.Asset} Asset + * @returns {google.cloud.asset.v1p2beta1.FeedOutputConfig} FeedOutputConfig */ - Asset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.Asset) + FeedOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.FeedOutputConfig) return object; - var message = new $root.google.cloud.asset.v1p2beta1.Asset(); - if (object.name != null) - message.name = String(object.name); - if (object.assetType != null) - message.assetType = String(object.assetType); - if (object.resource != null) { - if (typeof object.resource !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.Asset.resource: object expected"); - message.resource = $root.google.cloud.asset.v1p2beta1.Resource.fromObject(object.resource); - } - if (object.iamPolicy != null) { - if (typeof object.iamPolicy !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.Asset.iamPolicy: object expected"); - message.iamPolicy = $root.google.iam.v1.Policy.fromObject(object.iamPolicy); - } - if (object.iamPolicyName != null) - if (typeof object.iamPolicyName === "string") - $util.base64.decode(object.iamPolicyName, message.iamPolicyName = $util.newBuffer($util.base64.length(object.iamPolicyName)), 0); - else if (object.iamPolicyName.length) - message.iamPolicyName = object.iamPolicyName; - if (object.ancestors) { - if (!Array.isArray(object.ancestors)) - throw TypeError(".google.cloud.asset.v1p2beta1.Asset.ancestors: array expected"); - message.ancestors = []; - for (var i = 0; i < object.ancestors.length; ++i) - message.ancestors[i] = String(object.ancestors[i]); - } - return message; - }; - - /** - * Creates a plain object from an Asset message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1p2beta1.Asset - * @static - * @param {google.cloud.asset.v1p2beta1.Asset} message Asset - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Asset.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.ancestors = []; - if (options.defaults) { - object.name = ""; - object.assetType = ""; - object.resource = null; - object.iamPolicy = null; - if (options.bytes === String) - object.iamPolicyName = ""; - else { - object.iamPolicyName = []; - if (options.bytes !== Array) - object.iamPolicyName = $util.newBuffer(object.iamPolicyName); - } - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.assetType != null && message.hasOwnProperty("assetType")) - object.assetType = message.assetType; - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = $root.google.cloud.asset.v1p2beta1.Resource.toObject(message.resource, options); - if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) - object.iamPolicy = $root.google.iam.v1.Policy.toObject(message.iamPolicy, options); - if (message.iamPolicyName != null && message.hasOwnProperty("iamPolicyName")) - object.iamPolicyName = options.bytes === String ? $util.base64.encode(message.iamPolicyName, 0, message.iamPolicyName.length) : options.bytes === Array ? Array.prototype.slice.call(message.iamPolicyName) : message.iamPolicyName; - if (message.ancestors && message.ancestors.length) { - object.ancestors = []; - for (var j = 0; j < message.ancestors.length; ++j) - object.ancestors[j] = message.ancestors[j]; + var message = new $root.google.cloud.asset.v1p2beta1.FeedOutputConfig(); + if (object.pubsubDestination != null) { + if (typeof object.pubsubDestination !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.FeedOutputConfig.pubsubDestination: object expected"); + message.pubsubDestination = $root.google.cloud.asset.v1p2beta1.PubsubDestination.fromObject(object.pubsubDestination); + } + return message; + }; + + /** + * Creates a plain object from a FeedOutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @static + * @param {google.cloud.asset.v1p2beta1.FeedOutputConfig} message FeedOutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeedOutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.pubsubDestination != null && message.hasOwnProperty("pubsubDestination")) { + object.pubsubDestination = $root.google.cloud.asset.v1p2beta1.PubsubDestination.toObject(message.pubsubDestination, options); + if (options.oneofs) + object.destination = "pubsubDestination"; } return object; }; /** - * Converts this Asset to JSON. + * Converts this FeedOutputConfig to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.Asset + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig * @instance * @returns {Object.} JSON object */ - Asset.prototype.toJSON = function toJSON() { + FeedOutputConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Asset; + return FeedOutputConfig; })(); - v1p2beta1.Resource = (function() { + v1p2beta1.Feed = (function() { /** - * Properties of a Resource. + * Properties of a Feed. * @memberof google.cloud.asset.v1p2beta1 - * @interface IResource - * @property {string|null} [version] Resource version - * @property {string|null} [discoveryDocumentUri] Resource discoveryDocumentUri - * @property {string|null} [discoveryName] Resource discoveryName - * @property {string|null} [resourceUrl] Resource resourceUrl - * @property {string|null} [parent] Resource parent - * @property {google.protobuf.IStruct|null} [data] Resource data - * @property {google.protobuf.IAny|null} [internalData] Resource internalData + * @interface IFeed + * @property {string|null} [name] Feed name + * @property {Array.|null} [assetNames] Feed assetNames + * @property {Array.|null} [assetTypes] Feed assetTypes + * @property {google.cloud.asset.v1p2beta1.ContentType|null} [contentType] Feed contentType + * @property {google.cloud.asset.v1p2beta1.IFeedOutputConfig|null} [feedOutputConfig] Feed feedOutputConfig */ /** - * Constructs a new Resource. + * Constructs a new Feed. * @memberof google.cloud.asset.v1p2beta1 - * @classdesc Represents a Resource. - * @implements IResource + * @classdesc Represents a Feed. + * @implements IFeed * @constructor - * @param {google.cloud.asset.v1p2beta1.IResource=} [properties] Properties to set + * @param {google.cloud.asset.v1p2beta1.IFeed=} [properties] Properties to set */ - function Resource(properties) { + function Feed(properties) { + this.assetNames = []; + this.assetTypes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12659,153 +13905,133 @@ } /** - * Resource version. - * @member {string} version - * @memberof google.cloud.asset.v1p2beta1.Resource - * @instance - */ - Resource.prototype.version = ""; - - /** - * Resource discoveryDocumentUri. - * @member {string} discoveryDocumentUri - * @memberof google.cloud.asset.v1p2beta1.Resource - * @instance - */ - Resource.prototype.discoveryDocumentUri = ""; - - /** - * Resource discoveryName. - * @member {string} discoveryName - * @memberof google.cloud.asset.v1p2beta1.Resource + * Feed name. + * @member {string} name + * @memberof google.cloud.asset.v1p2beta1.Feed * @instance */ - Resource.prototype.discoveryName = ""; + Feed.prototype.name = ""; /** - * Resource resourceUrl. - * @member {string} resourceUrl - * @memberof google.cloud.asset.v1p2beta1.Resource + * Feed assetNames. + * @member {Array.} assetNames + * @memberof google.cloud.asset.v1p2beta1.Feed * @instance */ - Resource.prototype.resourceUrl = ""; + Feed.prototype.assetNames = $util.emptyArray; /** - * Resource parent. - * @member {string} parent - * @memberof google.cloud.asset.v1p2beta1.Resource + * Feed assetTypes. + * @member {Array.} assetTypes + * @memberof google.cloud.asset.v1p2beta1.Feed * @instance */ - Resource.prototype.parent = ""; + Feed.prototype.assetTypes = $util.emptyArray; /** - * Resource data. - * @member {google.protobuf.IStruct|null|undefined} data - * @memberof google.cloud.asset.v1p2beta1.Resource + * Feed contentType. + * @member {google.cloud.asset.v1p2beta1.ContentType} contentType + * @memberof google.cloud.asset.v1p2beta1.Feed * @instance */ - Resource.prototype.data = null; + Feed.prototype.contentType = 0; /** - * Resource internalData. - * @member {google.protobuf.IAny|null|undefined} internalData - * @memberof google.cloud.asset.v1p2beta1.Resource + * Feed feedOutputConfig. + * @member {google.cloud.asset.v1p2beta1.IFeedOutputConfig|null|undefined} feedOutputConfig + * @memberof google.cloud.asset.v1p2beta1.Feed * @instance */ - Resource.prototype.internalData = null; + Feed.prototype.feedOutputConfig = null; /** - * Creates a new Resource instance using the specified properties. + * Creates a new Feed instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1p2beta1.Resource + * @memberof google.cloud.asset.v1p2beta1.Feed * @static - * @param {google.cloud.asset.v1p2beta1.IResource=} [properties] Properties to set - * @returns {google.cloud.asset.v1p2beta1.Resource} Resource instance + * @param {google.cloud.asset.v1p2beta1.IFeed=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.Feed} Feed instance */ - Resource.create = function create(properties) { - return new Resource(properties); + Feed.create = function create(properties) { + return new Feed(properties); }; /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Resource.verify|verify} messages. + * Encodes the specified Feed message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Feed.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1p2beta1.Resource + * @memberof google.cloud.asset.v1p2beta1.Feed * @static - * @param {google.cloud.asset.v1p2beta1.IResource} message Resource message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IFeed} message Feed message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Resource.encode = function encode(message, writer) { + Feed.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.version != null && message.hasOwnProperty("version")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); - if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.discoveryDocumentUri); - if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.discoveryName); - if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceUrl); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); - if (message.data != null && message.hasOwnProperty("data")) - $root.google.protobuf.Struct.encode(message.data, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.internalData != null && message.hasOwnProperty("internalData")) - $root.google.protobuf.Any.encode(message.internalData, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.assetNames != null && message.assetNames.length) + for (var i = 0; i < message.assetNames.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetNames[i]); + if (message.assetTypes != null && message.assetTypes.length) + for (var i = 0; i < message.assetTypes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); + if (message.contentType != null && message.hasOwnProperty("contentType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.contentType); + if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) + $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.encode(message.feedOutputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Resource.verify|verify} messages. + * Encodes the specified Feed message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Feed.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1p2beta1.Resource + * @memberof google.cloud.asset.v1p2beta1.Feed * @static - * @param {google.cloud.asset.v1p2beta1.IResource} message Resource message or plain object to encode + * @param {google.cloud.asset.v1p2beta1.IFeed} message Feed message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Resource.encodeDelimited = function encodeDelimited(message, writer) { + Feed.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Resource message from the specified reader or buffer. + * Decodes a Feed message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1p2beta1.Resource + * @memberof google.cloud.asset.v1p2beta1.Feed * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p2beta1.Resource} Resource + * @returns {google.cloud.asset.v1p2beta1.Feed} Feed * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Resource.decode = function decode(reader, length) { + Feed.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.Resource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.Feed(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.version = reader.string(); + message.name = reader.string(); break; case 2: - message.discoveryDocumentUri = reader.string(); + if (!(message.assetNames && message.assetNames.length)) + message.assetNames = []; + message.assetNames.push(reader.string()); break; case 3: - message.discoveryName = reader.string(); + if (!(message.assetTypes && message.assetTypes.length)) + message.assetTypes = []; + message.assetTypes.push(reader.string()); break; case 4: - message.resourceUrl = reader.string(); + message.contentType = reader.int32(); break; case 5: - message.parent = reader.string(); - break; - case 6: - message.data = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - case 7: - message.internalData = $root.google.protobuf.Any.decode(reader, reader.uint32()); + message.feedOutputConfig = $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -12816,146 +14042,185 @@ }; /** - * Decodes a Resource message from the specified reader or buffer, length delimited. + * Decodes a Feed message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1p2beta1.Resource + * @memberof google.cloud.asset.v1p2beta1.Feed * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p2beta1.Resource} Resource + * @returns {google.cloud.asset.v1p2beta1.Feed} Feed * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Resource.decodeDelimited = function decodeDelimited(reader) { + Feed.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Resource message. + * Verifies a Feed message. * @function verify - * @memberof google.cloud.asset.v1p2beta1.Resource + * @memberof google.cloud.asset.v1p2beta1.Feed * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Resource.verify = function verify(message) { + Feed.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) - if (!$util.isString(message.discoveryDocumentUri)) - return "discoveryDocumentUri: string expected"; - if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) - if (!$util.isString(message.discoveryName)) - return "discoveryName: string expected"; - if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) - if (!$util.isString(message.resourceUrl)) - return "resourceUrl: string expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.data != null && message.hasOwnProperty("data")) { - var error = $root.google.protobuf.Struct.verify(message.data); - if (error) - return "data." + error; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.assetNames != null && message.hasOwnProperty("assetNames")) { + if (!Array.isArray(message.assetNames)) + return "assetNames: array expected"; + for (var i = 0; i < message.assetNames.length; ++i) + if (!$util.isString(message.assetNames[i])) + return "assetNames: string[] expected"; + } + if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { + if (!Array.isArray(message.assetTypes)) + return "assetTypes: array expected"; + for (var i = 0; i < message.assetTypes.length; ++i) + if (!$util.isString(message.assetTypes[i])) + return "assetTypes: string[] expected"; } - if (message.internalData != null && message.hasOwnProperty("internalData")) { - var error = $root.google.protobuf.Any.verify(message.internalData); + if (message.contentType != null && message.hasOwnProperty("contentType")) + switch (message.contentType) { + default: + return "contentType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) { + var error = $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.verify(message.feedOutputConfig); if (error) - return "internalData." + error; + return "feedOutputConfig." + error; } return null; }; /** - * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * Creates a Feed message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1p2beta1.Resource + * @memberof google.cloud.asset.v1p2beta1.Feed * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p2beta1.Resource} Resource + * @returns {google.cloud.asset.v1p2beta1.Feed} Feed */ - Resource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p2beta1.Resource) + Feed.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.Feed) return object; - var message = new $root.google.cloud.asset.v1p2beta1.Resource(); - if (object.version != null) - message.version = String(object.version); - if (object.discoveryDocumentUri != null) - message.discoveryDocumentUri = String(object.discoveryDocumentUri); - if (object.discoveryName != null) - message.discoveryName = String(object.discoveryName); - if (object.resourceUrl != null) - message.resourceUrl = String(object.resourceUrl); - if (object.parent != null) - message.parent = String(object.parent); - if (object.data != null) { - if (typeof object.data !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.Resource.data: object expected"); - message.data = $root.google.protobuf.Struct.fromObject(object.data); + var message = new $root.google.cloud.asset.v1p2beta1.Feed(); + if (object.name != null) + message.name = String(object.name); + if (object.assetNames) { + if (!Array.isArray(object.assetNames)) + throw TypeError(".google.cloud.asset.v1p2beta1.Feed.assetNames: array expected"); + message.assetNames = []; + for (var i = 0; i < object.assetNames.length; ++i) + message.assetNames[i] = String(object.assetNames[i]); } - if (object.internalData != null) { - if (typeof object.internalData !== "object") - throw TypeError(".google.cloud.asset.v1p2beta1.Resource.internalData: object expected"); - message.internalData = $root.google.protobuf.Any.fromObject(object.internalData); + if (object.assetTypes) { + if (!Array.isArray(object.assetTypes)) + throw TypeError(".google.cloud.asset.v1p2beta1.Feed.assetTypes: array expected"); + message.assetTypes = []; + for (var i = 0; i < object.assetTypes.length; ++i) + message.assetTypes[i] = String(object.assetTypes[i]); + } + switch (object.contentType) { + case "CONTENT_TYPE_UNSPECIFIED": + case 0: + message.contentType = 0; + break; + case "RESOURCE": + case 1: + message.contentType = 1; + break; + case "IAM_POLICY": + case 2: + message.contentType = 2; + break; + } + if (object.feedOutputConfig != null) { + if (typeof object.feedOutputConfig !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.Feed.feedOutputConfig: object expected"); + message.feedOutputConfig = $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.fromObject(object.feedOutputConfig); } return message; }; /** - * Creates a plain object from a Resource message. Also converts values to other types if specified. + * Creates a plain object from a Feed message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1p2beta1.Resource + * @memberof google.cloud.asset.v1p2beta1.Feed * @static - * @param {google.cloud.asset.v1p2beta1.Resource} message Resource + * @param {google.cloud.asset.v1p2beta1.Feed} message Feed * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Resource.toObject = function toObject(message, options) { + Feed.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) { + object.assetNames = []; + object.assetTypes = []; + } if (options.defaults) { - object.version = ""; - object.discoveryDocumentUri = ""; - object.discoveryName = ""; - object.resourceUrl = ""; - object.parent = ""; - object.data = null; - object.internalData = null; + object.name = ""; + object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; + object.feedOutputConfig = null; } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) - object.discoveryDocumentUri = message.discoveryDocumentUri; - if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) - object.discoveryName = message.discoveryName; - if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) - object.resourceUrl = message.resourceUrl; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.data != null && message.hasOwnProperty("data")) - object.data = $root.google.protobuf.Struct.toObject(message.data, options); - if (message.internalData != null && message.hasOwnProperty("internalData")) - object.internalData = $root.google.protobuf.Any.toObject(message.internalData, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.assetNames && message.assetNames.length) { + object.assetNames = []; + for (var j = 0; j < message.assetNames.length; ++j) + object.assetNames[j] = message.assetNames[j]; + } + if (message.assetTypes && message.assetTypes.length) { + object.assetTypes = []; + for (var j = 0; j < message.assetTypes.length; ++j) + object.assetTypes[j] = message.assetTypes[j]; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + object.contentType = options.enums === String ? $root.google.cloud.asset.v1p2beta1.ContentType[message.contentType] : message.contentType; + if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) + object.feedOutputConfig = $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.toObject(message.feedOutputConfig, options); return object; }; /** - * Converts this Resource to JSON. + * Converts this Feed to JSON. * @function toJSON - * @memberof google.cloud.asset.v1p2beta1.Resource + * @memberof google.cloud.asset.v1p2beta1.Feed * @instance * @returns {Object.} JSON object */ - Resource.prototype.toJSON = function toJSON() { + Feed.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Resource; + return Feed; + })(); + + /** + * ContentType enum. + * @name google.cloud.asset.v1p2beta1.ContentType + * @enum {string} + * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value + * @property {number} RESOURCE=1 RESOURCE value + * @property {number} IAM_POLICY=2 IAM_POLICY value + */ + v1p2beta1.ContentType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONTENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RESOURCE"] = 1; + values[valuesById[2] = "IAM_POLICY"] = 2; + return values; })(); return v1p2beta1; @@ -12976,26 +14241,30 @@ */ var api = {}; - api.Http = (function() { + api.ResourceDescriptor = (function() { /** - * Properties of a Http. + * Properties of a ResourceDescriptor. * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular */ /** - * Constructs a new Http. + * Constructs a new ResourceDescriptor. * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor * @constructor - * @param {google.api.IHttp=} [properties] Properties to set + * @param {google.api.IResourceDescriptor=} [properties] Properties to set */ - function Http(properties) { - this.rules = []; + function ResourceDescriptor(properties) { + this.pattern = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13003,91 +14272,143 @@ } /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor * @instance */ - Http.prototype.rules = $util.emptyArray; + ResourceDescriptor.prototype.type = ""; /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor * @instance */ - Http.prototype.fullyDecodeReservedExpansion = false; + ResourceDescriptor.prototype.pattern = $util.emptyArray; /** - * Creates a new Http instance using the specified properties. + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. * @function create - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.IHttp=} [properties] Properties to set - * @returns {google.api.Http} Http instance + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance */ - Http.create = function create(properties) { - return new Http(properties); + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); }; /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. * @function encode - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.IHttp} message Http message or plain object to encode + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Http.encode = function encode(message, writer) { + ResourceDescriptor.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.rules != null && message.rules.length) - for (var i = 0; i < message.rules.length; ++i) - $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && message.hasOwnProperty("nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && message.hasOwnProperty("history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && message.hasOwnProperty("plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && message.hasOwnProperty("singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); return writer; }; /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.IHttp} message Http message or plain object to encode + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Http.encodeDelimited = function encodeDelimited(message, writer) { + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Http message from the specified reader or buffer. + * Decodes a ResourceDescriptor message from the specified reader or buffer. * @function decode - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.Http} Http + * @returns {google.api.ResourceDescriptor} ResourceDescriptor * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Http.decode = function decode(reader, length) { + ResourceDescriptor.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + message.type = reader.string(); break; case 2: - message.fullyDecodeReservedExpansion = reader.bool(); + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + case 3: + message.nameField = reader.string(); + break; + case 4: + message.history = reader.int32(); + break; + case 5: + message.plural = reader.string(); + break; + case 6: + message.singular = reader.string(); break; default: reader.skipType(tag & 7); @@ -13098,353 +14419,285 @@ }; /** - * Decodes a Http message from the specified reader or buffer, length delimited. + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Http} Http + * @returns {google.api.ResourceDescriptor} ResourceDescriptor * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Http.decodeDelimited = function decodeDelimited(reader) { + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Http message. + * Verifies a ResourceDescriptor message. * @function verify - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Http.verify = function verify(message) { + ResourceDescriptor.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.rules != null && message.hasOwnProperty("rules")) { - if (!Array.isArray(message.rules)) - return "rules: array expected"; - for (var i = 0; i < message.rules.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.rules[i]); - if (error) - return "rules." + error; - } + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - if (typeof message.fullyDecodeReservedExpansion !== "boolean") - return "fullyDecodeReservedExpansion: boolean expected"; + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; return null; }; /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static * @param {Object.} object Plain object - * @returns {google.api.Http} Http + * @returns {google.api.ResourceDescriptor} ResourceDescriptor */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) return object; - var message = new $root.google.api.Http(); - if (object.rules) { - if (!Array.isArray(object.rules)) - throw TypeError(".google.api.Http.rules: array expected"); - message.rules = []; - for (var i = 0; i < object.rules.length; ++i) { - if (typeof object.rules[i] !== "object") - throw TypeError(".google.api.Http.rules: object expected"); - message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); - } + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); } - if (object.fullyDecodeReservedExpansion != null) - message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); return message; }; /** - * Creates a plain object from a Http message. Also converts values to other types if specified. + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.Http} message Http + * @param {google.api.ResourceDescriptor} message ResourceDescriptor * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Http.toObject = function toObject(message, options) { + ResourceDescriptor.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.rules = []; - if (options.defaults) - object.fullyDecodeReservedExpansion = false; - if (message.rules && message.rules.length) { - object.rules = []; - for (var j = 0; j < message.rules.length; ++j) - object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + object.pattern = []; + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; return object; }; /** - * Converts this Http to JSON. + * Converts this ResourceDescriptor to JSON. * @function toJSON - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @instance * @returns {Object.} JSON object */ - Http.prototype.toJSON = function toJSON() { + ResourceDescriptor.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Http; - })(); - - api.HttpRule = (function() { - - /** - * Properties of a HttpRule. - * @memberof google.api - * @interface IHttpRule - * @property {string|null} [selector] HttpRule selector - * @property {string|null} [get] HttpRule get - * @property {string|null} [put] HttpRule put - * @property {string|null} [post] HttpRule post - * @property {string|null} ["delete"] HttpRule delete - * @property {string|null} [patch] HttpRule patch - * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom - * @property {string|null} [body] HttpRule body - * @property {string|null} [responseBody] HttpRule responseBody - * @property {Array.|null} [additionalBindings] HttpRule additionalBindings - */ - - /** - * Constructs a new HttpRule. - * @memberof google.api - * @classdesc Represents a HttpRule. - * @implements IHttpRule - * @constructor - * @param {google.api.IHttpRule=} [properties] Properties to set - */ - function HttpRule(properties) { - this.additionalBindings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; - - /** - * HttpRule get. - * @member {string} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = ""; - - /** - * HttpRule put. - * @member {string} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = ""; - - /** - * HttpRule post. - * @member {string} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = ""; - - /** - * HttpRule delete. - * @member {string} delete - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype["delete"] = ""; - /** - * HttpRule patch. - * @member {string} patch - * @memberof google.api.HttpRule - * @instance + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {string} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value */ - HttpRule.prototype.patch = ""; + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); - /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.custom = null; + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule - * @instance + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType */ - HttpRule.prototype.body = ""; /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule - * @instance + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set */ - HttpRule.prototype.responseBody = ""; + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference * @instance */ - HttpRule.prototype.additionalBindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + ResourceReference.prototype.type = ""; /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference * @instance */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); + ResourceReference.prototype.childType = ""; /** - * Creates a new HttpRule instance using the specified properties. + * Creates a new ResourceReference instance using the specified properties. * @function create - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static - * @param {google.api.IHttpRule=} [properties] Properties to set - * @returns {google.api.HttpRule} HttpRule instance + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance */ - HttpRule.create = function create(properties) { - return new HttpRule(properties); + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); }; /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. * @function encode - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpRule.encode = function encode(message, writer) { + ResourceReference.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.selector != null && message.hasOwnProperty("selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && message.hasOwnProperty("get")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && message.hasOwnProperty("put")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && message.hasOwnProperty("post")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && message.hasOwnProperty("delete")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && message.hasOwnProperty("patch")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && message.hasOwnProperty("body")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && message.hasOwnProperty("custom")) - $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.additionalBindings != null && message.additionalBindings.length) - for (var i = 0; i < message.additionalBindings.length; ++i) - $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && message.hasOwnProperty("childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); return writer; }; /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HttpRule message from the specified reader or buffer. + * Decodes a ResourceReference message from the specified reader or buffer. * @function decode - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.HttpRule} HttpRule + * @returns {google.api.ResourceReference} ResourceReference * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HttpRule.decode = function decode(reader, length) { + ResourceReference.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.selector = reader.string(); + message.type = reader.string(); break; case 2: - message.get = reader.string(); - break; - case 3: - message.put = reader.string(); - break; - case 4: - message.post = reader.string(); - break; - case 5: - message["delete"] = reader.string(); - break; - case 6: - message.patch = reader.string(); - break; - case 8: - message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); - break; - case 7: - message.body = reader.string(); - break; - case 12: - message.responseBody = reader.string(); - break; - case 11: - if (!(message.additionalBindings && message.additionalBindings.length)) - message.additionalBindings = []; - message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + message.childType = reader.string(); break; default: reader.skipType(tag & 7); @@ -13455,240 +14708,118 @@ }; /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule + * @returns {google.api.ResourceReference} ResourceReference * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { + ResourceReference.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a HttpRule message. + * Verifies a ResourceReference message. * @function verify - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - HttpRule.verify = function verify(message) { + ResourceReference.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.get != null && message.hasOwnProperty("get")) { - properties.pattern = 1; - if (!$util.isString(message.get)) - return "get: string expected"; - } - if (message.put != null && message.hasOwnProperty("put")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.put)) - return "put: string expected"; - } - if (message.post != null && message.hasOwnProperty("post")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.post)) - return "post: string expected"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message["delete"])) - return "delete: string expected"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.patch)) - return "patch: string expected"; - } - if (message.custom != null && message.hasOwnProperty("custom")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - { - var error = $root.google.api.CustomHttpPattern.verify(message.custom); - if (error) - return "custom." + error; - } - } - if (message.body != null && message.hasOwnProperty("body")) - if (!$util.isString(message.body)) - return "body: string expected"; - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - if (!$util.isString(message.responseBody)) - return "responseBody: string expected"; - if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { - if (!Array.isArray(message.additionalBindings)) - return "additionalBindings: array expected"; - for (var i = 0; i < message.additionalBindings.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); - if (error) - return "additionalBindings." + error; - } - } + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; return null; }; /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule + * @returns {google.api.ResourceReference} ResourceReference */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) return object; - var message = new $root.google.api.HttpRule(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.get != null) - message.get = String(object.get); - if (object.put != null) - message.put = String(object.put); - if (object.post != null) - message.post = String(object.post); - if (object["delete"] != null) - message["delete"] = String(object["delete"]); - if (object.patch != null) - message.patch = String(object.patch); - if (object.custom != null) { - if (typeof object.custom !== "object") - throw TypeError(".google.api.HttpRule.custom: object expected"); - message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); - } - if (object.body != null) - message.body = String(object.body); - if (object.responseBody != null) - message.responseBody = String(object.responseBody); - if (object.additionalBindings) { - if (!Array.isArray(object.additionalBindings)) - throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); - message.additionalBindings = []; - for (var i = 0; i < object.additionalBindings.length; ++i) { - if (typeof object.additionalBindings[i] !== "object") - throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); - message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); - } - } + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); return message; }; /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static - * @param {google.api.HttpRule} message HttpRule + * @param {google.api.ResourceReference} message ResourceReference * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HttpRule.toObject = function toObject(message, options) { + ResourceReference.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.additionalBindings = []; if (options.defaults) { - object.selector = ""; - object.body = ""; - object.responseBody = ""; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.get != null && message.hasOwnProperty("get")) { - object.get = message.get; - if (options.oneofs) - object.pattern = "get"; - } - if (message.put != null && message.hasOwnProperty("put")) { - object.put = message.put; - if (options.oneofs) - object.pattern = "put"; - } - if (message.post != null && message.hasOwnProperty("post")) { - object.post = message.post; - if (options.oneofs) - object.pattern = "post"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - object["delete"] = message["delete"]; - if (options.oneofs) - object.pattern = "delete"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - object.patch = message.patch; - if (options.oneofs) - object.pattern = "patch"; - } - if (message.body != null && message.hasOwnProperty("body")) - object.body = message.body; - if (message.custom != null && message.hasOwnProperty("custom")) { - object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); - if (options.oneofs) - object.pattern = "custom"; - } - if (message.additionalBindings && message.additionalBindings.length) { - object.additionalBindings = []; - for (var j = 0; j < message.additionalBindings.length; ++j) - object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + object.type = ""; + object.childType = ""; } - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - object.responseBody = message.responseBody; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; return object; }; /** - * Converts this HttpRule to JSON. + * Converts this ResourceReference to JSON. * @function toJSON - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @instance * @returns {Object.} JSON object */ - HttpRule.prototype.toJSON = function toJSON() { + ResourceReference.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return HttpRule; + return ResourceReference; })(); - api.CustomHttpPattern = (function() { + api.Http = (function() { /** - * Properties of a CustomHttpPattern. + * Properties of a Http. * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion */ /** - * Constructs a new CustomHttpPattern. + * Constructs a new Http. * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern + * @classdesc Represents a Http. + * @implements IHttp * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @param {google.api.IHttp=} [properties] Properties to set */ - function CustomHttpPattern(properties) { + function Http(properties) { + this.rules = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13696,88 +14827,91 @@ } /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http * @instance */ - CustomHttpPattern.prototype.kind = ""; + Http.prototype.rules = $util.emptyArray; /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http * @instance */ - CustomHttpPattern.prototype.path = ""; + Http.prototype.fullyDecodeReservedExpansion = false; /** - * Creates a new CustomHttpPattern instance using the specified properties. + * Creates a new Http instance using the specified properties. * @function create - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance */ - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); + Http.create = function create(properties) { + return new Http(properties); }; /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. * @function encode - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.api.IHttp} message Http message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encode = function encode(message, writer) { + Http.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.kind != null && message.hasOwnProperty("kind")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && message.hasOwnProperty("path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); return writer; }; /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.api.IHttp} message Http message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + Http.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. + * Decodes a Http message from the specified reader or buffer. * @function decode - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @returns {google.api.Http} Http * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CustomHttpPattern.decode = function decode(reader, length) { + Http.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.kind = reader.string(); + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); break; case 2: - message.path = reader.string(); + message.fullyDecodeReservedExpansion = reader.bool(); break; default: reader.skipType(tag & 7); @@ -13788,144 +14922,143 @@ }; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * Decodes a Http message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @returns {google.api.Http} Http * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + Http.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CustomHttpPattern message. + * Verifies a Http message. * @function verify - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CustomHttpPattern.verify = function verify(message) { + Http.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - if (!$util.isString(message.kind)) - return "kind: string expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; return null; }; /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * Creates a Http message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @returns {google.api.Http} Http */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) return object; - var message = new $root.google.api.CustomHttpPattern(); - if (object.kind != null) - message.kind = String(object.kind); - if (object.path != null) - message.path = String(object.path); + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); return message; }; /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * Creates a plain object from a Http message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {google.api.Http} message Http * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CustomHttpPattern.toObject = function toObject(message, options) { + Http.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.kind = ""; - object.path = ""; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); } - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; return object; }; /** - * Converts this CustomHttpPattern to JSON. + * Converts this Http to JSON. * @function toJSON - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @instance * @returns {Object.} JSON object */ - CustomHttpPattern.prototype.toJSON = function toJSON() { + Http.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CustomHttpPattern; - })(); - - /** - * FieldBehavior enum. - * @name google.api.FieldBehavior - * @enum {string} - * @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 - */ - 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; - return values; + return Http; })(); - api.ResourceDescriptor = (function() { + api.HttpRule = (function() { /** - * Properties of a ResourceDescriptor. + * Properties of a HttpRule. * @memberof google.api - * @interface IResourceDescriptor - * @property {string|null} [type] ResourceDescriptor type - * @property {Array.|null} [pattern] ResourceDescriptor pattern - * @property {string|null} [nameField] ResourceDescriptor nameField - * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history - * @property {string|null} [plural] ResourceDescriptor plural - * @property {string|null} [singular] ResourceDescriptor singular + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings */ /** - * Constructs a new ResourceDescriptor. + * Constructs a new HttpRule. * @memberof google.api - * @classdesc Represents a ResourceDescriptor. - * @implements IResourceDescriptor + * @classdesc Represents a HttpRule. + * @implements IHttpRule * @constructor - * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @param {google.api.IHttpRule=} [properties] Properties to set */ - function ResourceDescriptor(properties) { - this.pattern = []; + function HttpRule(properties) { + this.additionalBindings = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13933,143 +15066,209 @@ } /** - * ResourceDescriptor type. - * @member {string} type - * @memberof google.api.ResourceDescriptor + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.type = ""; + HttpRule.prototype.selector = ""; /** - * ResourceDescriptor pattern. - * @member {Array.} pattern - * @memberof google.api.ResourceDescriptor + * HttpRule get. + * @member {string} get + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.pattern = $util.emptyArray; + HttpRule.prototype.get = ""; /** - * ResourceDescriptor nameField. - * @member {string} nameField - * @memberof google.api.ResourceDescriptor + * HttpRule put. + * @member {string} put + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.nameField = ""; + HttpRule.prototype.put = ""; /** - * ResourceDescriptor history. - * @member {google.api.ResourceDescriptor.History} history - * @memberof google.api.ResourceDescriptor + * HttpRule post. + * @member {string} post + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.history = 0; + HttpRule.prototype.post = ""; /** - * ResourceDescriptor plural. - * @member {string} plural - * @memberof google.api.ResourceDescriptor + * HttpRule delete. + * @member {string} delete + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.plural = ""; + HttpRule.prototype["delete"] = ""; /** - * ResourceDescriptor singular. - * @member {string} singular - * @memberof google.api.ResourceDescriptor + * HttpRule patch. + * @member {string} patch + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.singular = ""; + HttpRule.prototype.patch = ""; /** - * Creates a new ResourceDescriptor instance using the specified properties. + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. * @function create - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance */ - ResourceDescriptor.create = function create(properties) { - return new ResourceDescriptor(properties); + HttpRule.create = function create(properties) { + return new HttpRule(properties); }; /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. * @function encode - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceDescriptor.encode = function encode(message, writer) { + HttpRule.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && message.hasOwnProperty("type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.pattern != null && message.pattern.length) - for (var i = 0; i < message.pattern.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); - if (message.nameField != null && message.hasOwnProperty("nameField")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); - if (message.history != null && message.hasOwnProperty("history")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); - if (message.plural != null && message.hasOwnProperty("plural")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); - if (message.singular != null && message.hasOwnProperty("singular")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.selector != null && message.hasOwnProperty("selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && message.hasOwnProperty("get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && message.hasOwnProperty("put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && message.hasOwnProperty("post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && message.hasOwnProperty("delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && message.hasOwnProperty("patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && message.hasOwnProperty("body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && message.hasOwnProperty("custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); return writer; }; /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. + * Decodes a HttpRule message from the specified reader or buffer. * @function decode - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @returns {google.api.HttpRule} HttpRule * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResourceDescriptor.decode = function decode(reader, length) { + HttpRule.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.type = reader.string(); + message.selector = reader.string(); break; case 2: - if (!(message.pattern && message.pattern.length)) - message.pattern = []; - message.pattern.push(reader.string()); + message.get = reader.string(); break; case 3: - message.nameField = reader.string(); + message.put = reader.string(); break; case 4: - message.history = reader.int32(); + message.post = reader.string(); break; case 5: - message.plural = reader.string(); + message["delete"] = reader.string(); break; case 6: - message.singular = reader.string(); + message.patch = reader.string(); + break; + case 8: + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + case 7: + message.body = reader.string(); + break; + case 12: + message.responseBody = reader.string(); + break; + case 11: + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -14080,196 +15279,240 @@ }; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * Decodes a HttpRule message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @returns {google.api.HttpRule} HttpRule * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + HttpRule.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResourceDescriptor message. + * Verifies a HttpRule message. * @function verify - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ResourceDescriptor.verify = function verify(message) { + HttpRule.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.pattern != null && message.hasOwnProperty("pattern")) { - if (!Array.isArray(message.pattern)) - return "pattern: array expected"; - for (var i = 0; i < message.pattern.length; ++i) - if (!$util.isString(message.pattern[i])) - return "pattern: string[] expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; } - if (message.nameField != null && message.hasOwnProperty("nameField")) - if (!$util.isString(message.nameField)) - return "nameField: string expected"; - if (message.history != null && message.hasOwnProperty("history")) - switch (message.history) { - default: - return "history: enum value expected"; - case 0: - case 1: - case 2: - break; + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; } - if (message.plural != null && message.hasOwnProperty("plural")) - if (!$util.isString(message.plural)) - return "plural: string expected"; - if (message.singular != null && message.hasOwnProperty("singular")) - if (!$util.isString(message.singular)) - return "singular: string expected"; + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } return null; }; /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static * @param {Object.} object Plain object - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @returns {google.api.HttpRule} HttpRule */ - ResourceDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceDescriptor) + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) return object; - var message = new $root.google.api.ResourceDescriptor(); - if (object.type != null) - message.type = String(object.type); - if (object.pattern) { - if (!Array.isArray(object.pattern)) - throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); - message.pattern = []; - for (var i = 0; i < object.pattern.length; ++i) - message.pattern[i] = String(object.pattern[i]); + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); } - if (object.nameField != null) - message.nameField = String(object.nameField); - switch (object.history) { - case "HISTORY_UNSPECIFIED": - case 0: - message.history = 0; - break; - case "ORIGINALLY_SINGLE_PATTERN": - case 1: - message.history = 1; - break; - case "FUTURE_MULTI_PATTERN": - case 2: - message.history = 2; - break; + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } } - if (object.plural != null) - message.plural = String(object.plural); - if (object.singular != null) - message.singular = String(object.singular); return message; }; /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static - * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {google.api.HttpRule} message HttpRule * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceDescriptor.toObject = function toObject(message, options) { + HttpRule.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.pattern = []; + object.additionalBindings = []; if (options.defaults) { - object.type = ""; - object.nameField = ""; - object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; - object.plural = ""; - object.singular = ""; + object.selector = ""; + object.body = ""; + object.responseBody = ""; } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.pattern && message.pattern.length) { - object.pattern = []; - for (var j = 0; j < message.pattern.length; ++j) - object.pattern[j] = message.pattern[j]; + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); } - if (message.nameField != null && message.hasOwnProperty("nameField")) - object.nameField = message.nameField; - if (message.history != null && message.hasOwnProperty("history")) - object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] : message.history; - if (message.plural != null && message.hasOwnProperty("plural")) - object.plural = message.plural; - if (message.singular != null && message.hasOwnProperty("singular")) - object.singular = message.singular; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; return object; }; /** - * Converts this ResourceDescriptor to JSON. + * Converts this HttpRule to JSON. * @function toJSON - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @instance * @returns {Object.} JSON object */ - ResourceDescriptor.prototype.toJSON = function toJSON() { + HttpRule.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * History enum. - * @name google.api.ResourceDescriptor.History - * @enum {string} - * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value - * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value - * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value - */ - ResourceDescriptor.History = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; - values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; - values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; - return values; - })(); - - return ResourceDescriptor; + return HttpRule; })(); - api.ResourceReference = (function() { + api.CustomHttpPattern = (function() { /** - * Properties of a ResourceReference. + * Properties of a CustomHttpPattern. * @memberof google.api - * @interface IResourceReference - * @property {string|null} [type] ResourceReference type - * @property {string|null} [childType] ResourceReference childType + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path */ /** - * Constructs a new ResourceReference. + * Constructs a new CustomHttpPattern. * @memberof google.api - * @classdesc Represents a ResourceReference. - * @implements IResourceReference + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern * @constructor - * @param {google.api.IResourceReference=} [properties] Properties to set + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set */ - function ResourceReference(properties) { + function CustomHttpPattern(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14277,88 +15520,88 @@ } /** - * ResourceReference type. - * @member {string} type - * @memberof google.api.ResourceReference + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern * @instance */ - ResourceReference.prototype.type = ""; + CustomHttpPattern.prototype.kind = ""; /** - * ResourceReference childType. - * @member {string} childType - * @memberof google.api.ResourceReference + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern * @instance */ - ResourceReference.prototype.childType = ""; + CustomHttpPattern.prototype.path = ""; /** - * Creates a new ResourceReference instance using the specified properties. + * Creates a new CustomHttpPattern instance using the specified properties. * @function create - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IResourceReference=} [properties] Properties to set - * @returns {google.api.ResourceReference} ResourceReference instance + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance */ - ResourceReference.create = function create(properties) { - return new ResourceReference(properties); + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); }; /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. * @function encode - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceReference.encode = function encode(message, writer) { + CustomHttpPattern.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && message.hasOwnProperty("type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.childType != null && message.hasOwnProperty("childType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + if (message.kind != null && message.hasOwnProperty("kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && message.hasOwnProperty("path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); return writer; }; /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResourceReference message from the specified reader or buffer. + * Decodes a CustomHttpPattern message from the specified reader or buffer. * @function decode - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceReference} ResourceReference + * @returns {google.api.CustomHttpPattern} CustomHttpPattern * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResourceReference.decode = function decode(reader, length) { + CustomHttpPattern.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.type = reader.string(); + message.kind = reader.string(); break; case 2: - message.childType = reader.string(); + message.path = reader.string(); break; default: reader.skipType(tag & 7); @@ -14369,96 +15612,118 @@ }; /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceReference} ResourceReference + * @returns {google.api.CustomHttpPattern} CustomHttpPattern * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResourceReference.decodeDelimited = function decodeDelimited(reader) { + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResourceReference message. + * Verifies a CustomHttpPattern message. * @function verify - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ResourceReference.verify = function verify(message) { + CustomHttpPattern.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.childType != null && message.hasOwnProperty("childType")) - if (!$util.isString(message.childType)) - return "childType: string expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; return null; }; /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static * @param {Object.} object Plain object - * @returns {google.api.ResourceReference} ResourceReference + * @returns {google.api.CustomHttpPattern} CustomHttpPattern */ - ResourceReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceReference) + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) return object; - var message = new $root.google.api.ResourceReference(); - if (object.type != null) - message.type = String(object.type); - if (object.childType != null) - message.childType = String(object.childType); + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); return message; }; /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.ResourceReference} message ResourceReference + * @param {google.api.CustomHttpPattern} message CustomHttpPattern * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceReference.toObject = function toObject(message, options) { + CustomHttpPattern.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.type = ""; - object.childType = ""; + object.kind = ""; + object.path = ""; } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.childType != null && message.hasOwnProperty("childType")) - object.childType = message.childType; + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; return object; }; /** - * Converts this ResourceReference to JSON. + * Converts this CustomHttpPattern to JSON. * @function toJSON - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @instance * @returns {Object.} JSON object */ - ResourceReference.prototype.toJSON = function toJSON() { + CustomHttpPattern.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ResourceReference; + return CustomHttpPattern; + })(); + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {string} + * @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 + */ + 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; + return values; })(); return api; @@ -19671,8 +20936,8 @@ * @property {boolean|null} [deprecated] FieldOptions deprecated * @property {boolean|null} [weak] FieldOptions weak * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption - * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior */ /** @@ -19749,20 +21014,20 @@ FieldOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * FieldOptions .google.api.fieldBehavior. - * @member {Array.} .google.api.fieldBehavior + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference * @memberof google.protobuf.FieldOptions * @instance */ - FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + FieldOptions.prototype[".google.api.resourceReference"] = null; /** - * FieldOptions .google.api.resourceReference. - * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior * @memberof google.protobuf.FieldOptions * @instance */ - FieldOptions.prototype[".google.api.resourceReference"] = null; + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; /** * Creates a new FieldOptions instance using the specified properties. @@ -19868,6 +21133,9 @@ message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; + case 1055: + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; case 1052: if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) message[".google.api.fieldBehavior"] = []; @@ -19878,9 +21146,6 @@ } else message[".google.api.fieldBehavior"].push(reader.int32()); break; - case 1055: - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); - break; default: reader.skipType(tag & 7); break; @@ -19955,6 +21220,11 @@ return "uninterpretedOption." + error; } } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { if (!Array.isArray(message[".google.api.fieldBehavior"])) return ".google.api.fieldBehavior: array expected"; @@ -19971,11 +21241,6 @@ break; } } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { - var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); - if (error) - return ".google.api.resourceReference." + error; - } return null; }; @@ -20037,6 +21302,11 @@ message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } if (object[".google.api.fieldBehavior"]) { if (!Array.isArray(object[".google.api.fieldBehavior"])) throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); @@ -20070,11 +21340,6 @@ break; } } - if (object[".google.api.resourceReference"] != null) { - if (typeof object[".google.api.resourceReference"] !== "object") - throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); - } return message; }; diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index 1773e244ac6..4568a83f1ea 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -8,15 +8,100 @@ "nested": { "v1": { "options": { + "cc_enable_arenas": true, "csharp_namespace": "Google.Cloud.Asset.V1", "go_package": "google.golang.org/genproto/googleapis/cloud/asset/v1;asset", "java_multiple_files": true, - "java_outer_classname": "AssetProto", + "java_outer_classname": "AssetServiceProto", "java_package": "com.google.cloud.asset.v1", - "php_namespace": "Google\\Cloud\\Asset\\V1", - "cc_enable_arenas": true + "php_namespace": "Google\\Cloud\\Asset\\V1" }, "nested": { + "TemporalAsset": { + "fields": { + "window": { + "type": "TimeWindow", + "id": 1 + }, + "deleted": { + "type": "bool", + "id": 2 + }, + "asset": { + "type": "Asset", + "id": 3 + } + } + }, + "TimeWindow": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "Asset": { + "options": { + "(google.api.resource).type": "cloudasset.googleapis.com/Asset", + "(google.api.resource).pattern": "*" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "assetType": { + "type": "string", + "id": 2 + }, + "resource": { + "type": "Resource", + "id": 3 + }, + "iamPolicy": { + "type": "google.iam.v1.Policy", + "id": 4 + }, + "ancestors": { + "rule": "repeated", + "type": "string", + "id": 10 + } + } + }, + "Resource": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "discoveryDocumentUri": { + "type": "string", + "id": 2 + }, + "discoveryName": { + "type": "string", + "id": 3 + }, + "resourceUrl": { + "type": "string", + "id": 4 + }, + "parent": { + "type": "string", + "id": 5 + }, + "data": { + "type": "google.protobuf.Struct", + "id": 6 + } + } + }, "AssetService": { "options": { "(google.api.default_host)": "cloudasset.googleapis.com", @@ -385,7 +470,20 @@ } } } - }, + } + } + }, + "v1beta1": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.Asset.V1Beta1", + "go_package": "google.golang.org/genproto/googleapis/cloud/asset/v1beta1;asset", + "java_multiple_files": true, + "java_outer_classname": "AssetServiceProto", + "java_package": "com.google.cloud.asset.v1beta1", + "php_namespace": "Google\\Cloud\\Asset\\V1beta1" + }, + "nested": { "TemporalAsset": { "fields": { "window": { @@ -435,11 +533,6 @@ "iamPolicy": { "type": "google.iam.v1.Policy", "id": 4 - }, - "ancestors": { - "rule": "repeated", - "type": "string", - "id": 10 } } }, @@ -470,20 +563,12 @@ "id": 6 } } - } - } - }, - "v1beta1": { - "options": { - "csharp_namespace": "Google.Cloud.Asset.V1Beta1", - "go_package": "google.golang.org/genproto/googleapis/cloud/asset/v1beta1;asset", - "java_multiple_files": true, - "java_outer_classname": "AssetProto", - "java_package": "com.google.cloud.asset.v1beta1", - "php_namespace": "Google\\Cloud\\Asset\\V1beta1" - }, - "nested": { + }, "AssetService": { + "options": { + "(google.api.default_host)": "cloudasset.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, "methods": { "ExportAssets": { "requestType": "ExportAssetsRequest", @@ -492,7 +577,9 @@ "(google.api.http).post": "/v1beta1/{parent=projects/*}:exportAssets", "(google.api.http).body": "*", "(google.api.http).additional_bindings.post": "/v1beta1/{parent=organizations/*}:exportAssets", - "(google.api.http).additional_bindings.body": "*" + "(google.api.http).additional_bindings.body": "*", + "(google.longrunning.operation_info).response_type": "google.cloud.asset.v1beta1.ExportAssetsResponse", + "(google.longrunning.operation_info).metadata_type": "google.cloud.asset.v1beta1.ExportAssetsRequest" } }, "BatchGetAssetsHistory": { @@ -509,7 +596,11 @@ "fields": { "parent": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "cloudasset.googleapis.com/Asset" + } }, "readTime": { "type": "google.protobuf.Timestamp", @@ -526,7 +617,10 @@ }, "outputConfig": { "type": "OutputConfig", - "id": 5 + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, @@ -546,7 +640,11 @@ "fields": { "parent": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "cloudasset.googleapis.com/Asset" + } }, "assetNames": { "rule": "repeated", @@ -555,11 +653,17 @@ }, "contentType": { "type": "ContentType", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "readTimeWindow": { "type": "TimeWindow", - "id": 4 + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -591,7 +695,8 @@ "oneofs": { "objectUri": { "oneof": [ - "uri" + "uri", + "uriPrefix" ] } }, @@ -599,6 +704,10 @@ "uri": { "type": "string", "id": 1 + }, + "uriPrefix": { + "type": "string", + "id": 2 } } }, @@ -608,36 +717,21 @@ "RESOURCE": 1, "IAM_POLICY": 2 } - }, - "TemporalAsset": { - "fields": { - "window": { - "type": "TimeWindow", - "id": 1 - }, - "deleted": { - "type": "bool", - "id": 2 - }, - "asset": { - "type": "Asset", - "id": 3 - } - } - }, - "TimeWindow": { - "fields": { - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - } - } - }, - "Asset": { + } + } + }, + "v1p1beta1": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.Asset.V1P1Beta1", + "go_package": "google.golang.org/genproto/googleapis/cloud/asset/v1p1beta1;asset", + "java_multiple_files": true, + "java_outer_classname": "AssetServiceProto", + "java_package": "com.google.cloud.asset.v1p1beta1", + "php_namespace": "Google\\Cloud\\Asset\\V1p1beta1" + }, + "nested": { + "StandardResourceMetadata": { "fields": { "name": { "type": "string", @@ -647,181 +741,418 @@ "type": "string", "id": 2 }, - "resource": { - "type": "Resource", + "project": { + "type": "string", "id": 3 }, - "iamPolicy": { - "type": "google.iam.v1.Policy", + "displayName": { + "type": "string", "id": 4 + }, + "description": { + "type": "string", + "id": 5 + }, + "additionalAttributes": { + "rule": "repeated", + "type": "string", + "id": 10 } } }, - "Resource": { + "IamPolicySearchResult": { "fields": { - "version": { + "resource": { "type": "string", "id": 1 }, - "discoveryDocumentUri": { - "type": "string", - "id": 2 - }, - "discoveryName": { + "project": { "type": "string", "id": 3 }, - "resourceUrl": { - "type": "string", + "policy": { + "type": "google.iam.v1.Policy", "id": 4 - }, - "parent": { - "type": "string", - "id": 5 - }, - "data": { - "type": "google.protobuf.Struct", - "id": 6 } } - } - } - }, - "v1p2beta1": { - "options": { - "csharp_namespace": "Google.Cloud.Asset.v1p2beta1", - "go_package": "google.golang.org/genproto/googleapis/cloud/asset/v1p2beta1;asset", - "java_multiple_files": true, - "java_outer_classname": "AssetProto", - "java_package": "com.google.cloud.asset.v1p2beta1", - "php_namespace": "Google\\Cloud\\Asset\\v1p2beta1", - "cc_enable_arenas": true - }, - "nested": { + }, "AssetService": { "options": { "(google.api.default_host)": "cloudasset.googleapis.com", "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" }, "methods": { - "ExportAssets": { - "requestType": "ExportAssetsRequest", - "responseType": "google.longrunning.Operation", + "SearchResources": { + "requestType": "SearchResourcesRequest", + "responseType": "SearchResourcesResponse", "options": { - "(google.api.http).post": "/v1p2beta1/{parent=*/*}:exportAssets", - "(google.api.http).body": "*" + "(google.api.http).get": "/v1p1beta1/resources:search", + "(google.api.method_signature)": "scope,query,asset_types" } }, - "BatchGetAssetsHistory": { - "requestType": "BatchGetAssetsHistoryRequest", - "responseType": "BatchGetAssetsHistoryResponse", + "SearchIamPolicies": { + "requestType": "SearchIamPoliciesRequest", + "responseType": "SearchIamPoliciesResponse", "options": { - "(google.api.http).get": "/v1p2beta1/{parent=*/*}:batchGetAssetsHistory" + "(google.api.http).get": "/v1p1beta1/iamPolicies:search", + "(google.api.method_signature)": "scope,query" } }, - "CreateFeed": { - "requestType": "CreateFeedRequest", - "responseType": "Feed", + "SearchAllResources": { + "requestType": "SearchAllResourcesRequest", + "responseType": "SearchAllResourcesResponse", "options": { - "(google.api.http).post": "/v1p2beta1/{parent=*/*}/feeds", - "(google.api.http).body": "*" + "(google.api.http).get": "/v1p1beta1/{scope=*/*}/resources:searchAll", + "(google.api.method_signature)": "scope,query,asset_types" } }, - "GetFeed": { - "requestType": "GetFeedRequest", - "responseType": "Feed", + "SearchAllIamPolicies": { + "requestType": "SearchAllIamPoliciesRequest", + "responseType": "SearchAllIamPoliciesResponse", + "options": { + "(google.api.http).get": "/v1p1beta1/{scope=*/*}/iamPolicies:searchAll", + "(google.api.method_signature)": "scope,query" + } + } + } + }, + "SearchResourcesRequest": { + "fields": { + "scope": { + "type": "string", + "id": 1, "options": { - "(google.api.http).get": "/v1p2beta1/{name=*/*/feeds/*}" + "(google.api.field_behavior)": "REQUIRED" } }, - "ListFeeds": { - "requestType": "ListFeedsRequest", - "responseType": "ListFeedsResponse", + "query": { + "type": "string", + "id": 2, "options": { - "(google.api.http).get": "/v1p2beta1/{parent=*/*}/feeds" + "(google.api.field_behavior)": "OPTIONAL" } }, - "UpdateFeed": { - "requestType": "UpdateFeedRequest", - "responseType": "Feed", + "assetTypes": { + "rule": "repeated", + "type": "string", + "id": 3, "options": { - "(google.api.http).patch": "/v1p2beta1/{feed.name=*/*/feeds/*}", - "(google.api.http).body": "*" + "(google.api.field_behavior)": "OPTIONAL" } }, - "DeleteFeed": { - "requestType": "DeleteFeedRequest", - "responseType": "google.protobuf.Empty", + "pageSize": { + "type": "int32", + "id": 4, "options": { - "(google.api.http).delete": "/v1p2beta1/{name=*/*/feeds/*}" + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" } } } }, - "ExportAssetsRequest": { + "SearchResourcesResponse": { "fields": { - "parent": { + "results": { + "rule": "repeated", + "type": "StandardResourceMetadata", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "SearchIamPoliciesRequest": { + "fields": { + "scope": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "query": { "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SearchIamPoliciesResponse": { + "fields": { + "results": { + "rule": "repeated", + "type": "IamPolicySearchResult", "id": 1 }, - "readTime": { - "type": "google.protobuf.Timestamp", + "nextPageToken": { + "type": "string", "id": 2 + } + } + }, + "SearchAllResourcesRequest": { + "fields": { + "scope": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "query": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "assetTypes": { "rule": "repeated", "type": "string", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, - "contentType": { - "type": "ContentType", - "id": 4 + "pageSize": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, - "outputConfig": { - "type": "OutputConfig", - "id": 5 + "pageToken": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, - "ExportAssetsResponse": { + "SearchAllResourcesResponse": { "fields": { - "readTime": { + "results": { + "rule": "repeated", + "type": "StandardResourceMetadata", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "SearchAllIamPoliciesRequest": { + "fields": { + "scope": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "query": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SearchAllIamPoliciesResponse": { + "fields": { + "results": { + "rule": "repeated", + "type": "IamPolicySearchResult", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + } + } + }, + "v1p2beta1": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.Asset.V1p2Beta1", + "go_package": "google.golang.org/genproto/googleapis/cloud/asset/v1p2beta1;asset", + "java_multiple_files": true, + "java_outer_classname": "AssetServiceProto", + "java_package": "com.google.cloud.asset.v1p2beta1", + "php_namespace": "Google\\Cloud\\Asset\\V1p2Beta1" + }, + "nested": { + "TemporalAsset": { + "fields": { + "window": { + "type": "TimeWindow", + "id": 1 + }, + "deleted": { + "type": "bool", + "id": 2 + }, + "asset": { + "type": "Asset", + "id": 3 + } + } + }, + "TimeWindow": { + "fields": { + "startTime": { "type": "google.protobuf.Timestamp", "id": 1 }, - "outputConfig": { - "type": "OutputConfig", + "endTime": { + "type": "google.protobuf.Timestamp", "id": 2 } } }, - "BatchGetAssetsHistoryRequest": { + "Asset": { "fields": { - "parent": { + "name": { "type": "string", "id": 1 }, - "assetNames": { - "rule": "repeated", + "assetType": { "type": "string", "id": 2 }, - "contentType": { - "type": "ContentType", + "resource": { + "type": "Resource", "id": 3 }, - "readTimeWindow": { - "type": "TimeWindow", + "iamPolicy": { + "type": "google.iam.v1.Policy", "id": 4 + }, + "ancestors": { + "rule": "repeated", + "type": "string", + "id": 6 } } }, - "BatchGetAssetsHistoryResponse": { + "Resource": { "fields": { - "assets": { - "rule": "repeated", - "type": "TemporalAsset", + "version": { + "type": "string", "id": 1 + }, + "discoveryDocumentUri": { + "type": "string", + "id": 2 + }, + "discoveryName": { + "type": "string", + "id": 3 + }, + "resourceUrl": { + "type": "string", + "id": 4 + }, + "parent": { + "type": "string", + "id": 5 + }, + "data": { + "type": "google.protobuf.Struct", + "id": 6 + } + } + }, + "AssetService": { + "options": { + "(google.api.default_host)": "cloudasset.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateFeed": { + "requestType": "CreateFeedRequest", + "responseType": "Feed", + "options": { + "(google.api.http).post": "/v1p2beta1/{parent=*/*}/feeds", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent" + } + }, + "GetFeed": { + "requestType": "GetFeedRequest", + "responseType": "Feed", + "options": { + "(google.api.http).get": "/v1p2beta1/{name=*/*/feeds/*}", + "(google.api.method_signature)": "name" + } + }, + "ListFeeds": { + "requestType": "ListFeedsRequest", + "responseType": "ListFeedsResponse", + "options": { + "(google.api.http).get": "/v1p2beta1/{parent=*/*}/feeds", + "(google.api.method_signature)": "parent" + } + }, + "UpdateFeed": { + "requestType": "UpdateFeedRequest", + "responseType": "Feed", + "options": { + "(google.api.http).patch": "/v1p2beta1/{feed.name=*/*/feeds/*}", + "(google.api.http).body": "*", + "(google.api.method_signature)": "feed" + } + }, + "DeleteFeed": { + "requestType": "DeleteFeedRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1p2beta1/{name=*/*/feeds/*}", + "(google.api.method_signature)": "name" + } } } }, @@ -829,15 +1160,24 @@ "fields": { "parent": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "feedId": { "type": "string", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "feed": { "type": "Feed", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, @@ -845,7 +1185,11 @@ "fields": { "name": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudasset.googleapis.com/Feed" + } } } }, @@ -853,7 +1197,10 @@ "fields": { "parent": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, @@ -870,11 +1217,17 @@ "fields": { "feed": { "type": "Feed", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "updateMask": { "type": "google.protobuf.FieldMask", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, @@ -882,7 +1235,11 @@ "fields": { "name": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudasset.googleapis.com/Feed" + } } } }, @@ -890,8 +1247,7 @@ "oneofs": { "destination": { "oneof": [ - "gcsDestination", - "bigqueryDestination" + "gcsDestination" ] } }, @@ -899,10 +1255,6 @@ "gcsDestination": { "type": "GcsDestination", "id": 1 - }, - "bigqueryDestination": { - "type": "BigQueryDestination", - "id": 2 } } }, @@ -910,35 +1262,14 @@ "oneofs": { "objectUri": { "oneof": [ - "uri", - "uriPrefix" + "uri" ] - } - }, - "fields": { - "uri": { - "type": "string", - "id": 1 - }, - "uriPrefix": { - "type": "string", - "id": 2 - } - } - }, - "BigQueryDestination": { + } + }, "fields": { - "dataset": { + "uri": { "type": "string", "id": 1 - }, - "table": { - "type": "string", - "id": 2 - }, - "force": { - "type": "bool", - "id": 3 } } }, @@ -950,16 +1281,6 @@ } } }, - "ContentType": { - "values": { - "CONTENT_TYPE_UNSPECIFIED": 0, - "RESOURCE": 1, - "IAM_POLICY": 2, - "IAM_POLICY_NAME": 3, - "ORG_POLICY": 4, - "ACCESS_POLICY": 5 - } - }, "FeedOutputConfig": { "oneofs": { "destination": { @@ -976,10 +1297,18 @@ } }, "Feed": { + "options": { + "(google.api.resource).type": "cloudasset.googleapis.com/Feed", + "(google.api.resource).pattern": "organizations/{organization}/feeds/{feed}", + "(google.api.resource).history": "ORIGINALLY_SINGLE_PATTERN" + }, "fields": { "name": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "assetNames": { "rule": "repeated", @@ -997,97 +1326,18 @@ }, "feedOutputConfig": { "type": "FeedOutputConfig", - "id": 5 - } - } - }, - "TemporalAsset": { - "fields": { - "window": { - "type": "TimeWindow", - "id": 1 - }, - "deleted": { - "type": "bool", - "id": 2 - }, - "asset": { - "type": "Asset", - "id": 3 - } - } - }, - "TimeWindow": { - "fields": { - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - } - } - }, - "Asset": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "assetType": { - "type": "string", - "id": 2 - }, - "resource": { - "type": "Resource", - "id": 3 - }, - "iamPolicy": { - "type": "google.iam.v1.Policy", - "id": 4 - }, - "iamPolicyName": { - "type": "bytes", - "id": 5 - }, - "ancestors": { - "rule": "repeated", - "type": "string", - "id": 6 + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, - "Resource": { - "fields": { - "version": { - "type": "string", - "id": 1 - }, - "discoveryDocumentUri": { - "type": "string", - "id": 2 - }, - "discoveryName": { - "type": "string", - "id": 3 - }, - "resourceUrl": { - "type": "string", - "id": 4 - }, - "parent": { - "type": "string", - "id": 5 - }, - "data": { - "type": "google.protobuf.Struct", - "id": 6 - }, - "internalData": { - "type": "google.protobuf.Any", - "id": 7 - } + "ContentType": { + "values": { + "CONTENT_TYPE_UNSPECIFIED": 0, + "RESOURCE": 1, + "IAM_POLICY": 2 } } } @@ -1098,14 +1348,80 @@ }, "api": { "options": { + "cc_enable_arenas": true, "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", "java_multiple_files": true, - "java_outer_classname": "ResourceProto", + "java_outer_classname": "FieldBehaviorProto", "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true + "objc_class_prefix": "GAPI" }, "nested": { + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + }, "http": { "type": "HttpRule", "id": 72295728, @@ -1224,72 +1540,6 @@ "INPUT_ONLY": 4, "IMMUTABLE": 5 } - }, - "resourceReference": { - "type": "google.api.ResourceReference", - "id": 1055, - "extend": "google.protobuf.FieldOptions" - }, - "resourceDefinition": { - "rule": "repeated", - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.FileOptions" - }, - "resource": { - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.MessageOptions" - }, - "ResourceDescriptor": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "pattern": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "nameField": { - "type": "string", - "id": 3 - }, - "history": { - "type": "History", - "id": 4 - }, - "plural": { - "type": "string", - "id": 5 - }, - "singular": { - "type": "string", - "id": 6 - } - }, - "nested": { - "History": { - "values": { - "HISTORY_UNSPECIFIED": 0, - "ORIGINALLY_SINGLE_PATTERN": 1, - "FUTURE_MULTI_PATTERN": 2 - } - } - } - }, - "ResourceReference": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "childType": { - "type": "string", - "id": 2 - } - } } } }, diff --git a/packages/google-cloud-asset/samples/exportAssets.js b/packages/google-cloud-asset/samples/exportAssets.js index 850a155225b..64f64a02a09 100644 --- a/packages/google-cloud-asset/samples/exportAssets.js +++ b/packages/google-cloud-asset/samples/exportAssets.js @@ -26,7 +26,7 @@ async function main(dumpFilePath) { async function exportAssets() { const projectId = await client.getProjectId(); - const projectResource = client.projectPath(projectId); + const projectResource = `projects/${projectId}`; // TODO(developer): choose the dump file path // const dumpFilePath = 'Dump file path, e.g.: gs:///' diff --git a/packages/google-cloud-asset/samples/getBatchAssetHistory.js b/packages/google-cloud-asset/samples/getBatchAssetHistory.js index e1d78a11ab0..38afb6a96f5 100644 --- a/packages/google-cloud-asset/samples/getBatchAssetHistory.js +++ b/packages/google-cloud-asset/samples/getBatchAssetHistory.js @@ -28,7 +28,7 @@ async function main(assetNames) { async function batchGetAssetsHistory() { const projectId = await client.getProjectId(); - const projectResource = client.projectPath(projectId); + const projectResource = `projects/${projectId}`; // TODO(developer): Choose asset names, such as //storage.googleapis.com/[YOUR_BUCKET_NAME]. // const assetNames = ['ASSET_NAME1', 'ASSET_NAME2', ...]; diff --git a/packages/google-cloud-asset/samples/quickstart.js b/packages/google-cloud-asset/samples/quickstart.js index 20103990aa3..11bc75706db 100644 --- a/packages/google-cloud-asset/samples/quickstart.js +++ b/packages/google-cloud-asset/samples/quickstart.js @@ -28,7 +28,7 @@ async function main(assetNames) { async function quickstart() { const projectId = await client.getProjectId(); - const projectResource = client.projectPath(projectId); + const projectResource = `projects/${projectId}`; // TODO(developer): Choose asset names, such as //storage.googleapis.com/[YOUR_BUCKET_NAME]. // const assetNames = ['ASSET_NAME1', 'ASSET_NAME2', ...]; diff --git a/packages/google-cloud-asset/src/index.js b/packages/google-cloud-asset/src/index.js deleted file mode 100644 index d9d674733a4..00000000000 --- a/packages/google-cloud-asset/src/index.js +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright 2018 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. - -/** - * @namespace google - */ -/** - * @namespace google.cloud - */ -/** - * @namespace google.cloud.asset - */ -/** - * @namespace google.cloud.asset.v1beta1 - */ -/** - * @namespace google.cloud.asset.v1 - */ -/** - * @namespace google.protobuf - */ -/** - * @namespace google.rpc - */ -/** - * @namespace google.type - */ -/** - * @namespace google.iam.v1 - */ -/** - * @namespace google.longrunning - */ -/** - * @namespace google.cloud.asset.v1p2beta1 - */ - -'use strict'; - -// Import the clients for each version supported by this package. -const gapic = Object.freeze({ - v1beta1: require('./v1beta1'), - v1: require('./v1'), - v1p2beta1: require('./v1p2beta1'), -}); - -/** - * The `asset` package has the following named exports: - * - * - `AssetServiceClient` - Reference to - * {@link v1beta1.AssetServiceClient} - * - `v1beta1` - This is used for selecting or pinning a - * particular backend service version. It exports: - * - `AssetServiceClient` - Reference to - * {@link v1beta1.AssetServiceClient} - * - * @module {object} asset - * @alias nodejs-asset - * - * @example Install the client library with npm: - * npm install --save @google-cloud/asset - * - * @example Import the client library: - * const asset = require('@google-cloud/asset'); - * - * @example Create a client that uses Application Default Credentials (ADC): - * const client = new asset.AssetServiceClient(); - * - * @example Create a client with explicit credentials: - * const client = new asset.AssetServiceClient({ - * projectId: 'your-project-id', - * keyFilename: '/path/to/keyfile.json', - * }); - */ - -/** - * @type {object} - * @property {constructor} AssetServiceClient - * Reference to {@link v1beta1.AssetServiceClient} - */ -module.exports = gapic.v1; - -/** - * @type {object} - * @property {constructor} AssetServiceClient - * Reference to {@link v1beta1.AssetServiceClient} - */ -module.exports.v1p2beta1 = gapic.v1p2beta1; - -/** - * @type {object} - * @property {constructor} AssetServiceClient - * Reference to {@link v1beta1.AssetServiceClient} - */ -module.exports.v1beta1 = gapic.v1beta1; - -/** - * @type {object} - * @property {constructor} AssetServiceClient - * Reference to {@link v1.AssetServiceClient} - */ -module.exports.v1 = gapic.v1; - -// Alias `module.exports` as `module.exports.default`, for future-proofing. -module.exports.default = Object.assign({}, module.exports); diff --git a/packages/google-cloud-asset/src/index.ts b/packages/google-cloud-asset/src/index.ts new file mode 100644 index 00000000000..41201327fc4 --- /dev/null +++ b/packages/google-cloud-asset/src/index.ts @@ -0,0 +1,27 @@ +// Copyright 2019 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 v1 from './v1'; +import * as v1beta1 from './v1beta1'; +import * as v1p1beta1 from './v1p1beta1'; +import * as v1p2beta1 from './v1p2beta1'; +const AssetServiceClient = v1.AssetServiceClient; +export {v1, v1beta1, v1p1beta1, v1p2beta1, AssetServiceClient}; +// For compatibility with JavaScript libraries we need to provide this default export: +// tslint:disable-next-line no-default-export +export default {v1, v1beta1, v1p1beta1, v1p2beta1, AssetServiceClient}; diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.js b/packages/google-cloud-asset/src/v1/asset_service_client.js deleted file mode 100644 index 4f7841a51ac..00000000000 --- a/packages/google-cloud-asset/src/v1/asset_service_client.js +++ /dev/null @@ -1,868 +0,0 @@ -// Copyright 2020 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. - -'use strict'; - -const gapicConfig = require('./asset_service_client_config.json'); -const gax = require('google-gax'); -const path = require('path'); - -const VERSION = require('../../package.json').version; - -/** - * Asset service definition. - * - * @class - * @memberof v1 - */ -class AssetServiceClient { - /** - * Construct an instance of AssetServiceClient. - * - * @param {object} [options] - The configuration object. See the subsequent - * parameters for more details. - * @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 {function} [options.promise] - Custom promise module to use instead - * of native Promises. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - */ - constructor(opts) { - opts = opts || {}; - this._descriptors = {}; - - if (global.isBrowser) { - // If we're in browser, we use gRPC fallback. - opts.fallback = true; - } - - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; - - const servicePath = - opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; - - // Ensure that options include the service address and port. - opts = Object.assign( - { - clientConfig: {}, - port: this.constructor.port, - servicePath, - }, - opts - ); - - // Create a `gaxGrpc` object, with any grpc-specific options - // sent to the client. - opts.scopes = this.constructor.scopes; - const gaxGrpc = new gaxModule.GrpcClient(opts); - - // Save the auth object to the client, for use by other methods. - this.auth = gaxGrpc.auth; - - // Determine the client header string. - const clientHeader = []; - - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } - clientHeader.push(`gax/${gaxModule.version}`); - if (opts.fallback) { - clientHeader.push(`gl-web/${gaxModule.version}`); - } else { - clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); - } - clientHeader.push(`gapic/${VERSION}`); - 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' - ); - const protos = gaxGrpc.loadProto( - opts.fallback ? 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 = { - feedPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/feeds/{feed}' - ), - projectPathTemplate: new gaxModule.PathTemplate('projects/{project}'), - }; - - const protoFilesRoot = opts.fallback - ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) - : gaxModule.protobuf.loadSync(nodejsProtoPath); - - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - this.operationsClient = new gaxModule.lro({ - auth: gaxGrpc.auth, - grpc: gaxGrpc.grpc, - }).operationsClient(opts); - - const exportAssetsResponse = protoFilesRoot.lookup( - 'google.cloud.asset.v1.ExportAssetsResponse' - ); - const exportAssetsMetadata = protoFilesRoot.lookup( - 'google.cloud.asset.v1.ExportAssetsRequest' - ); - - this._descriptors.longrunning = { - exportAssets: new gaxModule.LongrunningDescriptor( - this.operationsClient, - exportAssetsResponse.decode.bind(exportAssetsResponse), - exportAssetsMetadata.decode.bind(exportAssetsMetadata) - ), - }; - - // Put together the default options sent with requests. - const defaults = gaxGrpc.constructSettings( - 'google.cloud.asset.v1.AssetService', - gapicConfig, - 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 = {}; - - // Put together the "service stub" for - // google.cloud.asset.v1.AssetService. - const assetServiceStub = gaxGrpc.createStub( - opts.fallback - ? protos.lookupService('google.cloud.asset.v1.AssetService') - : protos.google.cloud.asset.v1.AssetService, - opts - ); - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const assetServiceStubMethods = [ - 'exportAssets', - 'batchGetAssetsHistory', - 'createFeed', - 'getFeed', - 'listFeeds', - 'updateFeed', - 'deleteFeed', - ]; - for (const methodName of assetServiceStubMethods) { - const innerCallPromise = assetServiceStub.then( - stub => (...args) => { - return stub[methodName].apply(stub, args); - }, - err => () => { - throw err; - } - ); - this._innerApiCalls[methodName] = gaxModule.createApiCall( - innerCallPromise, - defaults[methodName], - this._descriptors.longrunning[methodName] - ); - } - } - - /** - * The DNS address for this API service. - */ - static get servicePath() { - return 'cloudasset.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - */ - static get apiEndpoint() { - return 'cloudasset.googleapis.com'; - } - - /** - * The port for this API service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - */ - static get scopes() { - return ['https://www.googleapis.com/auth/cloud-platform']; - } - - /** - * Return the project ID used by this class. - * @param {function(Error, string)} callback - the callback to - * be called with the current project Id. - */ - getProjectId(callback) { - return this.auth.getProjectId(callback); - } - - // ------------------- - // -- Service calls -- - // ------------------- - - /** - * Exports assets with time and resource types to a given Cloud Storage - * location. The output format is newline-delimited JSON. - * This API implements the google.longrunning.Operation API allowing you - * to keep track of the export. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The relative name of the root asset. This can only be an - * organization number (such as "organizations/123"), a project ID (such as - * "projects/my-project-id"), or a project number (such as "projects/12345"), - * or a folder number (such as "folders/123"). - * @param {Object} request.outputConfig - * Required. Output configuration indicating where the results will be output - * to. All results will be in newline delimited JSON format. - * - * This object should have the same structure as [OutputConfig]{@link google.cloud.asset.v1.OutputConfig} - * @param {Object} [request.readTime] - * Timestamp to take an asset snapshot. This can only be set to a timestamp - * between 2018-10-02 UTC (inclusive) and the current time. If not specified, - * the current time will be used. Due to delays in resource data collection - * and indexing, there is a volatile window during which running the same - * query may get different results. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * @param {string[]} [request.assetTypes] - * A list of asset types of which to take a snapshot for. For example: - * "compute.googleapis.com/Disk". If specified, only matching assets will be - * returned. See [Introduction to Cloud Asset - * Inventory](https://cloud.google.com/asset-inventory/docs/overview) - * for all supported asset types. - * @param {number} [request.contentType] - * Asset content type. If not specified, no content but the asset name will be - * returned. - * - * The number should be among the values of [ContentType]{@link google.cloud.asset.v1.ContentType} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const asset = require('asset.v1'); - * - * const client = new asset.v1.AssetServiceClient({ - * // optional auth parameters. - * }); - * - * const parent = ''; - * const outputConfig = {}; - * const request = { - * parent: parent, - * outputConfig: outputConfig, - * }; - * - * // Handle the operation using the promise pattern. - * client.exportAssets(request) - * .then(responses => { - * const [operation, initialApiResponse] = responses; - * - * // Operation#promise starts polling for the completion of the LRO. - * return operation.promise(); - * }) - * .then(responses => { - * const result = responses[0]; - * const metadata = responses[1]; - * const finalApiResponse = responses[2]; - * }) - * .catch(err => { - * console.error(err); - * }); - * - * const parent = ''; - * const outputConfig = {}; - * const request = { - * parent: parent, - * outputConfig: outputConfig, - * }; - * - * // Handle the operation using the event emitter pattern. - * client.exportAssets(request) - * .then(responses => { - * const [operation, initialApiResponse] = responses; - * - * // Adding a listener for the "complete" event starts polling for the - * // completion of the operation. - * operation.on('complete', (result, metadata, finalApiResponse) => { - * // doSomethingWith(result); - * }); - * - * // Adding a listener for the "progress" event causes the callback to be - * // called on any change in metadata when the operation is polled. - * operation.on('progress', (metadata, apiResponse) => { - * // doSomethingWith(metadata) - * }); - * - * // Adding a listener for the "error" event handles any errors found during polling. - * operation.on('error', err => { - * // throw(err); - * }); - * }) - * .catch(err => { - * console.error(err); - * }); - * - * const parent = ''; - * const outputConfig = {}; - * const request = { - * parent: parent, - * outputConfig: outputConfig, - * }; - * - * // Handle the operation using the await pattern. - * const [operation] = await client.exportAssets(request); - * - * const [response] = await operation.promise(); - */ - exportAssets(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - 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, - }); - - return this._innerApiCalls.exportAssets(request, options, callback); - } - - /** - * Batch gets the update history of assets that overlap a time window. - * For RESOURCE content, this API outputs history with asset in both - * non-delete or deleted status. - * For IAM_POLICY content, this API outputs history when the asset and its - * attached IAM POLICY both exist. This can create gaps in the output history. - * If a specified asset does not exist, this API returns an INVALID_ARGUMENT - * error. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The relative name of the root asset. It can only be an - * organization number (such as "organizations/123"), a project ID (such as - * "projects/my-project-id")", or a project number (such as "projects/12345"). - * @param {number} request.contentType - * Optional. The content type. - * - * The number should be among the values of [ContentType]{@link google.cloud.asset.v1.ContentType} - * @param {Object} request.readTimeWindow - * Optional. The time window for the asset history. Both start_time and - * end_time are optional and if set, it must be after 2018-10-02 UTC. If - * end_time is not set, it is default to current timestamp. If start_time is - * not set, the snapshot of the assets at end_time will be returned. The - * returned results contain all temporal assets whose time window overlap with - * read_time_window. - * - * This object should have the same structure as [TimeWindow]{@link google.cloud.asset.v1.TimeWindow} - * @param {string[]} [request.assetNames] - * A list of the full names of the assets. For example: - * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. - * See [Resource - * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) - * and [Resource Name - * Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) - * for more info. - * - * The request becomes a no-op if the asset name list is empty, and the max - * size of the asset name list is 100 in one request. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [BatchGetAssetsHistoryResponse]{@link google.cloud.asset.v1.BatchGetAssetsHistoryResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [BatchGetAssetsHistoryResponse]{@link google.cloud.asset.v1.BatchGetAssetsHistoryResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const asset = require('asset.v1'); - * - * const client = new asset.v1.AssetServiceClient({ - * // optional auth parameters. - * }); - * - * const parent = ''; - * const contentType = 'CONTENT_TYPE_UNSPECIFIED'; - * const readTimeWindow = {}; - * const request = { - * parent: parent, - * contentType: contentType, - * readTimeWindow: readTimeWindow, - * }; - * client.batchGetAssetsHistory(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - batchGetAssetsHistory(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - 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, - }); - - return this._innerApiCalls.batchGetAssetsHistory( - request, - options, - callback - ); - } - - /** - * Creates a feed in a parent project/folder/organization to listen to its - * asset updates. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project/folder/organization where this feed - * should be created in. It can only be an organization number (such as - * "organizations/123"), a folder number (such as "folders/123"), a project ID - * (such as "projects/my-project-id")", or a project number (such as - * "projects/12345"). - * @param {string} request.feedId - * Required. This is the client-assigned asset feed identifier and it needs to - * be unique under a specific parent project/folder/organization. - * @param {Object} request.feed - * Required. The feed details. The field `name` must be empty and it will be generated - * in the format of: - * projects/project_number/feeds/feed_id - * folders/folder_number/feeds/feed_id - * organizations/organization_number/feeds/feed_id - * - * This object should have the same structure as [Feed]{@link google.cloud.asset.v1.Feed} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Feed]{@link google.cloud.asset.v1.Feed}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Feed]{@link google.cloud.asset.v1.Feed}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const asset = require('asset.v1'); - * - * const client = new asset.v1.AssetServiceClient({ - * // optional auth parameters. - * }); - * - * const parent = ''; - * const feedId = ''; - * const feed = {}; - * const request = { - * parent: parent, - * feedId: feedId, - * feed: feed, - * }; - * client.createFeed(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - createFeed(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - 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, - }); - - return this._innerApiCalls.createFeed(request, options, callback); - } - - /** - * Gets details about an asset feed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Feed and it must be in the format of: - * projects/project_number/feeds/feed_id - * folders/folder_number/feeds/feed_id - * organizations/organization_number/feeds/feed_id - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Feed]{@link google.cloud.asset.v1.Feed}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Feed]{@link google.cloud.asset.v1.Feed}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const asset = require('asset.v1'); - * - * const client = new asset.v1.AssetServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.feedPath('[PROJECT]', '[FEED]'); - * client.getFeed({name: formattedName}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - getFeed(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - 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, - }); - - return this._innerApiCalls.getFeed(request, options, callback); - } - - /** - * Lists all asset feeds in a parent project/folder/organization. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent project/folder/organization whose feeds are to be - * listed. It can only be using project/folder/organization number (such as - * "folders/12345")", or a project ID (such as "projects/my-project-id"). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [ListFeedsResponse]{@link google.cloud.asset.v1.ListFeedsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ListFeedsResponse]{@link google.cloud.asset.v1.ListFeedsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const asset = require('asset.v1'); - * - * const client = new asset.v1.AssetServiceClient({ - * // optional auth parameters. - * }); - * - * const parent = ''; - * client.listFeeds({parent: parent}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - listFeeds(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - 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, - }); - - return this._innerApiCalls.listFeeds(request, options, callback); - } - - /** - * Updates an asset feed configuration. - * - * @param {Object} request - * The request object that will be sent. - * @param {Object} request.feed - * Required. The new values of feed details. It must match an existing feed and the - * field `name` must be in the format of: - * projects/project_number/feeds/feed_id or - * folders/folder_number/feeds/feed_id or - * organizations/organization_number/feeds/feed_id. - * - * This object should have the same structure as [Feed]{@link google.cloud.asset.v1.Feed} - * @param {Object} request.updateMask - * Required. Only updates the `feed` fields indicated by this mask. - * The field mask must not be empty, and it must not contain fields that - * are immutable or only set by the server. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Feed]{@link google.cloud.asset.v1.Feed}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Feed]{@link google.cloud.asset.v1.Feed}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const asset = require('asset.v1'); - * - * const client = new asset.v1.AssetServiceClient({ - * // optional auth parameters. - * }); - * - * const feed = {}; - * const updateMask = {}; - * const request = { - * feed: feed, - * updateMask: updateMask, - * }; - * client.updateFeed(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - updateFeed(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'feed.name': request.feed.name, - }); - - return this._innerApiCalls.updateFeed(request, options, callback); - } - - /** - * Deletes an asset feed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the feed and it must be in the format of: - * projects/project_number/feeds/feed_id - * folders/folder_number/feeds/feed_id - * organizations/organization_number/feeds/feed_id - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error)} [callback] - * The function which will be called with the result of the API call. - * @returns {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const asset = require('asset.v1'); - * - * const client = new asset.v1.AssetServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.feedPath('[PROJECT]', '[FEED]'); - * client.deleteFeed({name: formattedName}).catch(err => { - * console.error(err); - * }); - */ - deleteFeed(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - 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, - }); - - return this._innerApiCalls.deleteFeed(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified feed resource name string. - * - * @param {String} project - * @param {String} feed - * @returns {String} - */ - feedPath(project, feed) { - return this._pathTemplates.feedPathTemplate.render({ - project: project, - feed: feed, - }); - } - - /** - * Return a fully-qualified project resource name string. - * - * @param {String} project - * @returns {String} - */ - projectPath(project) { - return this._pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the feedName from a feed resource. - * - * @param {String} feedName - * A fully-qualified path representing a feed resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromFeedName(feedName) { - return this._pathTemplates.feedPathTemplate.match(feedName).project; - } - - /** - * Parse the feedName from a feed resource. - * - * @param {String} feedName - * A fully-qualified path representing a feed resources. - * @returns {String} - A string representing the feed. - */ - matchFeedFromFeedName(feedName) { - return this._pathTemplates.feedPathTemplate.match(feedName).feed; - } - - /** - * Parse the projectName from a project resource. - * - * @param {String} projectName - * A fully-qualified path representing a project resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromProjectName(projectName) { - return this._pathTemplates.projectPathTemplate.match(projectName).project; - } -} - -module.exports = AssetServiceClient; diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts new file mode 100644 index 00000000000..611eaf99c74 --- /dev/null +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -0,0 +1,1053 @@ +// Copyright 2019 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 gax from 'google-gax'; +import { + APICallback, + Callback, + CallOptions, + Descriptors, + ClientOptions, + LROperation, +} from 'google-gax'; +import * as path from 'path'; + +import * as protosTypes from '../../protos/protos'; +import * as gapicConfig from './asset_service_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Asset service definition. + * @class + * @memberof v1 + */ +export class AssetServiceClient { + private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _innerApiCalls: {[name: string]: Function}; + private _pathTemplates: {[name: string]: gax.PathTemplate}; + private _terminated = false; + auth: gax.GoogleAuth; + operationsClient: gax.OperationsClient; + assetServiceStub: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AssetServiceClient. + * + * @param {object} [options] - The configuration object. See the subsequent + * parameters for more details. + * @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 {function} [options.promise] - Custom promise module to use instead + * of native Promises. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + */ + + constructor(opts?: ClientOptions) { + // Ensure that options include the service address and port. + const staticMembers = this.constructor as typeof AssetServiceClient; + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; + const port = opts && opts.port ? opts.port : staticMembers.port; + + if (!opts) { + opts = {servicePath, port}; + } + opts.servicePath = opts.servicePath || servicePath; + opts.port = opts.port || port; + opts.clientConfig = opts.clientConfig || {}; + + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { + opts.fallback = true; + } + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = (this.constructor as typeof AssetServiceClient).scopes; + const gaxGrpc = new gaxModule.GrpcClient(opts); + + // Save the auth object to the client, for use by other methods. + this.auth = gaxGrpc.auth as gax.GoogleAuth; + + // Determine the client header string. + const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${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' + ); + const protos = gaxGrpc.loadProto( + opts.fallback ? 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 = { + assetPathTemplate: new gaxModule.PathTemplate('*'), + projectFeedPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/feeds/{feed}' + ), + folderFeedPathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/feeds/{feed}' + ), + organizationFeedPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/feeds/{feed}' + ), + }; + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const protoFilesRoot = opts.fallback + ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) + : gaxModule.protobuf.loadSync(nodejsProtoPath); + + this.operationsClient = gaxModule + .lro({ + auth: this.auth, + grpc: 'grpc' in gaxGrpc ? gaxGrpc.grpc : undefined, + }) + .operationsClient(opts); + const exportAssetsResponse = protoFilesRoot.lookup( + '.google.cloud.asset.v1.ExportAssetsResponse' + ) as gax.protobuf.Type; + const exportAssetsMetadata = protoFilesRoot.lookup( + '.google.cloud.asset.v1.ExportAssetsRequest' + ) as gax.protobuf.Type; + + this._descriptors.longrunning = { + exportAssets: new gaxModule.LongrunningDescriptor( + this.operationsClient, + exportAssetsResponse.decode.bind(exportAssetsResponse), + exportAssetsMetadata.decode.bind(exportAssetsMetadata) + ), + }; + + // Put together the default options sent with requests. + const defaults = gaxGrpc.constructSettings( + 'google.cloud.asset.v1.AssetService', + 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 = {}; + + // Put together the "service stub" for + // google.cloud.asset.v1.AssetService. + this.assetServiceStub = gaxGrpc.createStub( + opts.fallback + ? (protos as protobuf.Root).lookupService( + 'google.cloud.asset.v1.AssetService' + ) + : // tslint:disable-next-line no-any + (protos as any).google.cloud.asset.v1.AssetService, + 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 assetServiceStubMethods = [ + 'exportAssets', + 'batchGetAssetsHistory', + 'createFeed', + 'getFeed', + 'listFeeds', + 'updateFeed', + 'deleteFeed', + ]; + + for (const methodName of assetServiceStubMethods) { + const innerCallPromise = this.assetServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + return stub[methodName].apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const apiCall = gaxModule.createApiCall( + innerCallPromise, + defaults[methodName], + this._descriptors.page[methodName] || + this._descriptors.stream[methodName] || + this._descriptors.longrunning[methodName] + ); + + this._innerApiCalls[methodName] = ( + argument: {}, + callOptions?: CallOptions, + callback?: APICallback + ) => { + return apiCall(argument, callOptions, callback); + }; + } + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'cloudasset.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'cloudasset.googleapis.com'; + } + + /** + * The port for this API service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + */ + 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. + * @param {function(Error, string)} callback - the callback to + * be called with the current project Id. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + batchGetAssetsHistory( + request: protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, + ( + | protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest + | undefined + ), + {} | undefined + ] + >; + batchGetAssetsHistory( + request: protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, + | protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest + | undefined, + {} | undefined + > + ): void; + /** + * Batch gets the update history of assets that overlap a time window. + * For RESOURCE content, this API outputs history with asset in both + * non-delete or deleted status. + * For IAM_POLICY content, this API outputs history when the asset and its + * attached IAM POLICY both exist. This can create gaps in the output history. + * If a specified asset does not exist, this API returns an INVALID_ARGUMENT + * error. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The relative name of the root asset. It can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id")", or a project number (such as "projects/12345"). + * @param {string[]} request.assetNames + * A list of the full names of the assets. For example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * See [Resource + * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + * and [Resource Name + * Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) + * for more info. + * + * The request becomes a no-op if the asset name list is empty, and the max + * size of the asset name list is 100 in one request. + * @param {google.cloud.asset.v1.ContentType} [request.contentType] + * Optional. The content type. + * @param {google.cloud.asset.v1.TimeWindow} [request.readTimeWindow] + * Optional. The time window for the asset history. Both start_time and + * end_time are optional and if set, it must be after 2018-10-02 UTC. If + * end_time is not set, it is default to current timestamp. If start_time is + * not set, the snapshot of the assets at end_time will be returned. The + * returned results contain all temporal assets whose time window overlap with + * read_time_window. + * @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 [BatchGetAssetsHistoryResponse]{@link google.cloud.asset.v1.BatchGetAssetsHistoryResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + batchGetAssetsHistory( + request: protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, + | protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, + | protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, + ( + | protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 || '', + }); + return this._innerApiCalls.batchGetAssetsHistory( + request, + options, + callback + ); + } + createFeed( + request: protosTypes.google.cloud.asset.v1.ICreateFeedRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.asset.v1.IFeed, + protosTypes.google.cloud.asset.v1.ICreateFeedRequest | undefined, + {} | undefined + ] + >; + createFeed( + request: protosTypes.google.cloud.asset.v1.ICreateFeedRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.asset.v1.IFeed, + protosTypes.google.cloud.asset.v1.ICreateFeedRequest | undefined, + {} | undefined + > + ): void; + /** + * Creates a feed in a parent project/folder/organization to listen to its + * asset updates. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project/folder/organization where this feed + * should be created in. It can only be an organization number (such as + * "organizations/123"), a folder number (such as "folders/123"), a project ID + * (such as "projects/my-project-id")", or a project number (such as + * "projects/12345"). + * @param {string} request.feedId + * Required. This is the client-assigned asset feed identifier and it needs to + * be unique under a specific parent project/folder/organization. + * @param {google.cloud.asset.v1.Feed} request.feed + * Required. The feed details. The field `name` must be empty and it will be generated + * in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_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. + * The first element of the array is an object representing [Feed]{@link google.cloud.asset.v1.Feed}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createFeed( + request: protosTypes.google.cloud.asset.v1.ICreateFeedRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.asset.v1.IFeed, + protosTypes.google.cloud.asset.v1.ICreateFeedRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.asset.v1.IFeed, + protosTypes.google.cloud.asset.v1.ICreateFeedRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.asset.v1.IFeed, + protosTypes.google.cloud.asset.v1.ICreateFeedRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 || '', + }); + return this._innerApiCalls.createFeed(request, options, callback); + } + getFeed( + request: protosTypes.google.cloud.asset.v1.IGetFeedRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.asset.v1.IFeed, + protosTypes.google.cloud.asset.v1.IGetFeedRequest | undefined, + {} | undefined + ] + >; + getFeed( + request: protosTypes.google.cloud.asset.v1.IGetFeedRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.asset.v1.IFeed, + protosTypes.google.cloud.asset.v1.IGetFeedRequest | undefined, + {} | undefined + > + ): void; + /** + * Gets details about an asset feed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_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. + * The first element of the array is an object representing [Feed]{@link google.cloud.asset.v1.Feed}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getFeed( + request: protosTypes.google.cloud.asset.v1.IGetFeedRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.asset.v1.IFeed, + protosTypes.google.cloud.asset.v1.IGetFeedRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.asset.v1.IFeed, + protosTypes.google.cloud.asset.v1.IGetFeedRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.asset.v1.IFeed, + protosTypes.google.cloud.asset.v1.IGetFeedRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 || '', + }); + return this._innerApiCalls.getFeed(request, options, callback); + } + listFeeds( + request: protosTypes.google.cloud.asset.v1.IListFeedsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.asset.v1.IListFeedsResponse, + protosTypes.google.cloud.asset.v1.IListFeedsRequest | undefined, + {} | undefined + ] + >; + listFeeds( + request: protosTypes.google.cloud.asset.v1.IListFeedsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.asset.v1.IListFeedsResponse, + protosTypes.google.cloud.asset.v1.IListFeedsRequest | undefined, + {} | undefined + > + ): void; + /** + * Lists all asset feeds in a parent project/folder/organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent project/folder/organization whose feeds are to be + * listed. It can only be using project/folder/organization number (such as + * "folders/12345")", or a project ID (such as "projects/my-project-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. + * The first element of the array is an object representing [ListFeedsResponse]{@link google.cloud.asset.v1.ListFeedsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listFeeds( + request: protosTypes.google.cloud.asset.v1.IListFeedsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.asset.v1.IListFeedsResponse, + protosTypes.google.cloud.asset.v1.IListFeedsRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.asset.v1.IListFeedsResponse, + protosTypes.google.cloud.asset.v1.IListFeedsRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.asset.v1.IListFeedsResponse, + protosTypes.google.cloud.asset.v1.IListFeedsRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 || '', + }); + return this._innerApiCalls.listFeeds(request, options, callback); + } + updateFeed( + request: protosTypes.google.cloud.asset.v1.IUpdateFeedRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.asset.v1.IFeed, + protosTypes.google.cloud.asset.v1.IUpdateFeedRequest | undefined, + {} | undefined + ] + >; + updateFeed( + request: protosTypes.google.cloud.asset.v1.IUpdateFeedRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.asset.v1.IFeed, + protosTypes.google.cloud.asset.v1.IUpdateFeedRequest | undefined, + {} | undefined + > + ): void; + /** + * Updates an asset feed configuration. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.asset.v1.Feed} request.feed + * Required. The new values of feed details. It must match an existing feed and the + * field `name` must be in the format of: + * projects/project_number/feeds/feed_id or + * folders/folder_number/feeds/feed_id or + * organizations/organization_number/feeds/feed_id. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Only updates the `feed` fields indicated by this mask. + * The field mask must not be empty, and it must not contain fields that + * are immutable or only set by the server. + * @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 [Feed]{@link google.cloud.asset.v1.Feed}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateFeed( + request: protosTypes.google.cloud.asset.v1.IUpdateFeedRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.asset.v1.IFeed, + protosTypes.google.cloud.asset.v1.IUpdateFeedRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.asset.v1.IFeed, + protosTypes.google.cloud.asset.v1.IUpdateFeedRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.asset.v1.IFeed, + protosTypes.google.cloud.asset.v1.IUpdateFeedRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'feed.name': request.feed!.name || '', + }); + return this._innerApiCalls.updateFeed(request, options, callback); + } + deleteFeed( + request: protosTypes.google.cloud.asset.v1.IDeleteFeedRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + protosTypes.google.cloud.asset.v1.IDeleteFeedRequest | undefined, + {} | undefined + ] + >; + deleteFeed( + request: protosTypes.google.cloud.asset.v1.IDeleteFeedRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.cloud.asset.v1.IDeleteFeedRequest | undefined, + {} | undefined + > + ): void; + /** + * Deletes an asset feed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_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. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + deleteFeed( + request: protosTypes.google.cloud.asset.v1.IDeleteFeedRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.cloud.asset.v1.IDeleteFeedRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.cloud.asset.v1.IDeleteFeedRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + protosTypes.google.cloud.asset.v1.IDeleteFeedRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 || '', + }); + return this._innerApiCalls.deleteFeed(request, options, callback); + } + + exportAssets( + request: protosTypes.google.cloud.asset.v1.IExportAssetsRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protosTypes.google.cloud.asset.v1.IExportAssetsResponse, + protosTypes.google.cloud.asset.v1.IExportAssetsRequest + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + exportAssets( + request: protosTypes.google.cloud.asset.v1.IExportAssetsRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protosTypes.google.cloud.asset.v1.IExportAssetsResponse, + protosTypes.google.cloud.asset.v1.IExportAssetsRequest + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): void; + /** + * Exports assets with time and resource types to a given Cloud Storage + * location. The output format is newline-delimited JSON. + * This API implements the [google.longrunning.Operation][google.longrunning.Operation] API allowing you + * to keep track of the export. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The relative name of the root asset. This can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id"), or a project number (such as "projects/12345"), + * or a folder number (such as "folders/123"). + * @param {google.protobuf.Timestamp} request.readTime + * Timestamp to take an asset snapshot. This can only be set to a timestamp + * between 2018-10-02 UTC (inclusive) and the current time. If not specified, + * the current time will be used. Due to delays in resource data collection + * and indexing, there is a volatile window during which running the same + * query may get different results. + * @param {string[]} request.assetTypes + * A list of asset types of which to take a snapshot for. For example: + * "compute.googleapis.com/Disk". If specified, only matching assets will be + * returned. See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types. + * @param {google.cloud.asset.v1.ContentType} request.contentType + * Asset content type. If not specified, no content but the asset name will be + * returned. + * @param {google.cloud.asset.v1.OutputConfig} request.outputConfig + * Required. Output configuration indicating where the results will be output + * to. All results will be in newline delimited JSON format. + * @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 [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + exportAssets( + request: protosTypes.google.cloud.asset.v1.IExportAssetsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protosTypes.google.cloud.asset.v1.IExportAssetsResponse, + protosTypes.google.cloud.asset.v1.IExportAssetsRequest + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + >, + callback?: Callback< + LROperation< + protosTypes.google.cloud.asset.v1.IExportAssetsResponse, + protosTypes.google.cloud.asset.v1.IExportAssetsRequest + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): Promise< + [ + LROperation< + protosTypes.google.cloud.asset.v1.IExportAssetsResponse, + protosTypes.google.cloud.asset.v1.IExportAssetsRequest + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 || '', + }); + return this._innerApiCalls.exportAssets(request, options, callback); + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified asset resource name string. + * + * @returns {string} Resource name string. + */ + assetPath() { + return this._pathTemplates.assetPathTemplate.render({}); + } + + /** + * Return a fully-qualified projectFeed resource name string. + * + * @param {string} project + * @param {string} feed + * @returns {string} Resource name string. + */ + projectFeedPath(project: string, feed: string) { + return this._pathTemplates.projectFeedPathTemplate.render({ + project, + feed, + }); + } + + /** + * Parse the project from ProjectFeed resource. + * + * @param {string} projectFeedName + * A fully-qualified path representing project_feed resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectFeedName(projectFeedName: string) { + return this._pathTemplates.projectFeedPathTemplate.match(projectFeedName) + .project; + } + + /** + * Parse the feed from ProjectFeed resource. + * + * @param {string} projectFeedName + * A fully-qualified path representing project_feed resource. + * @returns {string} A string representing the feed. + */ + matchFeedFromProjectFeedName(projectFeedName: string) { + return this._pathTemplates.projectFeedPathTemplate.match(projectFeedName) + .feed; + } + + /** + * Return a fully-qualified folderFeed resource name string. + * + * @param {string} folder + * @param {string} feed + * @returns {string} Resource name string. + */ + folderFeedPath(folder: string, feed: string) { + return this._pathTemplates.folderFeedPathTemplate.render({ + folder, + feed, + }); + } + + /** + * Parse the folder from FolderFeed resource. + * + * @param {string} folderFeedName + * A fully-qualified path representing folder_feed resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderFeedName(folderFeedName: string) { + return this._pathTemplates.folderFeedPathTemplate.match(folderFeedName) + .folder; + } + + /** + * Parse the feed from FolderFeed resource. + * + * @param {string} folderFeedName + * A fully-qualified path representing folder_feed resource. + * @returns {string} A string representing the feed. + */ + matchFeedFromFolderFeedName(folderFeedName: string) { + return this._pathTemplates.folderFeedPathTemplate.match(folderFeedName) + .feed; + } + + /** + * Return a fully-qualified organizationFeed resource name string. + * + * @param {string} organization + * @param {string} feed + * @returns {string} Resource name string. + */ + organizationFeedPath(organization: string, feed: string) { + return this._pathTemplates.organizationFeedPathTemplate.render({ + organization, + feed, + }); + } + + /** + * Parse the organization from OrganizationFeed resource. + * + * @param {string} organizationFeedName + * A fully-qualified path representing organization_feed resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationFeedName(organizationFeedName: string) { + return this._pathTemplates.organizationFeedPathTemplate.match( + organizationFeedName + ).organization; + } + + /** + * Parse the feed from OrganizationFeed resource. + * + * @param {string} organizationFeedName + * A fully-qualified path representing organization_feed resource. + * @returns {string} A string representing the feed. + */ + matchFeedFromOrganizationFeedName(organizationFeedName: string) { + return this._pathTemplates.organizationFeedPathTemplate.match( + organizationFeedName + ).feed; + } + + /** + * Terminate the GRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + */ + close(): Promise { + if (!this._terminated) { + return this.assetServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-asset/src/v1/asset_service_client_config.json b/packages/google-cloud-asset/src/v1/asset_service_client_config.json index dc56b109a4c..a58073cc047 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client_config.json +++ b/packages/google-cloud-asset/src/v1/asset_service_client_config.json @@ -2,57 +2,52 @@ "interfaces": { "google.cloud.asset.v1.AssetService": { "retry_codes": { + "non_idempotent": [], "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" - ], - "non_idempotent": [] + ] }, "retry_params": { "default": { "initial_retry_delay_millis": 100, "retry_delay_multiplier": 1.3, "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, "total_timeout_millis": 600000 } }, "methods": { "ExportAssets": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "BatchGetAssetsHistory": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "CreateFeed": { - "timeout_millis": 30000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "GetFeed": { - "timeout_millis": 10000, - "retry_codes_name": "idempotent", + "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "ListFeeds": { - "timeout_millis": 10000, - "retry_codes_name": "idempotent", + "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "UpdateFeed": { - "timeout_millis": 30000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "DeleteFeed": { - "timeout_millis": 30000, - "retry_codes_name": "idempotent", + "retry_codes_name": "non_idempotent", "retry_params_name": "default" } } diff --git a/packages/google-cloud-asset/src/v1/asset_service_proto_list.json b/packages/google-cloud-asset/src/v1/asset_service_proto_list.json index 53ef75b9756..3f8fd209c29 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_proto_list.json +++ b/packages/google-cloud-asset/src/v1/asset_service_proto_list.json @@ -1,3 +1,4 @@ [ + "../../protos/google/cloud/asset/v1/assets.proto", "../../protos/google/cloud/asset/v1/asset_service.proto" ] diff --git a/packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_asset_service.js b/packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_asset_service.js deleted file mode 100644 index 4fdebc66c6b..00000000000 --- a/packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_asset_service.js +++ /dev/null @@ -1,465 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Export asset request. - * - * @property {string} parent - * Required. The relative name of the root asset. This can only be an - * organization number (such as "organizations/123"), a project ID (such as - * "projects/my-project-id"), or a project number (such as "projects/12345"), - * or a folder number (such as "folders/123"). - * - * @property {Object} readTime - * Timestamp to take an asset snapshot. This can only be set to a timestamp - * between 2018-10-02 UTC (inclusive) and the current time. If not specified, - * the current time will be used. Due to delays in resource data collection - * and indexing, there is a volatile window during which running the same - * query may get different results. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {string[]} assetTypes - * A list of asset types of which to take a snapshot for. For example: - * "compute.googleapis.com/Disk". If specified, only matching assets will be - * returned. See [Introduction to Cloud Asset - * Inventory](https://cloud.google.com/asset-inventory/docs/overview) - * for all supported asset types. - * - * @property {number} contentType - * Asset content type. If not specified, no content but the asset name will be - * returned. - * - * The number should be among the values of [ContentType]{@link google.cloud.asset.v1.ContentType} - * - * @property {Object} outputConfig - * Required. Output configuration indicating where the results will be output - * to. All results will be in newline delimited JSON format. - * - * This object should have the same structure as [OutputConfig]{@link google.cloud.asset.v1.OutputConfig} - * - * @typedef ExportAssetsRequest - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.ExportAssetsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} - */ -const ExportAssetsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The export asset response. This message is returned by the - * google.longrunning.Operations.GetOperation method in the returned - * google.longrunning.Operation.response field. - * - * @property {Object} readTime - * Time the snapshot was taken. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} outputConfig - * Output configuration indicating where the results were output to. - * All results are in JSON format. - * - * This object should have the same structure as [OutputConfig]{@link google.cloud.asset.v1.OutputConfig} - * - * @typedef ExportAssetsResponse - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.ExportAssetsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} - */ -const ExportAssetsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Batch get assets history request. - * - * @property {string} parent - * Required. The relative name of the root asset. It can only be an - * organization number (such as "organizations/123"), a project ID (such as - * "projects/my-project-id")", or a project number (such as "projects/12345"). - * - * @property {string[]} assetNames - * A list of the full names of the assets. For example: - * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. - * See [Resource - * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) - * and [Resource Name - * Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) - * for more info. - * - * The request becomes a no-op if the asset name list is empty, and the max - * size of the asset name list is 100 in one request. - * - * @property {number} contentType - * Optional. The content type. - * - * The number should be among the values of [ContentType]{@link google.cloud.asset.v1.ContentType} - * - * @property {Object} readTimeWindow - * Optional. The time window for the asset history. Both start_time and - * end_time are optional and if set, it must be after 2018-10-02 UTC. If - * end_time is not set, it is default to current timestamp. If start_time is - * not set, the snapshot of the assets at end_time will be returned. The - * returned results contain all temporal assets whose time window overlap with - * read_time_window. - * - * This object should have the same structure as [TimeWindow]{@link google.cloud.asset.v1.TimeWindow} - * - * @typedef BatchGetAssetsHistoryRequest - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.BatchGetAssetsHistoryRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} - */ -const BatchGetAssetsHistoryRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Batch get assets history response. - * - * @property {Object[]} assets - * A list of assets with valid time windows. - * - * This object should have the same structure as [TemporalAsset]{@link google.cloud.asset.v1.TemporalAsset} - * - * @typedef BatchGetAssetsHistoryResponse - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.BatchGetAssetsHistoryResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} - */ -const BatchGetAssetsHistoryResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Create asset feed request. - * - * @property {string} parent - * Required. The name of the project/folder/organization where this feed - * should be created in. It can only be an organization number (such as - * "organizations/123"), a folder number (such as "folders/123"), a project ID - * (such as "projects/my-project-id")", or a project number (such as - * "projects/12345"). - * - * @property {string} feedId - * Required. This is the client-assigned asset feed identifier and it needs to - * be unique under a specific parent project/folder/organization. - * - * @property {Object} feed - * Required. The feed details. The field `name` must be empty and it will be generated - * in the format of: - * projects/project_number/feeds/feed_id - * folders/folder_number/feeds/feed_id - * organizations/organization_number/feeds/feed_id - * - * This object should have the same structure as [Feed]{@link google.cloud.asset.v1.Feed} - * - * @typedef CreateFeedRequest - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.CreateFeedRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} - */ -const CreateFeedRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Get asset feed request. - * - * @property {string} name - * Required. The name of the Feed and it must be in the format of: - * projects/project_number/feeds/feed_id - * folders/folder_number/feeds/feed_id - * organizations/organization_number/feeds/feed_id - * - * @typedef GetFeedRequest - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.GetFeedRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} - */ -const GetFeedRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * List asset feeds request. - * - * @property {string} parent - * Required. The parent project/folder/organization whose feeds are to be - * listed. It can only be using project/folder/organization number (such as - * "folders/12345")", or a project ID (such as "projects/my-project-id"). - * - * @typedef ListFeedsRequest - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.ListFeedsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} - */ -const ListFeedsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * @property {Object[]} feeds - * A list of feeds. - * - * This object should have the same structure as [Feed]{@link google.cloud.asset.v1.Feed} - * - * @typedef ListFeedsResponse - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.ListFeedsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} - */ -const ListFeedsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Update asset feed request. - * - * @property {Object} feed - * Required. The new values of feed details. It must match an existing feed and the - * field `name` must be in the format of: - * projects/project_number/feeds/feed_id or - * folders/folder_number/feeds/feed_id or - * organizations/organization_number/feeds/feed_id. - * - * This object should have the same structure as [Feed]{@link google.cloud.asset.v1.Feed} - * - * @property {Object} updateMask - * Required. Only updates the `feed` fields indicated by this mask. - * The field mask must not be empty, and it must not contain fields that - * are immutable or only set by the server. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * - * @typedef UpdateFeedRequest - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.UpdateFeedRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} - */ -const UpdateFeedRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * @property {string} name - * Required. The name of the feed and it must be in the format of: - * projects/project_number/feeds/feed_id - * folders/folder_number/feeds/feed_id - * organizations/organization_number/feeds/feed_id - * - * @typedef DeleteFeedRequest - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.DeleteFeedRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} - */ -const DeleteFeedRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Output configuration for export assets destination. - * - * @property {Object} gcsDestination - * Destination on Cloud Storage. - * - * This object should have the same structure as [GcsDestination]{@link google.cloud.asset.v1.GcsDestination} - * - * @property {Object} bigqueryDestination - * Destination on BigQuery. The output table stores the fields in asset - * proto as columns in BigQuery. The resource/iam_policy field is converted - * to a record with each field to a column, except metadata to a single JSON - * string. - * - * This object should have the same structure as [BigQueryDestination]{@link google.cloud.asset.v1.BigQueryDestination} - * - * @typedef OutputConfig - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.OutputConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} - */ -const OutputConfig = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A Cloud Storage location. - * - * @property {string} uri - * The uri of the Cloud Storage object. It's the same uri that is used by - * gsutil. For example: "gs://bucket_name/object_name". See [Viewing and - * Editing Object - * Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) - * for more information. - * - * @property {string} uriPrefix - * The uri prefix of all generated Cloud Storage objects. For example: - * "gs://bucket_name/object_name_prefix". Each object uri is in format: - * "gs://bucket_name/object_name_prefix// and only - * contains assets for that type. starts from 0. For example: - * "gs://bucket_name/object_name_prefix/compute.googleapis.com/Disk/0" is - * the first shard of output objects containing all - * compute.googleapis.com/Disk assets. An INVALID_ARGUMENT error will be - * returned if file with the same name "gs://bucket_name/object_name_prefix" - * already exists. - * - * @typedef GcsDestination - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.GcsDestination definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} - */ -const GcsDestination = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A BigQuery destination. - * - * @property {string} dataset - * Required. The BigQuery dataset in format - * "projects/projectId/datasets/datasetId", to which the snapshot result - * should be exported. If this dataset does not exist, the export call returns - * an error. - * - * @property {string} table - * Required. The BigQuery table to which the snapshot result should be - * written. If this table does not exist, a new table with the given name - * will be created. - * - * @property {boolean} force - * If the destination table already exists and this flag is `TRUE`, the - * table will be overwritten by the contents of assets snapshot. If the flag - * is not set and the destination table already exists, the export call - * returns an error. - * - * @typedef BigQueryDestination - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.BigQueryDestination definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} - */ -const BigQueryDestination = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A Cloud Pubsub destination. - * - * @property {string} topic - * The name of the Cloud Pub/Sub topic to publish to. - * For example: `projects/PROJECT_ID/topics/TOPIC_ID`. - * - * @typedef PubsubDestination - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.PubsubDestination definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} - */ -const PubsubDestination = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Output configuration for asset feed destination. - * - * @property {Object} pubsubDestination - * Destination on Cloud Pubsub. - * - * This object should have the same structure as [PubsubDestination]{@link google.cloud.asset.v1.PubsubDestination} - * - * @typedef FeedOutputConfig - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.FeedOutputConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} - */ -const FeedOutputConfig = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * An asset feed used to export asset updates to a destinations. - * An asset feed filter controls what updates are exported. - * The asset feed must be created within a project, organization, or - * folder. Supported destinations are: - * Cloud Pub/Sub topics. - * - * @property {string} name - * Required. The format will be - * projects/{project_number}/feeds/{client-assigned_feed_identifier} or - * folders/{folder_number}/feeds/{client-assigned_feed_identifier} or - * organizations/{organization_number}/feeds/{client-assigned_feed_identifier} - * - * The client-assigned feed identifier must be unique within the parent - * project/folder/organization. - * - * @property {string[]} assetNames - * A list of the full names of the assets to receive updates. You must specify - * either or both of asset_names and asset_types. Only asset updates matching - * specified asset_names and asset_types are exported to the feed. For - * example: - * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. - * See [Resource - * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) - * for more info. - * - * @property {string[]} assetTypes - * A list of types of the assets to receive updates. You must specify either - * or both of asset_names and asset_types. Only asset updates matching - * specified asset_names and asset_types are exported to the feed. - * For example: - * "compute.googleapis.com/Disk" See [Introduction to Cloud Asset - * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) - * for all supported asset types. - * - * @property {number} contentType - * Asset content type. If not specified, no content but the asset name and - * type will be returned. - * - * The number should be among the values of [ContentType]{@link google.cloud.asset.v1.ContentType} - * - * @property {Object} feedOutputConfig - * Required. Feed output configuration defining where the asset updates are - * published to. - * - * This object should have the same structure as [FeedOutputConfig]{@link google.cloud.asset.v1.FeedOutputConfig} - * - * @typedef Feed - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.Feed definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/asset_service.proto} - */ -const Feed = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Asset content type. - * - * @enum {number} - * @memberof google.cloud.asset.v1 - */ -const ContentType = { - - /** - * Unspecified content type. - */ - CONTENT_TYPE_UNSPECIFIED: 0, - - /** - * Resource metadata. - */ - RESOURCE: 1, - - /** - * The actual IAM policy set on a resource. - */ - IAM_POLICY: 2, - - /** - * The Cloud Organization Policy set on an asset. - */ - ORG_POLICY: 4, - - /** - * The Cloud Access context mananger Policy set on an asset. - */ - ACCESS_POLICY: 5 -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_assets.js b/packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_assets.js deleted file mode 100644 index 3bea7af7cbf..00000000000 --- a/packages/google-cloud-asset/src/v1/doc/google/cloud/asset/v1/doc_assets.js +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Temporal asset. In addition to the asset, the temporal asset includes the - * status of the asset and valid from and to time of it. - * - * @property {Object} window - * The time window when the asset data and state was observed. - * - * This object should have the same structure as [TimeWindow]{@link google.cloud.asset.v1.TimeWindow} - * - * @property {boolean} deleted - * If the asset is deleted or not. - * - * @property {Object} asset - * Asset. - * - * This object should have the same structure as [Asset]{@link google.cloud.asset.v1.Asset} - * - * @typedef TemporalAsset - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.TemporalAsset definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/assets.proto} - */ -const TemporalAsset = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A time window of (start_time, end_time]. - * - * @property {Object} startTime - * Start time of the time window (exclusive). - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} endTime - * End time of the time window (inclusive). - * Current timestamp if not specified. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @typedef TimeWindow - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.TimeWindow definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/assets.proto} - */ -const TimeWindow = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Cloud asset. This includes all Google Cloud Platform resources, - * Cloud IAM policies, and other non-GCP assets. - * - * @property {string} name - * The full name of the asset. For example: - * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. - * See [Resource - * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) - * for more information. - * - * @property {string} assetType - * Type of the asset. Example: "compute.googleapis.com/Disk". - * - * @property {Object} resource - * Representation of the resource. - * - * This object should have the same structure as [Resource]{@link google.cloud.asset.v1.Resource} - * - * @property {Object} iamPolicy - * Representation of the actual Cloud IAM policy set on a cloud resource. For - * each resource, there must be at most one Cloud IAM policy set on it. - * - * This object should have the same structure as [Policy]{@link google.iam.v1.Policy} - * - * @property {string[]} ancestors - * Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy, - * represented as a list of relative resource names. Ancestry path starts with - * the closest CRM ancestor and ends at root. If the asset is a CRM - * project/folder/organization, this starts from the asset itself. - * - * Example: ["projects/123456789", "folders/5432", "organizations/1234"] - * - * @typedef Asset - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.Asset definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/assets.proto} - */ -const Asset = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Representation of a cloud resource. - * - * @property {string} version - * The API version. Example: "v1". - * - * @property {string} discoveryDocumentUri - * The URL of the discovery document containing the resource's JSON schema. - * For example: - * [`"https://www.googleapis.com/discovery/v1/apis/compute/v1/rest"`](https://www.googleapis.com/discovery/v1/apis/compute/v1/rest). - * It will be left unspecified for resources without a discovery-based API, - * such as Cloud Bigtable. - * - * @property {string} discoveryName - * The JSON schema name listed in the discovery document. - * Example: "Project". It will be left unspecified for resources (such as - * Cloud Bigtable) without a discovery-based API. - * - * @property {string} resourceUrl - * The REST URL for accessing the resource. An HTTP GET operation using this - * URL returns the resource itself. - * Example: - * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`. - * It will be left unspecified for resources without a REST API. - * - * @property {string} parent - * The full name of the immediate parent of this resource. See - * [Resource - * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) - * for more information. - * - * For GCP assets, it is the parent resource defined in the [Cloud IAM policy - * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). - * For example: - * `"//cloudresourcemanager.googleapis.com/projects/my_project_123"`. - * - * For third-party assets, it is up to the users to define. - * - * @property {Object} data - * The content of the resource, in which some sensitive fields are scrubbed - * away and may not be present. - * - * This object should have the same structure as [Struct]{@link google.protobuf.Struct} - * - * @typedef Resource - * @memberof google.cloud.asset.v1 - * @see [google.cloud.asset.v1.Resource definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1/assets.proto} - */ -const Resource = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js deleted file mode 100644 index f2ac79a7afa..00000000000 --- a/packages/google-cloud-asset/src/v1/doc/google/iam/v1/doc_policy.js +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Defines an Identity and Access Management (IAM) policy. It is used to - * specify access control policies for Cloud Platform resources. - * - * - * A `Policy` is a collection of `bindings`. A `binding` binds one or more - * `members` to a single `role`. Members can be user accounts, service accounts, - * Google groups, and domains (such as G Suite). A `role` is a named list of - * permissions (defined by IAM or configured by users). A `binding` can - * optionally specify a `condition`, which is a logic expression that further - * constrains the role binding based on attributes about the request and/or - * target resource. - * - * **JSON Example** - * - * { - * "bindings": [ - * { - * "role": "roles/resourcemanager.organizationAdmin", - * "members": [ - * "user:mike@example.com", - * "group:admins@example.com", - * "domain:google.com", - * "serviceAccount:my-project-id@appspot.gserviceaccount.com" - * ] - * }, - * { - * "role": "roles/resourcemanager.organizationViewer", - * "members": ["user:eve@example.com"], - * "condition": { - * "title": "expirable access", - * "description": "Does not grant access after Sep 2020", - * "expression": "request.time < - * timestamp('2020-10-01T00:00:00.000Z')", - * } - * } - * ] - * } - * - * **YAML Example** - * - * bindings: - * - members: - * - user:mike@example.com - * - group:admins@example.com - * - domain:google.com - * - serviceAccount:my-project-id@appspot.gserviceaccount.com - * role: roles/resourcemanager.organizationAdmin - * - members: - * - user:eve@example.com - * role: roles/resourcemanager.organizationViewer - * condition: - * title: expirable access - * description: Does not grant access after Sep 2020 - * expression: request.time < timestamp('2020-10-01T00:00:00.000Z') - * - * For a description of IAM and its features, see the - * [IAM developer's guide](https://cloud.google.com/iam/docs). - * - * @property {number} version - * Specifies the format of the policy. - * - * Valid values are 0, 1, and 3. Requests specifying an invalid value will be - * rejected. - * - * Operations affecting conditional bindings must specify version 3. This can - * be either setting a conditional policy, modifying a conditional binding, - * or removing a binding (conditional or unconditional) from the stored - * conditional policy. - * Operations on non-conditional policies may specify any valid value or - * leave the field unset. - * - * If no etag is provided in the call to `setIamPolicy`, version compliance - * checks against the stored policy is skipped. - * - * @property {Object[]} bindings - * Associates a list of `members` to a `role`. Optionally may specify a - * `condition` that determines when binding is in effect. - * `bindings` with no members will result in an error. - * - * This object should have the same structure as [Binding]{@link google.iam.v1.Binding} - * - * @property {Buffer} etag - * `etag` is used for optimistic concurrency control as a way to help - * prevent simultaneous updates of a policy from overwriting each other. - * It is strongly suggested that systems make use of the `etag` in the - * read-modify-write cycle to perform policy updates in order to avoid race - * conditions: An `etag` is returned in the response to `getIamPolicy`, and - * systems are expected to put that etag in the request to `setIamPolicy` to - * ensure that their change will be applied to the same version of the policy. - * - * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten. Due to blind-set semantics of an etag-less policy, - * 'setIamPolicy' will not fail even if the incoming policy version does not - * meet the requirements for modifying the stored policy. - * - * @typedef Policy - * @memberof google.iam.v1 - * @see [google.iam.v1.Policy definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} - */ -const Policy = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Associates `members` with a `role`. - * - * @property {string} role - * Role that is assigned to `members`. - * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - * - * @property {string[]} members - * Specifies the identities requesting access for a Cloud Platform resource. - * `members` can have the following values: - * - * * `allUsers`: A special identifier that represents anyone who is - * on the internet; with or without a Google account. - * - * * `allAuthenticatedUsers`: A special identifier that represents anyone - * who is authenticated with a Google account or a service account. - * - * * `user:{emailid}`: An email address that represents a specific Google - * account. For example, `alice@example.com` . - * - * - * * `serviceAccount:{emailid}`: An email address that represents a service - * account. For example, `my-other-app@appspot.gserviceaccount.com`. - * - * * `group:{emailid}`: An email address that represents a Google group. - * For example, `admins@example.com`. - * - * - * * `domain:{domain}`: The G Suite domain (primary) that represents all the - * users of that domain. For example, `google.com` or `example.com`. - * - * @property {Object} condition - * The condition that is associated with this binding. - * NOTE: An unsatisfied condition will not allow user access via current - * binding. Different bindings, including their conditions, are examined - * independently. - * - * This object should have the same structure as [Expr]{@link google.type.Expr} - * - * @typedef Binding - * @memberof google.iam.v1 - * @see [google.iam.v1.Binding definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} - */ -const Binding = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1/doc/google/longrunning/doc_operations.js b/packages/google-cloud-asset/src/v1/doc/google/longrunning/doc_operations.js deleted file mode 100644 index 099e418d620..00000000000 --- a/packages/google-cloud-asset/src/v1/doc/google/longrunning/doc_operations.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * This resource represents a long-running operation that is the result of a - * network API call. - * - * @property {string} name - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the - * `name` should be a resource name ending with `operations/{unique_id}`. - * - * @property {Object} metadata - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. - * Some services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - * - * This object should have the same structure as [Any]{@link google.protobuf.Any} - * - * @property {boolean} done - * If the value is `false`, it means the operation is still in progress. - * If `true`, the operation is completed, and either `error` or `response` is - * available. - * - * @property {Object} error - * The error result of the operation in case of failure or cancellation. - * - * This object should have the same structure as [Status]{@link google.rpc.Status} - * - * @property {Object} response - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` - * is the original method name. For example, if the original method name - * is `TakeSnapshot()`, the inferred response type is - * `TakeSnapshotResponse`. - * - * This object should have the same structure as [Any]{@link google.protobuf.Any} - * - * @typedef Operation - * @memberof google.longrunning - * @see [google.longrunning.Operation definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} - */ -const Operation = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_any.js b/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_any.js deleted file mode 100644 index 813682aa336..00000000000 --- a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_any.js +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * `Any` contains an arbitrary serialized protocol buffer message along with a - * URL that describes the type of the serialized message. - * - * Protobuf library provides support to pack/unpack Any values in the form - * of utility functions or additional generated methods of the Any type. - * - * Example 1: Pack and unpack a message in C++. - * - * Foo foo = ...; - * Any any; - * any.PackFrom(foo); - * ... - * if (any.UnpackTo(&foo)) { - * ... - * } - * - * Example 2: Pack and unpack a message in Java. - * - * Foo foo = ...; - * Any any = Any.pack(foo); - * ... - * if (any.is(Foo.class)) { - * foo = any.unpack(Foo.class); - * } - * - * Example 3: Pack and unpack a message in Python. - * - * foo = Foo(...) - * any = Any() - * any.Pack(foo) - * ... - * if any.Is(Foo.DESCRIPTOR): - * any.Unpack(foo) - * ... - * - * Example 4: Pack and unpack a message in Go - * - * foo := &pb.Foo{...} - * any, err := ptypes.MarshalAny(foo) - * ... - * foo := &pb.Foo{} - * if err := ptypes.UnmarshalAny(any, foo); err != nil { - * ... - * } - * - * The pack methods provided by protobuf library will by default use - * 'type.googleapis.com/full.type.name' as the type URL and the unpack - * methods only use the fully qualified type name after the last '/' - * in the type URL, for example "foo.bar.com/x/y.z" will yield type - * name "y.z". - * - * - * # JSON - * - * The JSON representation of an `Any` value uses the regular - * representation of the deserialized, embedded message, with an - * additional field `@type` which contains the type URL. Example: - * - * package google.profile; - * message Person { - * string first_name = 1; - * string last_name = 2; - * } - * - * { - * "@type": "type.googleapis.com/google.profile.Person", - * "firstName": , - * "lastName": - * } - * - * If the embedded message type is well-known and has a custom JSON - * representation, that representation will be embedded adding a field - * `value` which holds the custom JSON in addition to the `@type` - * field. Example (for message google.protobuf.Duration): - * - * { - * "@type": "type.googleapis.com/google.protobuf.Duration", - * "value": "1.212s" - * } - * - * @property {string} typeUrl - * A URL/resource name that uniquely identifies the type of the serialized - * protocol buffer message. This string must contain at least - * one "/" character. The last segment of the URL's path must represent - * the fully qualified name of the type (as in - * `path/google.protobuf.Duration`). The name should be in a canonical form - * (e.g., leading "." is not accepted). - * - * In practice, teams usually precompile into the binary all types that they - * expect it to use in the context of Any. However, for URLs which use the - * scheme `http`, `https`, or no scheme, one can optionally set up a type - * server that maps type URLs to message definitions as follows: - * - * * If no scheme is provided, `https` is assumed. - * * An HTTP GET on the URL must yield a google.protobuf.Type - * value in binary format, or produce an error. - * * Applications are allowed to cache lookup results based on the - * URL, or have them precompiled into a binary to avoid any - * lookup. Therefore, binary compatibility needs to be preserved - * on changes to types. (Use versioned type names to manage - * breaking changes.) - * - * Note: this functionality is not currently available in the official - * protobuf release, and it is not used for type URLs beginning with - * type.googleapis.com. - * - * Schemes other than `http`, `https` (or the empty scheme) might be - * used with implementation specific semantics. - * - * @property {Buffer} value - * Must be a valid serialized protocol buffer of the above specified type. - * - * @typedef Any - * @memberof google.protobuf - * @see [google.protobuf.Any definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/any.proto} - */ -const Any = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_empty.js b/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_empty.js deleted file mode 100644 index 1e3961d6609..00000000000 --- a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_empty.js +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request - * or the response type of an API method. For instance: - * - * service Foo { - * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - * } - * - * The JSON representation for `Empty` is empty JSON object `{}`. - * @typedef Empty - * @memberof google.protobuf - * @see [google.protobuf.Empty definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/empty.proto} - */ -const Empty = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_field_mask.js b/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_field_mask.js deleted file mode 100644 index 59e745f36c2..00000000000 --- a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_field_mask.js +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * `FieldMask` represents a set of symbolic field paths, for example: - * - * paths: "f.a" - * paths: "f.b.d" - * - * Here `f` represents a field in some root message, `a` and `b` - * fields in the message found in `f`, and `d` a field found in the - * message in `f.b`. - * - * Field masks are used to specify a subset of fields that should be - * returned by a get operation or modified by an update operation. - * Field masks also have a custom JSON encoding (see below). - * - * # Field Masks in Projections - * - * When used in the context of a projection, a response message or - * sub-message is filtered by the API to only contain those fields as - * specified in the mask. For example, if the mask in the previous - * example is applied to a response message as follows: - * - * f { - * a : 22 - * b { - * d : 1 - * x : 2 - * } - * y : 13 - * } - * z: 8 - * - * The result will not contain specific values for fields x,y and z - * (their value will be set to the default, and omitted in proto text - * output): - * - * - * f { - * a : 22 - * b { - * d : 1 - * } - * } - * - * A repeated field is not allowed except at the last position of a - * paths string. - * - * If a FieldMask object is not present in a get operation, the - * operation applies to all fields (as if a FieldMask of all fields - * had been specified). - * - * Note that a field mask does not necessarily apply to the - * top-level response message. In case of a REST get operation, the - * field mask applies directly to the response, but in case of a REST - * list operation, the mask instead applies to each individual message - * in the returned resource list. In case of a REST custom method, - * other definitions may be used. Where the mask applies will be - * clearly documented together with its declaration in the API. In - * any case, the effect on the returned resource/resources is required - * behavior for APIs. - * - * # Field Masks in Update Operations - * - * A field mask in update operations specifies which fields of the - * targeted resource are going to be updated. The API is required - * to only change the values of the fields as specified in the mask - * and leave the others untouched. If a resource is passed in to - * describe the updated values, the API ignores the values of all - * fields not covered by the mask. - * - * If a repeated field is specified for an update operation, new values will - * be appended to the existing repeated field in the target resource. Note that - * a repeated field is only allowed in the last position of a `paths` string. - * - * If a sub-message is specified in the last position of the field mask for an - * update operation, then new value will be merged into the existing sub-message - * in the target resource. - * - * For example, given the target message: - * - * f { - * b { - * d: 1 - * x: 2 - * } - * c: [1] - * } - * - * And an update message: - * - * f { - * b { - * d: 10 - * } - * c: [2] - * } - * - * then if the field mask is: - * - * paths: ["f.b", "f.c"] - * - * then the result will be: - * - * f { - * b { - * d: 10 - * x: 2 - * } - * c: [1, 2] - * } - * - * An implementation may provide options to override this default behavior for - * repeated and message fields. - * - * In order to reset a field's value to the default, the field must - * be in the mask and set to the default value in the provided resource. - * Hence, in order to reset all fields of a resource, provide a default - * instance of the resource and set all fields in the mask, or do - * not provide a mask as described below. - * - * If a field mask is not present on update, the operation applies to - * all fields (as if a field mask of all fields has been specified). - * Note that in the presence of schema evolution, this may mean that - * fields the client does not know and has therefore not filled into - * the request will be reset to their default. If this is unwanted - * behavior, a specific service may require a client to always specify - * a field mask, producing an error if not. - * - * As with get operations, the location of the resource which - * describes the updated values in the request message depends on the - * operation kind. In any case, the effect of the field mask is - * required to be honored by the API. - * - * ## Considerations for HTTP REST - * - * The HTTP kind of an update operation which uses a field mask must - * be set to PATCH instead of PUT in order to satisfy HTTP semantics - * (PUT must only be used for full updates). - * - * # JSON Encoding of Field Masks - * - * In JSON, a field mask is encoded as a single string where paths are - * separated by a comma. Fields name in each path are converted - * to/from lower-camel naming conventions. - * - * As an example, consider the following message declarations: - * - * message Profile { - * User user = 1; - * Photo photo = 2; - * } - * message User { - * string display_name = 1; - * string address = 2; - * } - * - * In proto a field mask for `Profile` may look as such: - * - * mask { - * paths: "user.display_name" - * paths: "photo" - * } - * - * In JSON, the same mask is represented as below: - * - * { - * mask: "user.displayName,photo" - * } - * - * # Field Masks and Oneof Fields - * - * Field masks treat fields in oneofs just as regular fields. Consider the - * following message: - * - * message SampleMessage { - * oneof test_oneof { - * string name = 4; - * SubMessage sub_message = 9; - * } - * } - * - * The field mask can be: - * - * mask { - * paths: "name" - * } - * - * Or: - * - * mask { - * paths: "sub_message" - * } - * - * Note that oneof type names ("test_oneof" in this case) cannot be used in - * paths. - * - * ## Field Mask Verification - * - * The implementation of any API method which has a FieldMask type field in the - * request should verify the included field paths, and return an - * `INVALID_ARGUMENT` error if any path is duplicated or unmappable. - * - * @property {string[]} paths - * The set of field mask paths. - * - * @typedef FieldMask - * @memberof google.protobuf - * @see [google.protobuf.FieldMask definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/field_mask.proto} - */ -const FieldMask = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_struct.js b/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_struct.js deleted file mode 100644 index a143b9a6d2d..00000000000 --- a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_struct.js +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * `Struct` represents a structured data value, consisting of fields - * which map to dynamically typed values. In some languages, `Struct` - * might be supported by a native representation. For example, in - * scripting languages like JS a struct is represented as an - * object. The details of that representation are described together - * with the proto support for the language. - * - * The JSON representation for `Struct` is JSON object. - * - * @property {Object.} fields - * Unordered map of dynamically typed values. - * - * @typedef Struct - * @memberof google.protobuf - * @see [google.protobuf.Struct definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} - */ -const Struct = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * `Value` represents a dynamically typed value which can be either - * null, a number, a string, a boolean, a recursive struct value, or a - * list of values. A producer of value is expected to set one of that - * variants, absence of any variant indicates an error. - * - * The JSON representation for `Value` is JSON value. - * - * @property {number} nullValue - * Represents a null value. - * - * The number should be among the values of [NullValue]{@link google.protobuf.NullValue} - * - * @property {number} numberValue - * Represents a double value. - * - * @property {string} stringValue - * Represents a string value. - * - * @property {boolean} boolValue - * Represents a boolean value. - * - * @property {Object} structValue - * Represents a structured value. - * - * This object should have the same structure as [Struct]{@link google.protobuf.Struct} - * - * @property {Object} listValue - * Represents a repeated `Value`. - * - * This object should have the same structure as [ListValue]{@link google.protobuf.ListValue} - * - * @typedef Value - * @memberof google.protobuf - * @see [google.protobuf.Value definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} - */ -const Value = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * `ListValue` is a wrapper around a repeated field of values. - * - * The JSON representation for `ListValue` is JSON array. - * - * @property {Object[]} values - * Repeated field of dynamically typed values. - * - * This object should have the same structure as [Value]{@link google.protobuf.Value} - * - * @typedef ListValue - * @memberof google.protobuf - * @see [google.protobuf.ListValue definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} - */ -const ListValue = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * `NullValue` is a singleton enumeration to represent the null value for the - * `Value` type union. - * - * The JSON representation for `NullValue` is JSON `null`. - * - * @enum {number} - * @memberof google.protobuf - */ -const NullValue = { - - /** - * Null value. - */ - NULL_VALUE: 0 -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_timestamp.js deleted file mode 100644 index ad801cc9a10..00000000000 --- a/packages/google-cloud-asset/src/v1/doc/google/protobuf/doc_timestamp.js +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at - * nanosecond resolution. The count is relative to an epoch at UTC midnight on - * January 1, 1970, in the proleptic Gregorian calendar which extends the - * Gregorian calendar backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a [24-hour linear - * smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from [RFC - * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * - * Example 5: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" - * where {year} is always expressed using four digits while {month}, {day}, - * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional - * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - * is required. A proto3 JSON serializer should always use UTC (as indicated by - * "Z") when printing the Timestamp type and a proto3 JSON parser should be - * able to accept both UTC and other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - * 01:30 UTC on January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the - * standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - * the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D) to obtain a formatter capable of generating timestamps in this format. - * - * @property {number} seconds - * Represents seconds of UTC time since Unix epoch - * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - * 9999-12-31T23:59:59Z inclusive. - * - * @property {number} nanos - * Non-negative fractions of a second at nanosecond resolution. Negative - * second values with fractions must still have non-negative nanos values - * that count forward in time. Must be from 0 to 999,999,999 - * inclusive. - * - * @typedef Timestamp - * @memberof google.protobuf - * @see [google.protobuf.Timestamp definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto} - */ -const Timestamp = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1/doc/google/rpc/doc_status.js b/packages/google-cloud-asset/src/v1/doc/google/rpc/doc_status.js deleted file mode 100644 index 750e0af7689..00000000000 --- a/packages/google-cloud-asset/src/v1/doc/google/rpc/doc_status.js +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). Each `Status` message contains - * three pieces of data: error code, error message, and error details. - * - * You can find out more about this error model and how to work with it in the - * [API Design Guide](https://cloud.google.com/apis/design/errors). - * - * @property {number} code - * The status code, which should be an enum value of google.rpc.Code. - * - * @property {string} message - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - * - * @property {Object[]} details - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - * - * This object should have the same structure as [Any]{@link google.protobuf.Any} - * - * @typedef Status - * @memberof google.rpc - * @see [google.rpc.Status definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto} - */ -const Status = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1/doc/google/type/doc_expr.js b/packages/google-cloud-asset/src/v1/doc/google/type/doc_expr.js deleted file mode 100644 index c185edde52f..00000000000 --- a/packages/google-cloud-asset/src/v1/doc/google/type/doc_expr.js +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Represents an expression text. Example: - * - * title: "User account presence" - * description: "Determines whether the request has a user account" - * expression: "size(request.user) > 0" - * - * @property {string} expression - * Textual representation of an expression in - * Common Expression Language syntax. - * - * The application context of the containing message determines which - * well-known feature set of CEL is supported. - * - * @property {string} title - * An optional title for the expression, i.e. a short string describing - * its purpose. This can be used e.g. in UIs which allow to enter the - * expression. - * - * @property {string} description - * An optional description of the expression. This is a longer text which - * describes the expression, e.g. when hovered over it in a UI. - * - * @property {string} location - * An optional string indicating the location of the expression for error - * reporting, e.g. a file name and a position in the file. - * - * @typedef Expr - * @memberof google.type - * @see [google.type.Expr definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/type/expr.proto} - */ -const Expr = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/browser.js b/packages/google-cloud-asset/src/v1/index.ts similarity index 66% rename from packages/google-cloud-asset/src/browser.js rename to packages/google-cloud-asset/src/v1/index.ts index 68dc62d25d6..6890c43379a 100644 --- a/packages/google-cloud-asset/src/browser.js +++ b/packages/google-cloud-asset/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,11 +11,9 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** -'use strict'; - -// Set a flag that we are running in a browser bundle. -global.isBrowser = true; - -// Re-export all exports from ./index.js. -module.exports = require('./index'); +export {AssetServiceClient} from './asset_service_client'; diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js b/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts similarity index 53% rename from packages/google-cloud-asset/src/v1beta1/asset_service_client.js rename to packages/google-cloud-asset/src/v1beta1/asset_service_client.ts index 5f534962327..b123bc3bac6 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client.js +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,22 +11,41 @@ // 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. - -'use strict'; - -const gapicConfig = require('./asset_service_client_config.json'); -const gax = require('google-gax'); -const path = require('path'); - -const VERSION = require('../../package.json').version; +// +// ** 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 gax from 'google-gax'; +import { + APICallback, + Callback, + CallOptions, + Descriptors, + ClientOptions, + LROperation, +} from 'google-gax'; +import * as path from 'path'; + +import * as protosTypes from '../../protos/protos'; +import * as gapicConfig from './asset_service_client_config.json'; + +const version = require('../../../package.json').version; /** - * Asset service definition. - * + * Asset service definition. * @class * @memberof v1beta1 */ -class AssetServiceClient { +export class AssetServiceClient { + private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _innerApiCalls: {[name: string]: Function}; + private _pathTemplates: {[name: string]: gax.PathTemplate}; + private _terminated = false; + auth: gax.GoogleAuth; + operationsClient: gax.OperationsClient; + assetServiceStub: Promise<{[name: string]: Function}>; + /** * Construct an instance of AssetServiceClient. * @@ -54,58 +73,55 @@ class AssetServiceClient { * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. */ - constructor(opts) { - opts = opts || {}; - this._descriptors = {}; - if (global.isBrowser) { - // If we're in browser, we use gRPC fallback. - opts.fallback = true; + constructor(opts?: ClientOptions) { + // Ensure that options include the service address and port. + const staticMembers = this.constructor as typeof AssetServiceClient; + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; + const port = opts && opts.port ? opts.port : staticMembers.port; + + if (!opts) { + opts = {servicePath, port}; } + opts.servicePath = opts.servicePath || servicePath; + opts.port = opts.port || port; + opts.clientConfig = opts.clientConfig || {}; + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { + opts.fallback = true; + } // If we are in browser, we are already using fallback because of the // "browser" field in package.json. // But if we were explicitly requested to use fallback, let's do it now. - const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; - - const servicePath = - opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; - - // Ensure that options include the service address and port. - opts = Object.assign( - { - clientConfig: {}, - port: this.constructor.port, - servicePath, - }, - opts - ); + const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. - opts.scopes = this.constructor.scopes; + opts.scopes = (this.constructor as typeof AssetServiceClient).scopes; const gaxGrpc = new gaxModule.GrpcClient(opts); // Save the auth object to the client, for use by other methods. - this.auth = gaxGrpc.auth; + this.auth = gaxGrpc.auth as gax.GoogleAuth; // Determine the client header string. - const clientHeader = []; - + const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; if (typeof process !== 'undefined' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); - } - clientHeader.push(`gax/${gaxModule.version}`); - if (opts.fallback) { - clientHeader.push(`gl-web/${gaxModule.version}`); } else { + clientHeader.push(`gl-web/${gaxModule.version}`); + } + if (!opts.fallback) { clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); } - clientHeader.push(`gapic/${VERSION}`); 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. @@ -125,27 +141,28 @@ class AssetServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - projectPathTemplate: new gaxModule.PathTemplate('projects/{project}'), + assetPathTemplate: new gaxModule.PathTemplate('*'), }; - const protoFilesRoot = opts.fallback - ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) - : gaxModule.protobuf.loadSync(nodejsProtoPath); - // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - this.operationsClient = new gaxModule.lro({ - auth: gaxGrpc.auth, - grpc: gaxGrpc.grpc, - }).operationsClient(opts); + const protoFilesRoot = opts.fallback + ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) + : gaxModule.protobuf.loadSync(nodejsProtoPath); + this.operationsClient = gaxModule + .lro({ + auth: this.auth, + grpc: 'grpc' in gaxGrpc ? gaxGrpc.grpc : undefined, + }) + .operationsClient(opts); const exportAssetsResponse = protoFilesRoot.lookup( - 'google.cloud.asset.v1beta1.ExportAssetsResponse' - ); + '.google.cloud.asset.v1beta1.ExportAssetsResponse' + ) as gax.protobuf.Type; const exportAssetsMetadata = protoFilesRoot.lookup( - 'google.cloud.asset.v1beta1.ExportAssetsRequest' - ); + '.google.cloud.asset.v1beta1.ExportAssetsRequest' + ) as gax.protobuf.Type; this._descriptors.longrunning = { exportAssets: new gaxModule.LongrunningDescriptor( @@ -158,8 +175,8 @@ class AssetServiceClient { // Put together the default options sent with requests. const defaults = gaxGrpc.constructSettings( 'google.cloud.asset.v1beta1.AssetService', - gapicConfig, - opts.clientConfig, + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')} ); @@ -170,30 +187,48 @@ class AssetServiceClient { // Put together the "service stub" for // google.cloud.asset.v1beta1.AssetService. - const assetServiceStub = gaxGrpc.createStub( + this.assetServiceStub = gaxGrpc.createStub( opts.fallback - ? protos.lookupService('google.cloud.asset.v1beta1.AssetService') - : protos.google.cloud.asset.v1beta1.AssetService, + ? (protos as protobuf.Root).lookupService( + 'google.cloud.asset.v1beta1.AssetService' + ) + : // tslint:disable-next-line no-any + (protos as any).google.cloud.asset.v1beta1.AssetService, 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 assetServiceStubMethods = ['exportAssets', 'batchGetAssetsHistory']; + for (const methodName of assetServiceStubMethods) { - const innerCallPromise = assetServiceStub.then( - stub => (...args) => { + const innerCallPromise = this.assetServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } return stub[methodName].apply(stub, args); }, - err => () => { + (err: Error | null | undefined) => () => { throw err; } ); - this._innerApiCalls[methodName] = gaxModule.createApiCall( + + const apiCall = gaxModule.createApiCall( innerCallPromise, defaults[methodName], - this._descriptors.longrunning[methodName] + this._descriptors.page[methodName] || + this._descriptors.stream[methodName] || + this._descriptors.longrunning[methodName] ); + + this._innerApiCalls[methodName] = ( + argument: {}, + callOptions?: CallOptions, + callback?: APICallback + ) => { + return apiCall(argument, callOptions, callback); + }; } } @@ -227,169 +262,57 @@ class AssetServiceClient { return ['https://www.googleapis.com/auth/cloud-platform']; } + getProjectId(): Promise; + getProjectId(callback: Callback): void; /** * Return the project ID used by this class. * @param {function(Error, string)} callback - the callback to * be called with the current project Id. */ - getProjectId(callback) { - return this.auth.getProjectId(callback); + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); } // ------------------- // -- Service calls -- // ------------------- - - /** - * Exports assets with time and resource types to a given Cloud Storage - * location. The output format is newline-delimited JSON. - * This API implements the - * google.longrunning.Operation API allowing - * you to keep track of the export. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The relative name of the root asset. This can only be an - * organization number (such as "organizations/123"), a project ID (such as - * "projects/my-project-id"), a project number (such as "projects/12345"), or - * a folder number (such as "folders/123"). - * @param {Object} request.outputConfig - * Required. Output configuration indicating where the results will be output - * to. All results will be in newline delimited JSON format. - * - * This object should have the same structure as [OutputConfig]{@link google.cloud.asset.v1beta1.OutputConfig} - * @param {Object} [request.readTime] - * Timestamp to take an asset snapshot. This can only be set to a timestamp - * between 2018-10-02 UTC (inclusive) and the current time. If not specified, - * the current time will be used. Due to delays in resource data collection - * and indexing, there is a volatile window during which running the same - * query may get different results. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * @param {string[]} [request.assetTypes] - * A list of asset types of which to take a snapshot for. For example: - * "google.compute.Disk". If specified, only matching assets will be returned. - * See [Introduction to Cloud Asset - * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) - * for all supported asset types. - * @param {number} [request.contentType] - * Asset content type. If not specified, no content but the asset name will be - * returned. - * - * The number should be among the values of [ContentType]{@link google.cloud.asset.v1beta1.ContentType} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const asset = require('asset.v1beta1'); - * - * const client = new asset.v1beta1.AssetServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.projectPath('[PROJECT]'); - * const outputConfig = {}; - * const request = { - * parent: formattedParent, - * outputConfig: outputConfig, - * }; - * - * // Handle the operation using the promise pattern. - * client.exportAssets(request) - * .then(responses => { - * const [operation, initialApiResponse] = responses; - * - * // Operation#promise starts polling for the completion of the LRO. - * return operation.promise(); - * }) - * .then(responses => { - * const result = responses[0]; - * const metadata = responses[1]; - * const finalApiResponse = responses[2]; - * }) - * .catch(err => { - * console.error(err); - * }); - * - * const formattedParent = client.projectPath('[PROJECT]'); - * const outputConfig = {}; - * const request = { - * parent: formattedParent, - * outputConfig: outputConfig, - * }; - * - * // Handle the operation using the event emitter pattern. - * client.exportAssets(request) - * .then(responses => { - * const [operation, initialApiResponse] = responses; - * - * // Adding a listener for the "complete" event starts polling for the - * // completion of the operation. - * operation.on('complete', (result, metadata, finalApiResponse) => { - * // doSomethingWith(result); - * }); - * - * // Adding a listener for the "progress" event causes the callback to be - * // called on any change in metadata when the operation is polled. - * operation.on('progress', (metadata, apiResponse) => { - * // doSomethingWith(metadata) - * }); - * - * // Adding a listener for the "error" event handles any errors found during polling. - * operation.on('error', err => { - * // throw(err); - * }); - * }) - * .catch(err => { - * console.error(err); - * }); - * - * const formattedParent = client.projectPath('[PROJECT]'); - * const outputConfig = {}; - * const request = { - * parent: formattedParent, - * outputConfig: outputConfig, - * }; - * - * // Handle the operation using the await pattern. - * const [operation] = await client.exportAssets(request); - * - * const [response] = await operation.promise(); - */ - exportAssets(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - 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, - }); - - return this._innerApiCalls.exportAssets(request, options, callback); - } - + batchGetAssetsHistory( + request: protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, + ( + | protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest + | undefined + ), + {} | undefined + ] + >; + batchGetAssetsHistory( + request: protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, + | protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest + | undefined, + {} | undefined + > + ): void; /** * Batch gets the update history of assets that overlap a time window. * For RESOURCE content, this API outputs history with asset in both * non-delete or deleted status. * For IAM_POLICY content, this API outputs history when the asset and its * attached IAM POLICY both exist. This can create gaps in the output history. + * If a specified asset does not exist, this API returns an INVALID_ARGUMENT + * error. * * @param {Object} request * The request object that will be sent. @@ -397,20 +320,7 @@ class AssetServiceClient { * Required. The relative name of the root asset. It can only be an * organization number (such as "organizations/123"), a project ID (such as * "projects/my-project-id")", or a project number (such as "projects/12345"). - * @param {number} request.contentType - * Required. The content type. - * - * The number should be among the values of [ContentType]{@link google.cloud.asset.v1beta1.ContentType} - * @param {Object} request.readTimeWindow - * Optional. The time window for the asset history. Both start_time and - * end_time are optional and if set, it must be after 2018-10-02 UTC. If - * end_time is not set, it is default to current timestamp. If start_time is - * not set, the snapshot of the assets at end_time will be returned. The - * returned results contain all temporal assets whose time window overlap with - * read_time_window. - * - * This object should have the same structure as [TimeWindow]{@link google.cloud.asset.v1beta1.TimeWindow} - * @param {string[]} [request.assetNames] + * @param {string[]} request.assetNames * A list of the full names of the assets. For example: * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. * See [Resource @@ -419,57 +329,63 @@ class AssetServiceClient { * * The request becomes a no-op if the asset name list is empty, and the max * size of the asset name list is 100 in one request. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [BatchGetAssetsHistoryResponse]{@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse}. + * @param {google.cloud.asset.v1beta1.ContentType} [request.contentType] + * Optional. The content type. + * @param {google.cloud.asset.v1beta1.TimeWindow} [request.readTimeWindow] + * Optional. The time window for the asset history. Both start_time and + * end_time are optional and if set, it must be after 2018-10-02 UTC. If + * end_time is not set, it is default to current timestamp. If start_time is + * not set, the snapshot of the assets at end_time will be returned. The + * returned results contain all temporal assets whose time window overlap with + * read_time_window. + * @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 [BatchGetAssetsHistoryResponse]{@link google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse}. * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const asset = require('asset.v1beta1'); - * - * const client = new asset.v1beta1.AssetServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.projectPath('[PROJECT]'); - * const contentType = 'CONTENT_TYPE_UNSPECIFIED'; - * const readTimeWindow = {}; - * const request = { - * parent: formattedParent, - * contentType: contentType, - * readTimeWindow: readTimeWindow, - * }; - * client.batchGetAssetsHistory(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); */ - batchGetAssetsHistory(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; + batchGetAssetsHistory( + request: protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, + | protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, + | protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryResponse, + ( + | protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; } - 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, + parent: request.parent || '', }); - return this._innerApiCalls.batchGetAssetsHistory( request, options, @@ -477,32 +393,142 @@ class AssetServiceClient { ); } + exportAssets( + request: protosTypes.google.cloud.asset.v1beta1.IExportAssetsRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protosTypes.google.cloud.asset.v1beta1.IExportAssetsResponse, + protosTypes.google.cloud.asset.v1beta1.IExportAssetsRequest + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + exportAssets( + request: protosTypes.google.cloud.asset.v1beta1.IExportAssetsRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protosTypes.google.cloud.asset.v1beta1.IExportAssetsResponse, + protosTypes.google.cloud.asset.v1beta1.IExportAssetsRequest + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): void; + /** + * Exports assets with time and resource types to a given Cloud Storage + * location. The output format is newline-delimited JSON. + * This API implements the + * [google.longrunning.Operation][google.longrunning.Operation] API allowing + * you to keep track of the export. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The relative name of the root asset. This can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id"), a project number (such as "projects/12345"), or + * a folder number (such as "folders/123"). + * @param {google.protobuf.Timestamp} request.readTime + * Timestamp to take an asset snapshot. This can only be set to a timestamp + * between 2018-10-02 UTC (inclusive) and the current time. If not specified, + * the current time will be used. Due to delays in resource data collection + * and indexing, there is a volatile window during which running the same + * query may get different results. + * @param {string[]} request.assetTypes + * A list of asset types of which to take a snapshot for. For example: + * "google.compute.Disk". If specified, only matching assets will be returned. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) + * for all supported asset types. + * @param {google.cloud.asset.v1beta1.ContentType} request.contentType + * Asset content type. If not specified, no content but the asset name will be + * returned. + * @param {google.cloud.asset.v1beta1.OutputConfig} request.outputConfig + * Required. Output configuration indicating where the results will be output + * to. All results will be in newline delimited JSON format. + * @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 [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + exportAssets( + request: protosTypes.google.cloud.asset.v1beta1.IExportAssetsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protosTypes.google.cloud.asset.v1beta1.IExportAssetsResponse, + protosTypes.google.cloud.asset.v1beta1.IExportAssetsRequest + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + >, + callback?: Callback< + LROperation< + protosTypes.google.cloud.asset.v1beta1.IExportAssetsResponse, + protosTypes.google.cloud.asset.v1beta1.IExportAssetsRequest + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): Promise< + [ + LROperation< + protosTypes.google.cloud.asset.v1beta1.IExportAssetsResponse, + protosTypes.google.cloud.asset.v1beta1.IExportAssetsRequest + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 || '', + }); + return this._innerApiCalls.exportAssets(request, options, callback); + } // -------------------- // -- Path templates -- // -------------------- /** - * Return a fully-qualified project resource name string. + * Return a fully-qualified asset resource name string. * - * @param {String} project - * @returns {String} + * @returns {string} Resource name string. */ - projectPath(project) { - return this._pathTemplates.projectPathTemplate.render({ - project: project, - }); + assetPath() { + return this._pathTemplates.assetPathTemplate.render({}); } /** - * Parse the projectName from a project resource. + * Terminate the GRPC channel and close the client. * - * @param {String} projectName - * A fully-qualified path representing a project resources. - * @returns {String} - A string representing the project. + * The client will no longer be usable and all future behavior is undefined. */ - matchProjectFromProjectName(projectName) { - return this._pathTemplates.projectPathTemplate.match(projectName).project; + close(): Promise { + if (!this._terminated) { + return this.assetServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); } } - -module.exports = AssetServiceClient; diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_client_config.json b/packages/google-cloud-asset/src/v1beta1/asset_service_client_config.json index 412e8028be3..dc9c90c255f 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_client_config.json +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_client_config.json @@ -2,31 +2,31 @@ "interfaces": { "google.cloud.asset.v1beta1.AssetService": { "retry_codes": { + "non_idempotent": [], "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" - ], - "non_idempotent": [] + ] }, "retry_params": { "default": { "initial_retry_delay_millis": 100, "retry_delay_multiplier": 1.3, "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, "total_timeout_millis": 600000 } }, "methods": { "ExportAssets": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "BatchGetAssetsHistory": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" } diff --git a/packages/google-cloud-asset/src/v1beta1/asset_service_proto_list.json b/packages/google-cloud-asset/src/v1beta1/asset_service_proto_list.json index 499bd902e39..e843e78ee54 100644 --- a/packages/google-cloud-asset/src/v1beta1/asset_service_proto_list.json +++ b/packages/google-cloud-asset/src/v1beta1/asset_service_proto_list.json @@ -1,3 +1,4 @@ [ + "../../protos/google/cloud/asset/v1beta1/assets.proto", "../../protos/google/cloud/asset/v1beta1/asset_service.proto" ] diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js b/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js deleted file mode 100644 index cf237147bba..00000000000 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Export asset request. - * - * @property {string} parent - * Required. The relative name of the root asset. This can only be an - * organization number (such as "organizations/123"), a project ID (such as - * "projects/my-project-id"), a project number (such as "projects/12345"), or - * a folder number (such as "folders/123"). - * - * @property {Object} readTime - * Timestamp to take an asset snapshot. This can only be set to a timestamp - * between 2018-10-02 UTC (inclusive) and the current time. If not specified, - * the current time will be used. Due to delays in resource data collection - * and indexing, there is a volatile window during which running the same - * query may get different results. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {string[]} assetTypes - * A list of asset types of which to take a snapshot for. For example: - * "google.compute.Disk". If specified, only matching assets will be returned. - * See [Introduction to Cloud Asset - * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) - * for all supported asset types. - * - * @property {number} contentType - * Asset content type. If not specified, no content but the asset name will be - * returned. - * - * The number should be among the values of [ContentType]{@link google.cloud.asset.v1beta1.ContentType} - * - * @property {Object} outputConfig - * Required. Output configuration indicating where the results will be output - * to. All results will be in newline delimited JSON format. - * - * This object should have the same structure as [OutputConfig]{@link google.cloud.asset.v1beta1.OutputConfig} - * - * @typedef ExportAssetsRequest - * @memberof google.cloud.asset.v1beta1 - * @see [google.cloud.asset.v1beta1.ExportAssetsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/asset_service.proto} - */ -const ExportAssetsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The export asset response. This message is returned by the - * google.longrunning.Operations.GetOperation - * method in the returned - * google.longrunning.Operation.response - * field. - * - * @property {Object} readTime - * Time the snapshot was taken. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} outputConfig - * Output configuration indicating where the results were output to. - * All results are in JSON format. - * - * This object should have the same structure as [OutputConfig]{@link google.cloud.asset.v1beta1.OutputConfig} - * - * @typedef ExportAssetsResponse - * @memberof google.cloud.asset.v1beta1 - * @see [google.cloud.asset.v1beta1.ExportAssetsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/asset_service.proto} - */ -const ExportAssetsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Batch get assets history request. - * - * @property {string} parent - * Required. The relative name of the root asset. It can only be an - * organization number (such as "organizations/123"), a project ID (such as - * "projects/my-project-id")", or a project number (such as "projects/12345"). - * - * @property {string[]} assetNames - * A list of the full names of the assets. For example: - * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. - * See [Resource - * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) - * for more info. - * - * The request becomes a no-op if the asset name list is empty, and the max - * size of the asset name list is 100 in one request. - * - * @property {number} contentType - * Required. The content type. - * - * The number should be among the values of [ContentType]{@link google.cloud.asset.v1beta1.ContentType} - * - * @property {Object} readTimeWindow - * Optional. The time window for the asset history. Both start_time and - * end_time are optional and if set, it must be after 2018-10-02 UTC. If - * end_time is not set, it is default to current timestamp. If start_time is - * not set, the snapshot of the assets at end_time will be returned. The - * returned results contain all temporal assets whose time window overlap with - * read_time_window. - * - * This object should have the same structure as [TimeWindow]{@link google.cloud.asset.v1beta1.TimeWindow} - * - * @typedef BatchGetAssetsHistoryRequest - * @memberof google.cloud.asset.v1beta1 - * @see [google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/asset_service.proto} - */ -const BatchGetAssetsHistoryRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Batch get assets history response. - * - * @property {Object[]} assets - * A list of assets with valid time windows. - * - * This object should have the same structure as [TemporalAsset]{@link google.cloud.asset.v1beta1.TemporalAsset} - * - * @typedef BatchGetAssetsHistoryResponse - * @memberof google.cloud.asset.v1beta1 - * @see [google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/asset_service.proto} - */ -const BatchGetAssetsHistoryResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Output configuration for export assets destination. - * - * @property {Object} gcsDestination - * Destination on Cloud Storage. - * - * This object should have the same structure as [GcsDestination]{@link google.cloud.asset.v1beta1.GcsDestination} - * - * @typedef OutputConfig - * @memberof google.cloud.asset.v1beta1 - * @see [google.cloud.asset.v1beta1.OutputConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/asset_service.proto} - */ -const OutputConfig = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A Cloud Storage location. - * - * @property {string} uri - * The uri of the Cloud Storage object. It's the same uri that is used by - * gsutil. For example: "gs://bucket_name/object_name". See [Viewing and - * Editing Object - * Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) - * for more information. - * - * @typedef GcsDestination - * @memberof google.cloud.asset.v1beta1 - * @see [google.cloud.asset.v1beta1.GcsDestination definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/asset_service.proto} - */ -const GcsDestination = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Asset content type. - * - * @enum {number} - * @memberof google.cloud.asset.v1beta1 - */ -const ContentType = { - - /** - * Unspecified content type. - */ - CONTENT_TYPE_UNSPECIFIED: 0, - - /** - * Resource metadata. - */ - RESOURCE: 1, - - /** - * The actual IAM policy set on a resource. - */ - IAM_POLICY: 2 -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js b/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js deleted file mode 100644 index b7ea3599947..00000000000 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Temporal asset. In addition to the asset, the temporal asset includes the - * status of the asset and valid from and to time of it. - * - * @property {Object} window - * The time window when the asset data and state was observed. - * - * This object should have the same structure as [TimeWindow]{@link google.cloud.asset.v1beta1.TimeWindow} - * - * @property {boolean} deleted - * If the asset is deleted or not. - * - * @property {Object} asset - * Asset. - * - * This object should have the same structure as [Asset]{@link google.cloud.asset.v1beta1.Asset} - * - * @typedef TemporalAsset - * @memberof google.cloud.asset.v1beta1 - * @see [google.cloud.asset.v1beta1.TemporalAsset definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/assets.proto} - */ -const TemporalAsset = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A time window of (start_time, end_time]. - * - * @property {Object} startTime - * Start time of the time window (exclusive). - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} endTime - * End time of the time window (inclusive). - * Current timestamp if not specified. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @typedef TimeWindow - * @memberof google.cloud.asset.v1beta1 - * @see [google.cloud.asset.v1beta1.TimeWindow definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/assets.proto} - */ -const TimeWindow = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Cloud asset. This includes all Google Cloud Platform resources, - * Cloud IAM policies, and other non-GCP assets. - * - * @property {string} name - * The full name of the asset. For example: - * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. - * See [Resource - * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) - * for more information. - * - * @property {string} assetType - * Type of the asset. Example: "google.compute.Disk". - * - * @property {Object} resource - * Representation of the resource. - * - * This object should have the same structure as [Resource]{@link google.cloud.asset.v1beta1.Resource} - * - * @property {Object} iamPolicy - * Representation of the actual Cloud IAM policy set on a cloud resource. For - * each resource, there must be at most one Cloud IAM policy set on it. - * - * This object should have the same structure as [Policy]{@link google.iam.v1.Policy} - * - * @typedef Asset - * @memberof google.cloud.asset.v1beta1 - * @see [google.cloud.asset.v1beta1.Asset definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/assets.proto} - */ -const Asset = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Representation of a cloud resource. - * - * @property {string} version - * The API version. Example: "v1". - * - * @property {string} discoveryDocumentUri - * The URL of the discovery document containing the resource's JSON schema. - * For example: - * [`"https://www.googleapis.com/discovery/v1/apis/compute/v1/rest"`](https://www.googleapis.com/discovery/v1/apis/compute/v1/rest). - * It will be left unspecified for resources without a discovery-based API, - * such as Cloud Bigtable. - * - * @property {string} discoveryName - * The JSON schema name listed in the discovery document. - * Example: "Project". It will be left unspecified for resources (such as - * Cloud Bigtable) without a discovery-based API. - * - * @property {string} resourceUrl - * The REST URL for accessing the resource. An HTTP GET operation using this - * URL returns the resource itself. - * Example: - * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`. - * It will be left unspecified for resources without a REST API. - * - * @property {string} parent - * The full name of the immediate parent of this resource. See - * [Resource - * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) - * for more information. - * - * For GCP assets, it is the parent resource defined in the [Cloud IAM policy - * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). - * For example: - * `"//cloudresourcemanager.googleapis.com/projects/my_project_123"`. - * - * For third-party assets, it is up to the users to define. - * - * @property {Object} data - * The content of the resource, in which some sensitive fields are scrubbed - * away and may not be present. - * - * This object should have the same structure as [Struct]{@link google.protobuf.Struct} - * - * @typedef Resource - * @memberof google.cloud.asset.v1beta1 - * @see [google.cloud.asset.v1beta1.Resource definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1beta1/assets.proto} - */ -const Resource = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js deleted file mode 100644 index f2ac79a7afa..00000000000 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/iam/v1/doc_policy.js +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Defines an Identity and Access Management (IAM) policy. It is used to - * specify access control policies for Cloud Platform resources. - * - * - * A `Policy` is a collection of `bindings`. A `binding` binds one or more - * `members` to a single `role`. Members can be user accounts, service accounts, - * Google groups, and domains (such as G Suite). A `role` is a named list of - * permissions (defined by IAM or configured by users). A `binding` can - * optionally specify a `condition`, which is a logic expression that further - * constrains the role binding based on attributes about the request and/or - * target resource. - * - * **JSON Example** - * - * { - * "bindings": [ - * { - * "role": "roles/resourcemanager.organizationAdmin", - * "members": [ - * "user:mike@example.com", - * "group:admins@example.com", - * "domain:google.com", - * "serviceAccount:my-project-id@appspot.gserviceaccount.com" - * ] - * }, - * { - * "role": "roles/resourcemanager.organizationViewer", - * "members": ["user:eve@example.com"], - * "condition": { - * "title": "expirable access", - * "description": "Does not grant access after Sep 2020", - * "expression": "request.time < - * timestamp('2020-10-01T00:00:00.000Z')", - * } - * } - * ] - * } - * - * **YAML Example** - * - * bindings: - * - members: - * - user:mike@example.com - * - group:admins@example.com - * - domain:google.com - * - serviceAccount:my-project-id@appspot.gserviceaccount.com - * role: roles/resourcemanager.organizationAdmin - * - members: - * - user:eve@example.com - * role: roles/resourcemanager.organizationViewer - * condition: - * title: expirable access - * description: Does not grant access after Sep 2020 - * expression: request.time < timestamp('2020-10-01T00:00:00.000Z') - * - * For a description of IAM and its features, see the - * [IAM developer's guide](https://cloud.google.com/iam/docs). - * - * @property {number} version - * Specifies the format of the policy. - * - * Valid values are 0, 1, and 3. Requests specifying an invalid value will be - * rejected. - * - * Operations affecting conditional bindings must specify version 3. This can - * be either setting a conditional policy, modifying a conditional binding, - * or removing a binding (conditional or unconditional) from the stored - * conditional policy. - * Operations on non-conditional policies may specify any valid value or - * leave the field unset. - * - * If no etag is provided in the call to `setIamPolicy`, version compliance - * checks against the stored policy is skipped. - * - * @property {Object[]} bindings - * Associates a list of `members` to a `role`. Optionally may specify a - * `condition` that determines when binding is in effect. - * `bindings` with no members will result in an error. - * - * This object should have the same structure as [Binding]{@link google.iam.v1.Binding} - * - * @property {Buffer} etag - * `etag` is used for optimistic concurrency control as a way to help - * prevent simultaneous updates of a policy from overwriting each other. - * It is strongly suggested that systems make use of the `etag` in the - * read-modify-write cycle to perform policy updates in order to avoid race - * conditions: An `etag` is returned in the response to `getIamPolicy`, and - * systems are expected to put that etag in the request to `setIamPolicy` to - * ensure that their change will be applied to the same version of the policy. - * - * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten. Due to blind-set semantics of an etag-less policy, - * 'setIamPolicy' will not fail even if the incoming policy version does not - * meet the requirements for modifying the stored policy. - * - * @typedef Policy - * @memberof google.iam.v1 - * @see [google.iam.v1.Policy definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} - */ -const Policy = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Associates `members` with a `role`. - * - * @property {string} role - * Role that is assigned to `members`. - * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - * - * @property {string[]} members - * Specifies the identities requesting access for a Cloud Platform resource. - * `members` can have the following values: - * - * * `allUsers`: A special identifier that represents anyone who is - * on the internet; with or without a Google account. - * - * * `allAuthenticatedUsers`: A special identifier that represents anyone - * who is authenticated with a Google account or a service account. - * - * * `user:{emailid}`: An email address that represents a specific Google - * account. For example, `alice@example.com` . - * - * - * * `serviceAccount:{emailid}`: An email address that represents a service - * account. For example, `my-other-app@appspot.gserviceaccount.com`. - * - * * `group:{emailid}`: An email address that represents a Google group. - * For example, `admins@example.com`. - * - * - * * `domain:{domain}`: The G Suite domain (primary) that represents all the - * users of that domain. For example, `google.com` or `example.com`. - * - * @property {Object} condition - * The condition that is associated with this binding. - * NOTE: An unsatisfied condition will not allow user access via current - * binding. Different bindings, including their conditions, are examined - * independently. - * - * This object should have the same structure as [Expr]{@link google.type.Expr} - * - * @typedef Binding - * @memberof google.iam.v1 - * @see [google.iam.v1.Binding definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} - */ -const Binding = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/longrunning/doc_operations.js b/packages/google-cloud-asset/src/v1beta1/doc/google/longrunning/doc_operations.js deleted file mode 100644 index 099e418d620..00000000000 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/longrunning/doc_operations.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * This resource represents a long-running operation that is the result of a - * network API call. - * - * @property {string} name - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the - * `name` should be a resource name ending with `operations/{unique_id}`. - * - * @property {Object} metadata - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. - * Some services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - * - * This object should have the same structure as [Any]{@link google.protobuf.Any} - * - * @property {boolean} done - * If the value is `false`, it means the operation is still in progress. - * If `true`, the operation is completed, and either `error` or `response` is - * available. - * - * @property {Object} error - * The error result of the operation in case of failure or cancellation. - * - * This object should have the same structure as [Status]{@link google.rpc.Status} - * - * @property {Object} response - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` - * is the original method name. For example, if the original method name - * is `TakeSnapshot()`, the inferred response type is - * `TakeSnapshotResponse`. - * - * This object should have the same structure as [Any]{@link google.protobuf.Any} - * - * @typedef Operation - * @memberof google.longrunning - * @see [google.longrunning.Operation definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} - */ -const Operation = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_any.js b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_any.js deleted file mode 100644 index 813682aa336..00000000000 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_any.js +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * `Any` contains an arbitrary serialized protocol buffer message along with a - * URL that describes the type of the serialized message. - * - * Protobuf library provides support to pack/unpack Any values in the form - * of utility functions or additional generated methods of the Any type. - * - * Example 1: Pack and unpack a message in C++. - * - * Foo foo = ...; - * Any any; - * any.PackFrom(foo); - * ... - * if (any.UnpackTo(&foo)) { - * ... - * } - * - * Example 2: Pack and unpack a message in Java. - * - * Foo foo = ...; - * Any any = Any.pack(foo); - * ... - * if (any.is(Foo.class)) { - * foo = any.unpack(Foo.class); - * } - * - * Example 3: Pack and unpack a message in Python. - * - * foo = Foo(...) - * any = Any() - * any.Pack(foo) - * ... - * if any.Is(Foo.DESCRIPTOR): - * any.Unpack(foo) - * ... - * - * Example 4: Pack and unpack a message in Go - * - * foo := &pb.Foo{...} - * any, err := ptypes.MarshalAny(foo) - * ... - * foo := &pb.Foo{} - * if err := ptypes.UnmarshalAny(any, foo); err != nil { - * ... - * } - * - * The pack methods provided by protobuf library will by default use - * 'type.googleapis.com/full.type.name' as the type URL and the unpack - * methods only use the fully qualified type name after the last '/' - * in the type URL, for example "foo.bar.com/x/y.z" will yield type - * name "y.z". - * - * - * # JSON - * - * The JSON representation of an `Any` value uses the regular - * representation of the deserialized, embedded message, with an - * additional field `@type` which contains the type URL. Example: - * - * package google.profile; - * message Person { - * string first_name = 1; - * string last_name = 2; - * } - * - * { - * "@type": "type.googleapis.com/google.profile.Person", - * "firstName": , - * "lastName": - * } - * - * If the embedded message type is well-known and has a custom JSON - * representation, that representation will be embedded adding a field - * `value` which holds the custom JSON in addition to the `@type` - * field. Example (for message google.protobuf.Duration): - * - * { - * "@type": "type.googleapis.com/google.protobuf.Duration", - * "value": "1.212s" - * } - * - * @property {string} typeUrl - * A URL/resource name that uniquely identifies the type of the serialized - * protocol buffer message. This string must contain at least - * one "/" character. The last segment of the URL's path must represent - * the fully qualified name of the type (as in - * `path/google.protobuf.Duration`). The name should be in a canonical form - * (e.g., leading "." is not accepted). - * - * In practice, teams usually precompile into the binary all types that they - * expect it to use in the context of Any. However, for URLs which use the - * scheme `http`, `https`, or no scheme, one can optionally set up a type - * server that maps type URLs to message definitions as follows: - * - * * If no scheme is provided, `https` is assumed. - * * An HTTP GET on the URL must yield a google.protobuf.Type - * value in binary format, or produce an error. - * * Applications are allowed to cache lookup results based on the - * URL, or have them precompiled into a binary to avoid any - * lookup. Therefore, binary compatibility needs to be preserved - * on changes to types. (Use versioned type names to manage - * breaking changes.) - * - * Note: this functionality is not currently available in the official - * protobuf release, and it is not used for type URLs beginning with - * type.googleapis.com. - * - * Schemes other than `http`, `https` (or the empty scheme) might be - * used with implementation specific semantics. - * - * @property {Buffer} value - * Must be a valid serialized protocol buffer of the above specified type. - * - * @typedef Any - * @memberof google.protobuf - * @see [google.protobuf.Any definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/any.proto} - */ -const Any = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_struct.js b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_struct.js deleted file mode 100644 index a143b9a6d2d..00000000000 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_struct.js +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * `Struct` represents a structured data value, consisting of fields - * which map to dynamically typed values. In some languages, `Struct` - * might be supported by a native representation. For example, in - * scripting languages like JS a struct is represented as an - * object. The details of that representation are described together - * with the proto support for the language. - * - * The JSON representation for `Struct` is JSON object. - * - * @property {Object.} fields - * Unordered map of dynamically typed values. - * - * @typedef Struct - * @memberof google.protobuf - * @see [google.protobuf.Struct definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} - */ -const Struct = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * `Value` represents a dynamically typed value which can be either - * null, a number, a string, a boolean, a recursive struct value, or a - * list of values. A producer of value is expected to set one of that - * variants, absence of any variant indicates an error. - * - * The JSON representation for `Value` is JSON value. - * - * @property {number} nullValue - * Represents a null value. - * - * The number should be among the values of [NullValue]{@link google.protobuf.NullValue} - * - * @property {number} numberValue - * Represents a double value. - * - * @property {string} stringValue - * Represents a string value. - * - * @property {boolean} boolValue - * Represents a boolean value. - * - * @property {Object} structValue - * Represents a structured value. - * - * This object should have the same structure as [Struct]{@link google.protobuf.Struct} - * - * @property {Object} listValue - * Represents a repeated `Value`. - * - * This object should have the same structure as [ListValue]{@link google.protobuf.ListValue} - * - * @typedef Value - * @memberof google.protobuf - * @see [google.protobuf.Value definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} - */ -const Value = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * `ListValue` is a wrapper around a repeated field of values. - * - * The JSON representation for `ListValue` is JSON array. - * - * @property {Object[]} values - * Repeated field of dynamically typed values. - * - * This object should have the same structure as [Value]{@link google.protobuf.Value} - * - * @typedef ListValue - * @memberof google.protobuf - * @see [google.protobuf.ListValue definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} - */ -const ListValue = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * `NullValue` is a singleton enumeration to represent the null value for the - * `Value` type union. - * - * The JSON representation for `NullValue` is JSON `null`. - * - * @enum {number} - * @memberof google.protobuf - */ -const NullValue = { - - /** - * Null value. - */ - NULL_VALUE: 0 -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js deleted file mode 100644 index ad801cc9a10..00000000000 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/protobuf/doc_timestamp.js +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at - * nanosecond resolution. The count is relative to an epoch at UTC midnight on - * January 1, 1970, in the proleptic Gregorian calendar which extends the - * Gregorian calendar backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a [24-hour linear - * smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from [RFC - * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * - * Example 5: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" - * where {year} is always expressed using four digits while {month}, {day}, - * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional - * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - * is required. A proto3 JSON serializer should always use UTC (as indicated by - * "Z") when printing the Timestamp type and a proto3 JSON parser should be - * able to accept both UTC and other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - * 01:30 UTC on January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the - * standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - * the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D) to obtain a formatter capable of generating timestamps in this format. - * - * @property {number} seconds - * Represents seconds of UTC time since Unix epoch - * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - * 9999-12-31T23:59:59Z inclusive. - * - * @property {number} nanos - * Non-negative fractions of a second at nanosecond resolution. Negative - * second values with fractions must still have non-negative nanos values - * that count forward in time. Must be from 0 to 999,999,999 - * inclusive. - * - * @typedef Timestamp - * @memberof google.protobuf - * @see [google.protobuf.Timestamp definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto} - */ -const Timestamp = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/rpc/doc_status.js b/packages/google-cloud-asset/src/v1beta1/doc/google/rpc/doc_status.js deleted file mode 100644 index 750e0af7689..00000000000 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/rpc/doc_status.js +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). Each `Status` message contains - * three pieces of data: error code, error message, and error details. - * - * You can find out more about this error model and how to work with it in the - * [API Design Guide](https://cloud.google.com/apis/design/errors). - * - * @property {number} code - * The status code, which should be an enum value of google.rpc.Code. - * - * @property {string} message - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - * - * @property {Object[]} details - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - * - * This object should have the same structure as [Any]{@link google.protobuf.Any} - * - * @typedef Status - * @memberof google.rpc - * @see [google.rpc.Status definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto} - */ -const Status = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1beta1/doc/google/type/doc_expr.js b/packages/google-cloud-asset/src/v1beta1/doc/google/type/doc_expr.js deleted file mode 100644 index c185edde52f..00000000000 --- a/packages/google-cloud-asset/src/v1beta1/doc/google/type/doc_expr.js +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Represents an expression text. Example: - * - * title: "User account presence" - * description: "Determines whether the request has a user account" - * expression: "size(request.user) > 0" - * - * @property {string} expression - * Textual representation of an expression in - * Common Expression Language syntax. - * - * The application context of the containing message determines which - * well-known feature set of CEL is supported. - * - * @property {string} title - * An optional title for the expression, i.e. a short string describing - * its purpose. This can be used e.g. in UIs which allow to enter the - * expression. - * - * @property {string} description - * An optional description of the expression. This is a longer text which - * describes the expression, e.g. when hovered over it in a UI. - * - * @property {string} location - * An optional string indicating the location of the expression for error - * reporting, e.g. a file name and a position in the file. - * - * @typedef Expr - * @memberof google.type - * @see [google.type.Expr definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/type/expr.proto} - */ -const Expr = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1p2beta1/index.js b/packages/google-cloud-asset/src/v1beta1/index.ts similarity index 66% rename from packages/google-cloud-asset/src/v1p2beta1/index.js rename to packages/google-cloud-asset/src/v1beta1/index.ts index 501c92ee4cf..6890c43379a 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/index.js +++ b/packages/google-cloud-asset/src/v1beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,9 +11,9 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** -'use strict'; - -const AssetServiceClient = require('./asset_service_client'); - -module.exports.AssetServiceClient = AssetServiceClient; +export {AssetServiceClient} from './asset_service_client'; diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts new file mode 100644 index 00000000000..01acc772832 --- /dev/null +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts @@ -0,0 +1,909 @@ +// Copyright 2019 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 gax from 'google-gax'; +import { + APICallback, + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + PaginationResponse, +} from 'google-gax'; +import * as path from 'path'; + +import {Transform} from 'stream'; +import * as protosTypes from '../../protos/protos'; +import * as gapicConfig from './asset_service_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Asset service definition. + * @class + * @memberof v1p1beta1 + */ +export class AssetServiceClient { + private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _innerApiCalls: {[name: string]: Function}; + private _terminated = false; + auth: gax.GoogleAuth; + assetServiceStub: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AssetServiceClient. + * + * @param {object} [options] - The configuration object. See the subsequent + * parameters for more details. + * @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 {function} [options.promise] - Custom promise module to use instead + * of native Promises. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + */ + + constructor(opts?: ClientOptions) { + // Ensure that options include the service address and port. + const staticMembers = this.constructor as typeof AssetServiceClient; + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; + const port = opts && opts.port ? opts.port : staticMembers.port; + + if (!opts) { + opts = {servicePath, port}; + } + opts.servicePath = opts.servicePath || servicePath; + opts.port = opts.port || port; + opts.clientConfig = opts.clientConfig || {}; + + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { + opts.fallback = true; + } + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = (this.constructor as typeof AssetServiceClient).scopes; + const gaxGrpc = new gaxModule.GrpcClient(opts); + + // Save the auth object to the client, for use by other methods. + this.auth = gaxGrpc.auth as gax.GoogleAuth; + + // Determine the client header string. + const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${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' + ); + const protos = gaxGrpc.loadProto( + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + ); + + // 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 = { + searchResources: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'results' + ), + searchIamPolicies: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'results' + ), + searchAllResources: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'results' + ), + searchAllIamPolicies: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'results' + ), + }; + + // Put together the default options sent with requests. + const defaults = gaxGrpc.constructSettings( + 'google.cloud.asset.v1p1beta1.AssetService', + 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 = {}; + + // Put together the "service stub" for + // google.cloud.asset.v1p1beta1.AssetService. + this.assetServiceStub = gaxGrpc.createStub( + opts.fallback + ? (protos as protobuf.Root).lookupService( + 'google.cloud.asset.v1p1beta1.AssetService' + ) + : // tslint:disable-next-line no-any + (protos as any).google.cloud.asset.v1p1beta1.AssetService, + 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 assetServiceStubMethods = [ + 'searchResources', + 'searchIamPolicies', + 'searchAllResources', + 'searchAllIamPolicies', + ]; + + for (const methodName of assetServiceStubMethods) { + const innerCallPromise = this.assetServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + return stub[methodName].apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const apiCall = gaxModule.createApiCall( + innerCallPromise, + defaults[methodName], + this._descriptors.page[methodName] || + this._descriptors.stream[methodName] || + this._descriptors.longrunning[methodName] + ); + + this._innerApiCalls[methodName] = ( + argument: {}, + callOptions?: CallOptions, + callback?: APICallback + ) => { + return apiCall(argument, callOptions, callback); + }; + } + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'cloudasset.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'cloudasset.googleapis.com'; + } + + /** + * The port for this API service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + */ + 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. + * @param {function(Error, string)} callback - the callback to + * be called with the current project Id. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + + searchResources( + request: protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesResponse + ] + >; + searchResources( + request: protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesResponse + > + ): void; + /** + * Searches resources which are accessible with .get permission. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.scope + * Required. The relative name of an asset. The search is limited to the resources + * within the `scope`. The allowed value must be: + * * Organization number (such as "organizations/123") + * * Folder number(such as "folders/1234") + * * Project number (such as "projects/12345") + * @param {string} [request.query] + * Optional. The query statement. + * @param {string[]} [request.assetTypes] + * Optional. A list of asset types that this request searches for. If empty, it will + * search all the supported asset types. + * @param {number} [request.pageSize] + * Optional. The page size for search result pagination. Returned results may be fewer + * than requested. The value of this field is capped at 2000. If set to the + * zero value, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. If present, then retrieve the next batch of results from the preceding call + * to this method. `page_token` must be the value of `next_page_token` from + * the previous response. The values of all other method parameters, must be + * identical to those in the previous call. + * @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 [StandardResourceMetadata]{@link google.cloud.asset.v1p1beta1.StandardResourceMetadata}. + * The client library support 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. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [StandardResourceMetadata]{@link google.cloud.asset.v1p1beta1.StandardResourceMetadata} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [SearchResourcesRequest]{@link google.cloud.asset.v1p1beta1.SearchResourcesRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [SearchResourcesResponse]{@link google.cloud.asset.v1p1beta1.SearchResourcesResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + searchResources( + request: protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesResponse + >, + callback?: Callback< + protosTypes.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesResponse + > + ): Promise< + [ + protosTypes.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + return this._innerApiCalls.searchResources(request, options, callback); + } + + /** + * Equivalent to {@link searchResources}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link searchResources} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.scope + * Required. The relative name of an asset. The search is limited to the resources + * within the `scope`. The allowed value must be: + * * Organization number (such as "organizations/123") + * * Folder number(such as "folders/1234") + * * Project number (such as "projects/12345") + * @param {string} [request.query] + * Optional. The query statement. + * @param {string[]} [request.assetTypes] + * Optional. A list of asset types that this request searches for. If empty, it will + * search all the supported asset types. + * @param {number} [request.pageSize] + * Optional. The page size for search result pagination. Returned results may be fewer + * than requested. The value of this field is capped at 2000. If set to the + * zero value, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. If present, then retrieve the next batch of results from the preceding call + * to this method. `page_token` must be the value of `next_page_token` from + * the previous response. The values of all other method parameters, must be + * identical to those in the previous call. + * @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 [StandardResourceMetadata]{@link google.cloud.asset.v1p1beta1.StandardResourceMetadata} on 'data' event. + */ + searchResourcesStream( + request?: protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest, + options?: gax.CallOptions | {} + ): Transform { + request = request || {}; + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.searchResources.createStream( + this._innerApiCalls.searchResources as gax.GaxCall, + request, + callSettings + ); + } + searchIamPolicies( + request: protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse + ] + >; + searchIamPolicies( + request: protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse + > + ): void; + /** + * Searches IAM policies which are accessible with .getIamPolicy permission. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.scope + * Required. The relative name of an asset. The search is limited to the resources + * within the `scope`. The allowed value must be: + * * Organization number (such as "organizations/123") + * * Folder number(such as "folders/1234") + * * Project number (such as "projects/12345") + * @param {string} [request.query] + * Optional. The query statement. + * Examples: + * * "policy:myuser@mydomain.com" + * * "policy:(myuser@mydomain.com viewer)" + * @param {number} [request.pageSize] + * Optional. The page size for search result pagination. Returned results may be fewer + * than requested. The maximum is 2000. If set to the zero value, the server + * will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. If present, retrieve the next batch of results from the preceding call to + * this method. `page_token` must be the value of `next_page_token` from the + * previous response. The values of all other method parameters must be + * identical to those in the previous call. + * @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 [IamPolicySearchResult]{@link google.cloud.asset.v1p1beta1.IamPolicySearchResult}. + * The client library support 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. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [IamPolicySearchResult]{@link google.cloud.asset.v1p1beta1.IamPolicySearchResult} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [SearchIamPoliciesRequest]{@link google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [SearchIamPoliciesResponse]{@link google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + searchIamPolicies( + request: protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse + >, + callback?: Callback< + protosTypes.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse + > + ): Promise< + [ + protosTypes.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + return this._innerApiCalls.searchIamPolicies(request, options, callback); + } + + /** + * Equivalent to {@link searchIamPolicies}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link searchIamPolicies} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.scope + * Required. The relative name of an asset. The search is limited to the resources + * within the `scope`. The allowed value must be: + * * Organization number (such as "organizations/123") + * * Folder number(such as "folders/1234") + * * Project number (such as "projects/12345") + * @param {string} [request.query] + * Optional. The query statement. + * Examples: + * * "policy:myuser@mydomain.com" + * * "policy:(myuser@mydomain.com viewer)" + * @param {number} [request.pageSize] + * Optional. The page size for search result pagination. Returned results may be fewer + * than requested. The maximum is 2000. If set to the zero value, the server + * will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. If present, retrieve the next batch of results from the preceding call to + * this method. `page_token` must be the value of `next_page_token` from the + * previous response. The values of all other method parameters must be + * identical to those in the previous call. + * @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 [IamPolicySearchResult]{@link google.cloud.asset.v1p1beta1.IamPolicySearchResult} on 'data' event. + */ + searchIamPoliciesStream( + request?: protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest, + options?: gax.CallOptions | {} + ): Transform { + request = request || {}; + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.searchIamPolicies.createStream( + this._innerApiCalls.searchIamPolicies as gax.GaxCall, + request, + callSettings + ); + } + searchAllResources( + request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse + ] + >; + searchAllResources( + request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse + > + ): void; + /** + * Searches all the resources under a given accessible CRM scope + * (project/folder/organization). This RPC gives callers + * especially admins the ability to search all the resources under a scope, + * even if they don't have .get permission of all the resources. Callers + * should have cloud.assets.SearchAllResources permission on the requested + * scope, otherwise it will be rejected. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.scope + * Required. The relative name of an asset. The search is limited to the resources + * within the `scope`. The allowed value must be: + * * Organization number (such as "organizations/123") + * * Folder number(such as "folders/1234") + * * Project number (such as "projects/12345") + * @param {string} [request.query] + * Optional. The query statement. + * @param {string[]} [request.assetTypes] + * Optional. A list of asset types that this request searches for. If empty, it will + * search all the supported asset types. + * @param {number} [request.pageSize] + * Optional. The page size for search result pagination. Returned results may be fewer + * than requested. The value of this field is capped at 2000. If set to the + * zero value, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. If present, then retrieve the next batch of results from the preceding call + * to this method. `page_token` must be the value of `next_page_token` from + * the previous response. The values of all other method parameters, must be + * identical to those in the previous call. + * @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 [StandardResourceMetadata]{@link google.cloud.asset.v1p1beta1.StandardResourceMetadata}. + * The client library support 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. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [StandardResourceMetadata]{@link google.cloud.asset.v1p1beta1.StandardResourceMetadata} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [SearchAllResourcesRequest]{@link google.cloud.asset.v1p1beta1.SearchAllResourcesRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [SearchAllResourcesResponse]{@link google.cloud.asset.v1p1beta1.SearchAllResourcesResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + searchAllResources( + request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse + >, + callback?: Callback< + protosTypes.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse + > + ): Promise< + [ + protosTypes.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + scope: request.scope || '', + }); + return this._innerApiCalls.searchAllResources(request, options, callback); + } + + /** + * Equivalent to {@link searchAllResources}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link searchAllResources} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.scope + * Required. The relative name of an asset. The search is limited to the resources + * within the `scope`. The allowed value must be: + * * Organization number (such as "organizations/123") + * * Folder number(such as "folders/1234") + * * Project number (such as "projects/12345") + * @param {string} [request.query] + * Optional. The query statement. + * @param {string[]} [request.assetTypes] + * Optional. A list of asset types that this request searches for. If empty, it will + * search all the supported asset types. + * @param {number} [request.pageSize] + * Optional. The page size for search result pagination. Returned results may be fewer + * than requested. The value of this field is capped at 2000. If set to the + * zero value, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. If present, then retrieve the next batch of results from the preceding call + * to this method. `page_token` must be the value of `next_page_token` from + * the previous response. The values of all other method parameters, must be + * identical to those in the previous call. + * @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 [StandardResourceMetadata]{@link google.cloud.asset.v1p1beta1.StandardResourceMetadata} on 'data' event. + */ + searchAllResourcesStream( + request?: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, + options?: gax.CallOptions | {} + ): Transform { + request = request || {}; + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.searchAllResources.createStream( + this._innerApiCalls.searchAllResources as gax.GaxCall, + request, + callSettings + ); + } + searchAllIamPolicies( + request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse + ] + >; + searchAllIamPolicies( + request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse + > + ): void; + /** + * Searches all the IAM policies under a given accessible CRM scope + * (project/folder/organization). This RPC gives callers + * especially admins the ability to search all the IAM policies under a scope, + * even if they don't have .getIamPolicy permission of all the IAM policies. + * Callers should have cloud.assets.SearchAllIamPolicies permission on the + * requested scope, otherwise it will be rejected. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.scope + * Required. The relative name of an asset. The search is limited to the resources + * within the `scope`. The allowed value must be: + * * Organization number (such as "organizations/123") + * * Folder number(such as "folders/1234") + * * Project number (such as "projects/12345") + * @param {string} [request.query] + * Optional. The query statement. + * Examples: + * * "policy:myuser@mydomain.com" + * * "policy:(myuser@mydomain.com viewer)" + * @param {number} [request.pageSize] + * Optional. The page size for search result pagination. Returned results may be fewer + * than requested. The maximum is 2000. If set to the zero value, the server + * will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. If present, retrieve the next batch of results from the preceding call to + * this method. `page_token` must be the value of `next_page_token` from the + * previous response. The values of all other method parameters must be + * identical to those in the previous call. + * @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 [IamPolicySearchResult]{@link google.cloud.asset.v1p1beta1.IamPolicySearchResult}. + * The client library support 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. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [IamPolicySearchResult]{@link google.cloud.asset.v1p1beta1.IamPolicySearchResult} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [SearchAllIamPoliciesRequest]{@link google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [SearchAllIamPoliciesResponse]{@link google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + searchAllIamPolicies( + request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse + >, + callback?: Callback< + protosTypes.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse + > + ): Promise< + [ + protosTypes.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest | null, + protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + scope: request.scope || '', + }); + return this._innerApiCalls.searchAllIamPolicies(request, options, callback); + } + + /** + * Equivalent to {@link searchAllIamPolicies}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link searchAllIamPolicies} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.scope + * Required. The relative name of an asset. The search is limited to the resources + * within the `scope`. The allowed value must be: + * * Organization number (such as "organizations/123") + * * Folder number(such as "folders/1234") + * * Project number (such as "projects/12345") + * @param {string} [request.query] + * Optional. The query statement. + * Examples: + * * "policy:myuser@mydomain.com" + * * "policy:(myuser@mydomain.com viewer)" + * @param {number} [request.pageSize] + * Optional. The page size for search result pagination. Returned results may be fewer + * than requested. The maximum is 2000. If set to the zero value, the server + * will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. If present, retrieve the next batch of results from the preceding call to + * this method. `page_token` must be the value of `next_page_token` from the + * previous response. The values of all other method parameters must be + * identical to those in the previous call. + * @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 [IamPolicySearchResult]{@link google.cloud.asset.v1p1beta1.IamPolicySearchResult} on 'data' event. + */ + searchAllIamPoliciesStream( + request?: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, + options?: gax.CallOptions | {} + ): Transform { + request = request || {}; + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.searchAllIamPolicies.createStream( + this._innerApiCalls.searchAllIamPolicies as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Terminate the GRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + */ + close(): Promise { + if (!this._terminated) { + return this.assetServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client_config.json b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client_config.json new file mode 100644 index 00000000000..d033cf28f2b --- /dev/null +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client_config.json @@ -0,0 +1,46 @@ +{ + "interfaces": { + "google.cloud.asset.v1p1beta1.AssetService": { + "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": { + "SearchResources": { + "timeout_millis": 15000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "SearchIamPolicies": { + "timeout_millis": 15000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "SearchAllResources": { + "timeout_millis": 15000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "SearchAllIamPolicies": { + "timeout_millis": 15000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_proto_list.json b/packages/google-cloud-asset/src/v1p1beta1/asset_service_proto_list.json new file mode 100644 index 00000000000..31c1cf27e9d --- /dev/null +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/cloud/asset/v1p1beta1/assets.proto", + "../../protos/google/cloud/asset/v1p1beta1/asset_service.proto" +] diff --git a/packages/google-cloud-asset/src/v1/index.js b/packages/google-cloud-asset/src/v1p1beta1/index.ts similarity index 66% rename from packages/google-cloud-asset/src/v1/index.js rename to packages/google-cloud-asset/src/v1p1beta1/index.ts index 501c92ee4cf..6890c43379a 100644 --- a/packages/google-cloud-asset/src/v1/index.js +++ b/packages/google-cloud-asset/src/v1p1beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,9 +11,9 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** -'use strict'; - -const AssetServiceClient = require('./asset_service_client'); - -module.exports.AssetServiceClient = AssetServiceClient; +export {AssetServiceClient} from './asset_service_client'; diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.js b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.js deleted file mode 100644 index e04ab89f44f..00000000000 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.js +++ /dev/null @@ -1,841 +0,0 @@ -// Copyright 2020 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. - -'use strict'; - -const gapicConfig = require('./asset_service_client_config.json'); -const gax = require('google-gax'); -const path = require('path'); - -const VERSION = require('../../package.json').version; - -/** - * Asset service definition. - * - * @class - * @memberof v1p2beta1 - */ -class AssetServiceClient { - /** - * Construct an instance of AssetServiceClient. - * - * @param {object} [options] - The configuration object. See the subsequent - * parameters for more details. - * @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 {function} [options.promise] - Custom promise module to use instead - * of native Promises. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - */ - constructor(opts) { - opts = opts || {}; - this._descriptors = {}; - - if (global.isBrowser) { - // If we're in browser, we use gRPC fallback. - opts.fallback = true; - } - - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; - - const servicePath = - opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; - - // Ensure that options include the service address and port. - opts = Object.assign( - { - clientConfig: {}, - port: this.constructor.port, - servicePath, - }, - opts - ); - - // Create a `gaxGrpc` object, with any grpc-specific options - // sent to the client. - opts.scopes = this.constructor.scopes; - const gaxGrpc = new gaxModule.GrpcClient(opts); - - // Save the auth object to the client, for use by other methods. - this.auth = gaxGrpc.auth; - - // Determine the client header string. - const clientHeader = []; - - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } - clientHeader.push(`gax/${gaxModule.version}`); - if (opts.fallback) { - clientHeader.push(`gl-web/${gaxModule.version}`); - } else { - clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); - } - clientHeader.push(`gapic/${VERSION}`); - 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' - ); - const protos = gaxGrpc.loadProto( - opts.fallback ? 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 = { - feedPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/feeds/{feed}' - ), - }; - - const protoFilesRoot = opts.fallback - ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) - : gaxModule.protobuf.loadSync(nodejsProtoPath); - - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - this.operationsClient = new gaxModule.lro({ - auth: gaxGrpc.auth, - grpc: gaxGrpc.grpc, - }).operationsClient(opts); - - const exportAssetsResponse = protoFilesRoot.lookup( - 'google.cloud.asset.v1p2beta1.ExportAssetsResponse' - ); - const exportAssetsMetadata = protoFilesRoot.lookup( - 'google.cloud.asset.v1p2beta1.ExportAssetsRequest' - ); - - this._descriptors.longrunning = { - exportAssets: new gaxModule.LongrunningDescriptor( - this.operationsClient, - exportAssetsResponse.decode.bind(exportAssetsResponse), - exportAssetsMetadata.decode.bind(exportAssetsMetadata) - ), - }; - - // Put together the default options sent with requests. - const defaults = gaxGrpc.constructSettings( - 'google.cloud.asset.v1p2beta1.AssetService', - gapicConfig, - 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 = {}; - - // Put together the "service stub" for - // google.cloud.asset.v1p2beta1.AssetService. - const assetServiceStub = gaxGrpc.createStub( - opts.fallback - ? protos.lookupService('google.cloud.asset.v1p2beta1.AssetService') - : protos.google.cloud.asset.v1p2beta1.AssetService, - opts - ); - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const assetServiceStubMethods = [ - 'exportAssets', - 'batchGetAssetsHistory', - 'createFeed', - 'getFeed', - 'listFeeds', - 'updateFeed', - 'deleteFeed', - ]; - for (const methodName of assetServiceStubMethods) { - const innerCallPromise = assetServiceStub.then( - stub => (...args) => { - return stub[methodName].apply(stub, args); - }, - err => () => { - throw err; - } - ); - this._innerApiCalls[methodName] = gaxModule.createApiCall( - innerCallPromise, - defaults[methodName], - this._descriptors.longrunning[methodName] - ); - } - } - - /** - * The DNS address for this API service. - */ - static get servicePath() { - return 'cloudasset.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - */ - static get apiEndpoint() { - return 'cloudasset.googleapis.com'; - } - - /** - * The port for this API service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - */ - static get scopes() { - return ['https://www.googleapis.com/auth/cloud-platform']; - } - - /** - * Return the project ID used by this class. - * @param {function(Error, string)} callback - the callback to - * be called with the current project Id. - */ - getProjectId(callback) { - return this.auth.getProjectId(callback); - } - - // ------------------- - // -- Service calls -- - // ------------------- - - /** - * Exports assets with time and resource types to a given Cloud Storage - * location. The output format is newline-delimited JSON. - * This API implements the google.longrunning.Operation API allowing you - * to keep track of the export. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The relative name of the root asset. This can only be an - * organization number (such as "organizations/123"), a project ID (such as - * "projects/my-project-id"), or a project number (such as "projects/12345"). - * @param {Object} request.outputConfig - * Required. Output configuration indicating where the results will be output - * to. All results will be in newline delimited JSON format. - * - * This object should have the same structure as [OutputConfig]{@link google.cloud.asset.v1p2beta1.OutputConfig} - * @param {Object} [request.readTime] - * Timestamp to take an asset snapshot. This can only be set to a timestamp - * between 2018-10-02 UTC (inclusive) and the current time. If not specified, - * the current time will be used. Due to delays in resource data collection - * and indexing, there is a volatile window during which running the same - * query may get different results. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * @param {string[]} [request.assetTypes] - * A list of asset types of which to take a snapshot for. For example: - * "compute.googleapis.com/Disk". If specified, only matching assets will be - * returned. See [Introduction to Cloud Asset - * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) - * for all supported asset types. - * @param {number} [request.contentType] - * Asset content type. If not specified, no content but the asset name will be - * returned. - * - * The number should be among the values of [ContentType]{@link google.cloud.asset.v1p2beta1.ContentType} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const asset = require('asset.v1p2beta1'); - * - * const client = new asset.v1p2beta1.AssetServiceClient({ - * // optional auth parameters. - * }); - * - * const parent = ''; - * const outputConfig = {}; - * const request = { - * parent: parent, - * outputConfig: outputConfig, - * }; - * - * // Handle the operation using the promise pattern. - * client.exportAssets(request) - * .then(responses => { - * const [operation, initialApiResponse] = responses; - * - * // Operation#promise starts polling for the completion of the LRO. - * return operation.promise(); - * }) - * .then(responses => { - * const result = responses[0]; - * const metadata = responses[1]; - * const finalApiResponse = responses[2]; - * }) - * .catch(err => { - * console.error(err); - * }); - * - * const parent = ''; - * const outputConfig = {}; - * const request = { - * parent: parent, - * outputConfig: outputConfig, - * }; - * - * // Handle the operation using the event emitter pattern. - * client.exportAssets(request) - * .then(responses => { - * const [operation, initialApiResponse] = responses; - * - * // Adding a listener for the "complete" event starts polling for the - * // completion of the operation. - * operation.on('complete', (result, metadata, finalApiResponse) => { - * // doSomethingWith(result); - * }); - * - * // Adding a listener for the "progress" event causes the callback to be - * // called on any change in metadata when the operation is polled. - * operation.on('progress', (metadata, apiResponse) => { - * // doSomethingWith(metadata) - * }); - * - * // Adding a listener for the "error" event handles any errors found during polling. - * operation.on('error', err => { - * // throw(err); - * }); - * }) - * .catch(err => { - * console.error(err); - * }); - * - * const parent = ''; - * const outputConfig = {}; - * const request = { - * parent: parent, - * outputConfig: outputConfig, - * }; - * - * // Handle the operation using the await pattern. - * const [operation] = await client.exportAssets(request); - * - * const [response] = await operation.promise(); - */ - exportAssets(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - 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, - }); - - return this._innerApiCalls.exportAssets(request, options, callback); - } - - /** - * Batch gets the update history of assets that overlap a time window. - * For RESOURCE content, this API outputs history with asset in both - * non-delete or deleted status. - * For IAM_POLICY content, this API outputs history when the asset and its - * attached IAM POLICY both exist. This can create gaps in the output history. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The relative name of the root asset. It can only be an - * organization number (such as "organizations/123"), a project ID (such as - * "projects/my-project-id")", or a project number (such as "projects/12345"). - * @param {string[]} request.assetNames - * A list of the full names of the assets. For example: - * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. - * See [Resource - * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) - * and [Resource Name - * Format](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/resource-name-format) - * for more info. - * - * The request becomes a no-op if the asset name list is empty, and the max - * size of the asset name list is 100 in one request. - * @param {number} request.contentType - * Required. The content type. - * - * The number should be among the values of [ContentType]{@link google.cloud.asset.v1p2beta1.ContentType} - * @param {Object} [request.readTimeWindow] - * Optional. The time window for the asset history. Both start_time and - * end_time are optional and if set, it must be after 2018-10-02 UTC. If - * end_time is not set, it is default to current timestamp. If start_time is - * not set, the snapshot of the assets at end_time will be returned. The - * returned results contain all temporal assets whose time window overlap with - * read_time_window. - * - * This object should have the same structure as [TimeWindow]{@link google.cloud.asset.v1p2beta1.TimeWindow} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [BatchGetAssetsHistoryResponse]{@link google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [BatchGetAssetsHistoryResponse]{@link google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const asset = require('asset.v1p2beta1'); - * - * const client = new asset.v1p2beta1.AssetServiceClient({ - * // optional auth parameters. - * }); - * - * const parent = ''; - * const assetNames = []; - * const contentType = 'CONTENT_TYPE_UNSPECIFIED'; - * const request = { - * parent: parent, - * assetNames: assetNames, - * contentType: contentType, - * }; - * client.batchGetAssetsHistory(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - batchGetAssetsHistory(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - 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, - }); - - return this._innerApiCalls.batchGetAssetsHistory( - request, - options, - callback - ); - } - - /** - * Creates a feed in a parent project/folder/organization to listen to its - * asset updates. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the project/folder/organization where this feed - * should be created in. It can only be an organization number (such as - * "organizations/123"), a folder number (such as "folders/123"), a project ID - * (such as "projects/my-project-id")", or a project number (such as - * "projects/12345"). - * @param {string} request.feedId - * Required. This is the client-assigned asset feed identifier and it needs to - * be unique under a specific parent project/folder/organization. - * @param {Object} request.feed - * The feed details. The field `name` must be empty and it will be generated - * in the format of: - * projects/project_number/feeds/feed_id - * folders/folder_number/feeds/feed_id - * organizations/organization_number/feeds/feed_id - * - * This object should have the same structure as [Feed]{@link google.cloud.asset.v1p2beta1.Feed} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Feed]{@link google.cloud.asset.v1p2beta1.Feed}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Feed]{@link google.cloud.asset.v1p2beta1.Feed}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const asset = require('asset.v1p2beta1'); - * - * const client = new asset.v1p2beta1.AssetServiceClient({ - * // optional auth parameters. - * }); - * - * const parent = ''; - * const feedId = ''; - * const feed = {}; - * const request = { - * parent: parent, - * feedId: feedId, - * feed: feed, - * }; - * client.createFeed(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - createFeed(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - 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, - }); - - return this._innerApiCalls.createFeed(request, options, callback); - } - - /** - * Gets details about an asset feed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The name of the Feed and it must be in the format of: - * projects/project_number/feeds/feed_id - * folders/folder_number/feeds/feed_id - * organizations/organization_number/feeds/feed_id - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Feed]{@link google.cloud.asset.v1p2beta1.Feed}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Feed]{@link google.cloud.asset.v1p2beta1.Feed}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const asset = require('asset.v1p2beta1'); - * - * const client = new asset.v1p2beta1.AssetServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.feedPath('[PROJECT]', '[FEED]'); - * client.getFeed({name: formattedName}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - getFeed(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - 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, - }); - - return this._innerApiCalls.getFeed(request, options, callback); - } - - /** - * Lists all asset feeds in a parent project/folder/organization. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent project/folder/organization whose feeds are to be - * listed. It can only be using project/folder/organization number (such as - * "folders/12345")", or a project ID (such as "projects/my-project-id"). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [ListFeedsResponse]{@link google.cloud.asset.v1p2beta1.ListFeedsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ListFeedsResponse]{@link google.cloud.asset.v1p2beta1.ListFeedsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const asset = require('asset.v1p2beta1'); - * - * const client = new asset.v1p2beta1.AssetServiceClient({ - * // optional auth parameters. - * }); - * - * const parent = ''; - * client.listFeeds({parent: parent}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - listFeeds(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - 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, - }); - - return this._innerApiCalls.listFeeds(request, options, callback); - } - - /** - * Updates an asset feed configuration. - * - * @param {Object} request - * The request object that will be sent. - * @param {Object} request.feed - * The new values of feed details. It must match an existing feed and the - * field `name` must be in the format of: - * projects/project_number/feeds/feed_id or - * folders/folder_number/feeds/feed_id or - * organizations/organization_number/feeds/feed_id. - * - * This object should have the same structure as [Feed]{@link google.cloud.asset.v1p2beta1.Feed} - * @param {Object} request.updateMask - * Only updates the `feed` fields indicated by this mask. - * The field mask must not be empty, and it must not contain fields that - * are immutable or only set by the server. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Feed]{@link google.cloud.asset.v1p2beta1.Feed}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Feed]{@link google.cloud.asset.v1p2beta1.Feed}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const asset = require('asset.v1p2beta1'); - * - * const client = new asset.v1p2beta1.AssetServiceClient({ - * // optional auth parameters. - * }); - * - * const feed = {}; - * const updateMask = {}; - * const request = { - * feed: feed, - * updateMask: updateMask, - * }; - * client.updateFeed(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - updateFeed(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'feed.name': request.feed.name, - }); - - return this._innerApiCalls.updateFeed(request, options, callback); - } - - /** - * Deletes an asset feed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The name of the feed and it must be in the format of: - * projects/project_number/feeds/feed_id - * folders/folder_number/feeds/feed_id - * organizations/organization_number/feeds/feed_id - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error)} [callback] - * The function which will be called with the result of the API call. - * @returns {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const asset = require('asset.v1p2beta1'); - * - * const client = new asset.v1p2beta1.AssetServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.feedPath('[PROJECT]', '[FEED]'); - * client.deleteFeed({name: formattedName}).catch(err => { - * console.error(err); - * }); - */ - deleteFeed(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - 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, - }); - - return this._innerApiCalls.deleteFeed(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified feed resource name string. - * - * @param {String} project - * @param {String} feed - * @returns {String} - */ - feedPath(project, feed) { - return this._pathTemplates.feedPathTemplate.render({ - project: project, - feed: feed, - }); - } - - /** - * Parse the feedName from a feed resource. - * - * @param {String} feedName - * A fully-qualified path representing a feed resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromFeedName(feedName) { - return this._pathTemplates.feedPathTemplate.match(feedName).project; - } - - /** - * Parse the feedName from a feed resource. - * - * @param {String} feedName - * A fully-qualified path representing a feed resources. - * @returns {String} - A string representing the feed. - */ - matchFeedFromFeedName(feedName) { - return this._pathTemplates.feedPathTemplate.match(feedName).feed; - } -} - -module.exports = AssetServiceClient; diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts new file mode 100644 index 00000000000..b57241e9943 --- /dev/null +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts @@ -0,0 +1,793 @@ +// Copyright 2019 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 gax from 'google-gax'; +import { + APICallback, + Callback, + CallOptions, + Descriptors, + ClientOptions, +} from 'google-gax'; +import * as path from 'path'; + +import * as protosTypes from '../../protos/protos'; +import * as gapicConfig from './asset_service_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Asset service definition. + * @class + * @memberof v1p2beta1 + */ +export class AssetServiceClient { + private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _innerApiCalls: {[name: string]: Function}; + private _pathTemplates: {[name: string]: gax.PathTemplate}; + private _terminated = false; + auth: gax.GoogleAuth; + assetServiceStub: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AssetServiceClient. + * + * @param {object} [options] - The configuration object. See the subsequent + * parameters for more details. + * @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 {function} [options.promise] - Custom promise module to use instead + * of native Promises. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + */ + + constructor(opts?: ClientOptions) { + // Ensure that options include the service address and port. + const staticMembers = this.constructor as typeof AssetServiceClient; + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; + const port = opts && opts.port ? opts.port : staticMembers.port; + + if (!opts) { + opts = {servicePath, port}; + } + opts.servicePath = opts.servicePath || servicePath; + opts.port = opts.port || port; + opts.clientConfig = opts.clientConfig || {}; + + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { + opts.fallback = true; + } + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = (this.constructor as typeof AssetServiceClient).scopes; + const gaxGrpc = new gaxModule.GrpcClient(opts); + + // Save the auth object to the client, for use by other methods. + this.auth = gaxGrpc.auth as gax.GoogleAuth; + + // Determine the client header string. + const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${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' + ); + const protos = gaxGrpc.loadProto( + opts.fallback ? 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 = { + projectFeedPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/feeds/{feed}' + ), + folderFeedPathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/feeds/{feed}' + ), + organizationFeedPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/feeds/{feed}' + ), + }; + + // Put together the default options sent with requests. + const defaults = gaxGrpc.constructSettings( + 'google.cloud.asset.v1p2beta1.AssetService', + 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 = {}; + + // Put together the "service stub" for + // google.cloud.asset.v1p2beta1.AssetService. + this.assetServiceStub = gaxGrpc.createStub( + opts.fallback + ? (protos as protobuf.Root).lookupService( + 'google.cloud.asset.v1p2beta1.AssetService' + ) + : // tslint:disable-next-line no-any + (protos as any).google.cloud.asset.v1p2beta1.AssetService, + 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 assetServiceStubMethods = [ + 'createFeed', + 'getFeed', + 'listFeeds', + 'updateFeed', + 'deleteFeed', + ]; + + for (const methodName of assetServiceStubMethods) { + const innerCallPromise = this.assetServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + return stub[methodName].apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const apiCall = gaxModule.createApiCall( + innerCallPromise, + defaults[methodName], + this._descriptors.page[methodName] || + this._descriptors.stream[methodName] || + this._descriptors.longrunning[methodName] + ); + + this._innerApiCalls[methodName] = ( + argument: {}, + callOptions?: CallOptions, + callback?: APICallback + ) => { + return apiCall(argument, callOptions, callback); + }; + } + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'cloudasset.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'cloudasset.googleapis.com'; + } + + /** + * The port for this API service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + */ + 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. + * @param {function(Error, string)} callback - the callback to + * be called with the current project Id. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + createFeed( + request: protosTypes.google.cloud.asset.v1p2beta1.ICreateFeedRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.asset.v1p2beta1.IFeed, + protosTypes.google.cloud.asset.v1p2beta1.ICreateFeedRequest | undefined, + {} | undefined + ] + >; + createFeed( + request: protosTypes.google.cloud.asset.v1p2beta1.ICreateFeedRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.asset.v1p2beta1.IFeed, + protosTypes.google.cloud.asset.v1p2beta1.ICreateFeedRequest | undefined, + {} | undefined + > + ): void; + /** + * Creates a feed in a parent project/folder/organization to listen to its + * asset updates. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project/folder/organization where this feed + * should be created in. It can only be an organization number (such as + * "organizations/123"), a folder number (such as "folders/123"), a project ID + * (such as "projects/my-project-id")", or a project number (such as + * "projects/12345"). + * @param {string} request.feedId + * Required. This is the client-assigned asset feed identifier and it needs to + * be unique under a specific parent project/folder/organization. + * @param {google.cloud.asset.v1p2beta1.Feed} request.feed + * Required. The feed details. The field `name` must be empty and it will be generated + * in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_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. + * The first element of the array is an object representing [Feed]{@link google.cloud.asset.v1p2beta1.Feed}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createFeed( + request: protosTypes.google.cloud.asset.v1p2beta1.ICreateFeedRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.asset.v1p2beta1.IFeed, + | protosTypes.google.cloud.asset.v1p2beta1.ICreateFeedRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.asset.v1p2beta1.IFeed, + protosTypes.google.cloud.asset.v1p2beta1.ICreateFeedRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.asset.v1p2beta1.IFeed, + protosTypes.google.cloud.asset.v1p2beta1.ICreateFeedRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 || '', + }); + return this._innerApiCalls.createFeed(request, options, callback); + } + getFeed( + request: protosTypes.google.cloud.asset.v1p2beta1.IGetFeedRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.asset.v1p2beta1.IFeed, + protosTypes.google.cloud.asset.v1p2beta1.IGetFeedRequest | undefined, + {} | undefined + ] + >; + getFeed( + request: protosTypes.google.cloud.asset.v1p2beta1.IGetFeedRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.asset.v1p2beta1.IFeed, + protosTypes.google.cloud.asset.v1p2beta1.IGetFeedRequest | undefined, + {} | undefined + > + ): void; + /** + * Gets details about an asset feed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_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. + * The first element of the array is an object representing [Feed]{@link google.cloud.asset.v1p2beta1.Feed}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getFeed( + request: protosTypes.google.cloud.asset.v1p2beta1.IGetFeedRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.asset.v1p2beta1.IFeed, + protosTypes.google.cloud.asset.v1p2beta1.IGetFeedRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.asset.v1p2beta1.IFeed, + protosTypes.google.cloud.asset.v1p2beta1.IGetFeedRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.asset.v1p2beta1.IFeed, + protosTypes.google.cloud.asset.v1p2beta1.IGetFeedRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 || '', + }); + return this._innerApiCalls.getFeed(request, options, callback); + } + listFeeds( + request: protosTypes.google.cloud.asset.v1p2beta1.IListFeedsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.asset.v1p2beta1.IListFeedsResponse, + protosTypes.google.cloud.asset.v1p2beta1.IListFeedsRequest | undefined, + {} | undefined + ] + >; + listFeeds( + request: protosTypes.google.cloud.asset.v1p2beta1.IListFeedsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.asset.v1p2beta1.IListFeedsResponse, + protosTypes.google.cloud.asset.v1p2beta1.IListFeedsRequest | undefined, + {} | undefined + > + ): void; + /** + * Lists all asset feeds in a parent project/folder/organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent project/folder/organization whose feeds are to be + * listed. It can only be using project/folder/organization number (such as + * "folders/12345")", or a project ID (such as "projects/my-project-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. + * The first element of the array is an object representing [ListFeedsResponse]{@link google.cloud.asset.v1p2beta1.ListFeedsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listFeeds( + request: protosTypes.google.cloud.asset.v1p2beta1.IListFeedsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.asset.v1p2beta1.IListFeedsResponse, + | protosTypes.google.cloud.asset.v1p2beta1.IListFeedsRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.asset.v1p2beta1.IListFeedsResponse, + protosTypes.google.cloud.asset.v1p2beta1.IListFeedsRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.asset.v1p2beta1.IListFeedsResponse, + protosTypes.google.cloud.asset.v1p2beta1.IListFeedsRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 || '', + }); + return this._innerApiCalls.listFeeds(request, options, callback); + } + updateFeed( + request: protosTypes.google.cloud.asset.v1p2beta1.IUpdateFeedRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.asset.v1p2beta1.IFeed, + protosTypes.google.cloud.asset.v1p2beta1.IUpdateFeedRequest | undefined, + {} | undefined + ] + >; + updateFeed( + request: protosTypes.google.cloud.asset.v1p2beta1.IUpdateFeedRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.asset.v1p2beta1.IFeed, + protosTypes.google.cloud.asset.v1p2beta1.IUpdateFeedRequest | undefined, + {} | undefined + > + ): void; + /** + * Updates an asset feed configuration. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.asset.v1p2beta1.Feed} request.feed + * Required. The new values of feed details. It must match an existing feed and the + * field `name` must be in the format of: + * projects/project_number/feeds/feed_id or + * folders/folder_number/feeds/feed_id or + * organizations/organization_number/feeds/feed_id. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Only updates the `feed` fields indicated by this mask. + * The field mask must not be empty, and it must not contain fields that + * are immutable or only set by the server. + * @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 [Feed]{@link google.cloud.asset.v1p2beta1.Feed}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateFeed( + request: protosTypes.google.cloud.asset.v1p2beta1.IUpdateFeedRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.asset.v1p2beta1.IFeed, + | protosTypes.google.cloud.asset.v1p2beta1.IUpdateFeedRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.asset.v1p2beta1.IFeed, + protosTypes.google.cloud.asset.v1p2beta1.IUpdateFeedRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.asset.v1p2beta1.IFeed, + protosTypes.google.cloud.asset.v1p2beta1.IUpdateFeedRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'feed.name': request.feed!.name || '', + }); + return this._innerApiCalls.updateFeed(request, options, callback); + } + deleteFeed( + request: protosTypes.google.cloud.asset.v1p2beta1.IDeleteFeedRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + protosTypes.google.cloud.asset.v1p2beta1.IDeleteFeedRequest | undefined, + {} | undefined + ] + >; + deleteFeed( + request: protosTypes.google.cloud.asset.v1p2beta1.IDeleteFeedRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.cloud.asset.v1p2beta1.IDeleteFeedRequest | undefined, + {} | undefined + > + ): void; + /** + * Deletes an asset feed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_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. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + deleteFeed( + request: protosTypes.google.cloud.asset.v1p2beta1.IDeleteFeedRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.cloud.asset.v1p2beta1.IDeleteFeedRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.cloud.asset.v1p2beta1.IDeleteFeedRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + protosTypes.google.cloud.asset.v1p2beta1.IDeleteFeedRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.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 || '', + }); + return this._innerApiCalls.deleteFeed(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified projectFeed resource name string. + * + * @param {string} project + * @param {string} feed + * @returns {string} Resource name string. + */ + projectFeedPath(project: string, feed: string) { + return this._pathTemplates.projectFeedPathTemplate.render({ + project, + feed, + }); + } + + /** + * Parse the project from ProjectFeed resource. + * + * @param {string} projectFeedName + * A fully-qualified path representing project_feed resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectFeedName(projectFeedName: string) { + return this._pathTemplates.projectFeedPathTemplate.match(projectFeedName) + .project; + } + + /** + * Parse the feed from ProjectFeed resource. + * + * @param {string} projectFeedName + * A fully-qualified path representing project_feed resource. + * @returns {string} A string representing the feed. + */ + matchFeedFromProjectFeedName(projectFeedName: string) { + return this._pathTemplates.projectFeedPathTemplate.match(projectFeedName) + .feed; + } + + /** + * Return a fully-qualified folderFeed resource name string. + * + * @param {string} folder + * @param {string} feed + * @returns {string} Resource name string. + */ + folderFeedPath(folder: string, feed: string) { + return this._pathTemplates.folderFeedPathTemplate.render({ + folder, + feed, + }); + } + + /** + * Parse the folder from FolderFeed resource. + * + * @param {string} folderFeedName + * A fully-qualified path representing folder_feed resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderFeedName(folderFeedName: string) { + return this._pathTemplates.folderFeedPathTemplate.match(folderFeedName) + .folder; + } + + /** + * Parse the feed from FolderFeed resource. + * + * @param {string} folderFeedName + * A fully-qualified path representing folder_feed resource. + * @returns {string} A string representing the feed. + */ + matchFeedFromFolderFeedName(folderFeedName: string) { + return this._pathTemplates.folderFeedPathTemplate.match(folderFeedName) + .feed; + } + + /** + * Return a fully-qualified organizationFeed resource name string. + * + * @param {string} organization + * @param {string} feed + * @returns {string} Resource name string. + */ + organizationFeedPath(organization: string, feed: string) { + return this._pathTemplates.organizationFeedPathTemplate.render({ + organization, + feed, + }); + } + + /** + * Parse the organization from OrganizationFeed resource. + * + * @param {string} organizationFeedName + * A fully-qualified path representing organization_feed resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationFeedName(organizationFeedName: string) { + return this._pathTemplates.organizationFeedPathTemplate.match( + organizationFeedName + ).organization; + } + + /** + * Parse the feed from OrganizationFeed resource. + * + * @param {string} organizationFeedName + * A fully-qualified path representing organization_feed resource. + * @returns {string} A string representing the feed. + */ + matchFeedFromOrganizationFeedName(organizationFeedName: string) { + return this._pathTemplates.organizationFeedPathTemplate.match( + organizationFeedName + ).feed; + } + + /** + * Terminate the GRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + */ + close(): Promise { + if (!this._terminated) { + return this.assetServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client_config.json b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client_config.json index 11133174190..aa7547b8a79 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client_config.json +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client_config.json @@ -2,56 +2,46 @@ "interfaces": { "google.cloud.asset.v1p2beta1.AssetService": { "retry_codes": { + "non_idempotent": [], "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" - ], - "non_idempotent": [] + ] }, "retry_params": { "default": { "initial_retry_delay_millis": 100, "retry_delay_multiplier": 1.3, "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, "total_timeout_millis": 600000 } }, "methods": { - "ExportAssets": { - "timeout_millis": 600000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "BatchGetAssetsHistory": { - "timeout_millis": 600000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, "CreateFeed": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "GetFeed": { - "timeout_millis": 10000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "ListFeeds": { - "timeout_millis": 10000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "UpdateFeed": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "DeleteFeed": { - "timeout_millis": 30000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" } diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_proto_list.json b/packages/google-cloud-asset/src/v1p2beta1/asset_service_proto_list.json index ac74955ea29..33e15d2df28 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_proto_list.json +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_proto_list.json @@ -1,3 +1,4 @@ [ + "../../protos/google/cloud/asset/v1p2beta1/assets.proto", "../../protos/google/cloud/asset/v1p2beta1/asset_service.proto" ] diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_asset_service.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_asset_service.js deleted file mode 100644 index 4dcaef87ca5..00000000000 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_asset_service.js +++ /dev/null @@ -1,469 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Export asset request. - * - * @property {string} parent - * Required. The relative name of the root asset. This can only be an - * organization number (such as "organizations/123"), a project ID (such as - * "projects/my-project-id"), or a project number (such as "projects/12345"). - * - * @property {Object} readTime - * Timestamp to take an asset snapshot. This can only be set to a timestamp - * between 2018-10-02 UTC (inclusive) and the current time. If not specified, - * the current time will be used. Due to delays in resource data collection - * and indexing, there is a volatile window during which running the same - * query may get different results. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {string[]} assetTypes - * A list of asset types of which to take a snapshot for. For example: - * "compute.googleapis.com/Disk". If specified, only matching assets will be - * returned. See [Introduction to Cloud Asset - * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) - * for all supported asset types. - * - * @property {number} contentType - * Asset content type. If not specified, no content but the asset name will be - * returned. - * - * The number should be among the values of [ContentType]{@link google.cloud.asset.v1p2beta1.ContentType} - * - * @property {Object} outputConfig - * Required. Output configuration indicating where the results will be output - * to. All results will be in newline delimited JSON format. - * - * This object should have the same structure as [OutputConfig]{@link google.cloud.asset.v1p2beta1.OutputConfig} - * - * @typedef ExportAssetsRequest - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.ExportAssetsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} - */ -const ExportAssetsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The export asset response. This message is returned by the - * google.longrunning.Operations.GetOperation method in the returned - * google.longrunning.Operation.response field. - * - * @property {Object} readTime - * Time the snapshot was taken. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} outputConfig - * Output configuration indicating where the results were output to. - * All results are in JSON format. - * - * This object should have the same structure as [OutputConfig]{@link google.cloud.asset.v1p2beta1.OutputConfig} - * - * @typedef ExportAssetsResponse - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.ExportAssetsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} - */ -const ExportAssetsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Batch get assets history request. - * - * @property {string} parent - * Required. The relative name of the root asset. It can only be an - * organization number (such as "organizations/123"), a project ID (such as - * "projects/my-project-id")", or a project number (such as "projects/12345"). - * - * @property {string[]} assetNames - * A list of the full names of the assets. For example: - * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. - * See [Resource - * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) - * and [Resource Name - * Format](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/resource-name-format) - * for more info. - * - * The request becomes a no-op if the asset name list is empty, and the max - * size of the asset name list is 100 in one request. - * - * @property {number} contentType - * Required. The content type. - * - * The number should be among the values of [ContentType]{@link google.cloud.asset.v1p2beta1.ContentType} - * - * @property {Object} readTimeWindow - * Optional. The time window for the asset history. Both start_time and - * end_time are optional and if set, it must be after 2018-10-02 UTC. If - * end_time is not set, it is default to current timestamp. If start_time is - * not set, the snapshot of the assets at end_time will be returned. The - * returned results contain all temporal assets whose time window overlap with - * read_time_window. - * - * This object should have the same structure as [TimeWindow]{@link google.cloud.asset.v1p2beta1.TimeWindow} - * - * @typedef BatchGetAssetsHistoryRequest - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} - */ -const BatchGetAssetsHistoryRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Batch get assets history response. - * - * @property {Object[]} assets - * A list of assets with valid time windows. - * - * This object should have the same structure as [TemporalAsset]{@link google.cloud.asset.v1p2beta1.TemporalAsset} - * - * @typedef BatchGetAssetsHistoryResponse - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} - */ -const BatchGetAssetsHistoryResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Create asset feed request. - * - * @property {string} parent - * Required. The name of the project/folder/organization where this feed - * should be created in. It can only be an organization number (such as - * "organizations/123"), a folder number (such as "folders/123"), a project ID - * (such as "projects/my-project-id")", or a project number (such as - * "projects/12345"). - * - * @property {string} feedId - * Required. This is the client-assigned asset feed identifier and it needs to - * be unique under a specific parent project/folder/organization. - * - * @property {Object} feed - * The feed details. The field `name` must be empty and it will be generated - * in the format of: - * projects/project_number/feeds/feed_id - * folders/folder_number/feeds/feed_id - * organizations/organization_number/feeds/feed_id - * - * This object should have the same structure as [Feed]{@link google.cloud.asset.v1p2beta1.Feed} - * - * @typedef CreateFeedRequest - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.CreateFeedRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} - */ -const CreateFeedRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Get asset feed request. - * - * @property {string} name - * The name of the Feed and it must be in the format of: - * projects/project_number/feeds/feed_id - * folders/folder_number/feeds/feed_id - * organizations/organization_number/feeds/feed_id - * - * @typedef GetFeedRequest - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.GetFeedRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} - */ -const GetFeedRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * List asset feeds request. - * - * @property {string} parent - * Required. The parent project/folder/organization whose feeds are to be - * listed. It can only be using project/folder/organization number (such as - * "folders/12345")", or a project ID (such as "projects/my-project-id"). - * - * @typedef ListFeedsRequest - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.ListFeedsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} - */ -const ListFeedsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * List asset feeds response. - * - * @property {Object[]} feeds - * A list of feeds. - * - * This object should have the same structure as [Feed]{@link google.cloud.asset.v1p2beta1.Feed} - * - * @typedef ListFeedsResponse - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.ListFeedsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} - */ -const ListFeedsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Update asset feed request. - * - * @property {Object} feed - * The new values of feed details. It must match an existing feed and the - * field `name` must be in the format of: - * projects/project_number/feeds/feed_id or - * folders/folder_number/feeds/feed_id or - * organizations/organization_number/feeds/feed_id. - * - * This object should have the same structure as [Feed]{@link google.cloud.asset.v1p2beta1.Feed} - * - * @property {Object} updateMask - * Only updates the `feed` fields indicated by this mask. - * The field mask must not be empty, and it must not contain fields that - * are immutable or only set by the server. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * - * @typedef UpdateFeedRequest - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.UpdateFeedRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} - */ -const UpdateFeedRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Delete asset feed request. - * - * @property {string} name - * The name of the feed and it must be in the format of: - * projects/project_number/feeds/feed_id - * folders/folder_number/feeds/feed_id - * organizations/organization_number/feeds/feed_id - * - * @typedef DeleteFeedRequest - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.DeleteFeedRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} - */ -const DeleteFeedRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Output configuration for export assets destination. - * - * @property {Object} gcsDestination - * Destination on Cloud Storage. - * - * This object should have the same structure as [GcsDestination]{@link google.cloud.asset.v1p2beta1.GcsDestination} - * - * @property {Object} bigqueryDestination - * Destination on Bigquery. The output table stores the fields in asset - * proto as columns in BigQuery. The resource/iam_policy field is converted - * to a record with each field to a column, except metadata to a single JSON - * string. - * - * This object should have the same structure as [BigQueryDestination]{@link google.cloud.asset.v1p2beta1.BigQueryDestination} - * - * @typedef OutputConfig - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.OutputConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} - */ -const OutputConfig = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A Cloud Storage location. - * - * @property {string} uri - * The uri of the Cloud Storage object. It's the same uri that is used by - * gsutil. For example: "gs://bucket_name/object_name". See [Viewing and - * Editing Object - * Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) - * for more information. - * - * @property {string} uriPrefix - * The uri prefix of all generated Cloud Storage objects. For example: - * "gs://bucket_name/object_name_prefix". Each object uri is in format: - * "gs://bucket_name/object_name_prefix// and only - * contains assets for that type. starts from 0. For example: - * "gs://bucket_name/object_name_prefix/compute.googleapis.com/Disk/0" is - * the first shard of output objects containing all - * compute.googleapis.com/Disk assets. An INVALID_ARGUMENT error will be - * returned if file with the same name "gs://bucket_name/object_name_prefix" - * already exists. - * - * @typedef GcsDestination - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.GcsDestination definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} - */ -const GcsDestination = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A Bigquery destination. - * - * @property {string} dataset - * Required. The BigQuery dataset in format - * "projects/projectId/datasets/datasetId", to which the snapshot result - * should be exported. If this dataset does not exist, the export call returns - * an error. - * - * @property {string} table - * Required. The BigQuery table to which the snapshot result should be - * written. If this table does not exist, a new table with the given name - * will be created. - * - * @property {boolean} force - * If the destination table already exists and this flag is `TRUE`, the - * table will be overwritten by the contents of assets snapshot. If the flag - * is not set and the destination table already exists, the export call - * returns an error. - * - * @typedef BigQueryDestination - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.BigQueryDestination definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} - */ -const BigQueryDestination = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A Cloud Pubsub destination. - * - * @property {string} topic - * The name of the Cloud Pub/Sub topic to publish to. - * For example: `projects/PROJECT_ID/topics/TOPIC_ID`. - * - * @typedef PubsubDestination - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.PubsubDestination definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} - */ -const PubsubDestination = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Output configuration for asset feed destination. - * - * @property {Object} pubsubDestination - * Destination on Cloud Pubsub. - * - * This object should have the same structure as [PubsubDestination]{@link google.cloud.asset.v1p2beta1.PubsubDestination} - * - * @typedef FeedOutputConfig - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.FeedOutputConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} - */ -const FeedOutputConfig = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * An asset feed used to export asset updates to a destinations. - * An asset feed filter controls what updates are exported. - * The asset feed must be created within a project, organization, or - * folder. Supported destinations are: - * Cloud Pub/Sub topics. - * - * @property {string} name - * Required. The format will be - * projects/{project_number}/feeds/{client-assigned_feed_identifier} or - * folders/{folder_number}/feeds/{client-assigned_feed_identifier} or - * organizations/{organization_number}/feeds/{client-assigned_feed_identifier} - * - * The client-assigned feed identifier must be unique within the parent - * project/folder/organization. - * - * @property {string[]} assetNames - * A list of the full names of the assets to receive updates. You must specify - * either or both of asset_names and asset_types. Only asset updates matching - * specified asset_names and asset_types are exported to the feed. For - * example: - * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. - * See [Resource - * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) - * for more info. - * - * @property {string[]} assetTypes - * A list of types of the assets to receive updates. You must specify either - * or both of asset_names and asset_types. Only asset updates matching - * specified asset_names and asset_types are exported to the feed. - * For example: - * "compute.googleapis.com/Disk" See [Introduction to Cloud Asset - * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) - * for all supported asset types. - * - * @property {number} contentType - * Asset content type. If not specified, no content but the asset name and - * type will be returned. - * - * The number should be among the values of [ContentType]{@link google.cloud.asset.v1p2beta1.ContentType} - * - * @property {Object} feedOutputConfig - * Required. Feed output configuration defining where the asset updates are - * published to. - * - * This object should have the same structure as [FeedOutputConfig]{@link google.cloud.asset.v1p2beta1.FeedOutputConfig} - * - * @typedef Feed - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.Feed definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/asset_service.proto} - */ -const Feed = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Asset content type. - * - * @enum {number} - * @memberof google.cloud.asset.v1p2beta1 - */ -const ContentType = { - - /** - * Unspecified content type. - */ - CONTENT_TYPE_UNSPECIFIED: 0, - - /** - * Resource metadata. - */ - RESOURCE: 1, - - /** - * The actual IAM policy set on a resource. - */ - IAM_POLICY: 2, - - /** - * The IAM policy name for the IAM policy set on a resource. - */ - IAM_POLICY_NAME: 3, - ORG_POLICY: 4, - - /** - * The Cloud Access context mananger Policy set on an asset. - */ - ACCESS_POLICY: 5 -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_assets.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_assets.js deleted file mode 100644 index 03eedbc2aa6..00000000000 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_assets.js +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Temporal asset. In addition to the asset, the temporal asset includes the - * status of the asset and valid from and to time of it. - * - * @property {Object} window - * The time window when the asset data and state was observed. - * - * This object should have the same structure as [TimeWindow]{@link google.cloud.asset.v1p2beta1.TimeWindow} - * - * @property {boolean} deleted - * If the asset is deleted or not. - * - * @property {Object} asset - * Asset. - * - * This object should have the same structure as [Asset]{@link google.cloud.asset.v1p2beta1.Asset} - * - * @typedef TemporalAsset - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.TemporalAsset definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/assets.proto} - */ -const TemporalAsset = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A time window of (start_time, end_time]. - * - * @property {Object} startTime - * Start time of the time window (exclusive). - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} endTime - * End time of the time window (inclusive). - * Current timestamp if not specified. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @typedef TimeWindow - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.TimeWindow definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/assets.proto} - */ -const TimeWindow = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Cloud asset. This includes all Google Cloud Platform resources, - * Cloud IAM policies, and other non-GCP assets. - * - * @property {string} name - * The full name of the asset. For example: - * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. - * See [Resource - * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) - * for more information. - * - * @property {string} assetType - * Type of the asset. Example: "compute.googleapis.com/Disk". - * - * @property {Object} resource - * Representation of the resource. - * - * This object should have the same structure as [Resource]{@link google.cloud.asset.v1p2beta1.Resource} - * - * @property {Object} iamPolicy - * Representation of the actual Cloud IAM policy set on a cloud resource. For - * each resource, there must be at most one Cloud IAM policy set on it. - * - * This object should have the same structure as [Policy]{@link google.iam.v1.Policy} - * - * @property {Buffer} iamPolicyName - * Cloud IAM policy name of the Cloud IAM policy set on a cloud resource. For - * each resource, there must be at most one Cloud IAM policy name associated - * with it. - * - * @property {string[]} ancestors - * Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy, - * represented as a list of relative resource names. Ancestry path starts with - * the closest CRM ancestor and ending at a visible root. If the asset is a - * CRM project/ folder/organization, this starts from the asset itself. - * - * Example: ["projects/123456789", "folders/5432", "organizations/1234"] - * - * @typedef Asset - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.Asset definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/assets.proto} - */ -const Asset = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Representation of a cloud resource. - * - * @property {string} version - * The API version. Example: "v1". - * - * @property {string} discoveryDocumentUri - * The URL of the discovery document containing the resource's JSON schema. - * For example: - * [`"https://www.googleapis.com/discovery/v1/apis/compute/v1/rest"`](https://www.googleapis.com/discovery/v1/apis/compute/v1/rest). - * It will be left unspecified for resources without a discovery-based API, - * such as Cloud Bigtable. - * - * @property {string} discoveryName - * The JSON schema name listed in the discovery document. - * Example: "Project". It will be left unspecified for resources (such as - * Cloud Bigtable) without a discovery-based API. - * - * @property {string} resourceUrl - * The REST URL for accessing the resource. An HTTP GET operation using this - * URL returns the resource itself. - * Example: - * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`. - * It will be left unspecified for resources without a REST API. - * - * @property {string} parent - * The full name of the immediate parent of this resource. See - * [Resource - * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) - * for more information. - * - * For GCP assets, it is the parent resource defined in the [Cloud IAM policy - * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). - * For example: - * `"//cloudresourcemanager.googleapis.com/projects/my_project_123"`. - * - * For third-party assets, it is up to the users to define. - * - * @property {Object} data - * The content of the resource, in which some sensitive fields are scrubbed - * away and may not be present. - * - * This object should have the same structure as [Struct]{@link google.protobuf.Struct} - * - * @property {Object} internalData - * The actual metadata content for the resource, only visible for internal - * users. - * - * This object should have the same structure as [Any]{@link google.protobuf.Any} - * - * @typedef Resource - * @memberof google.cloud.asset.v1p2beta1 - * @see [google.cloud.asset.v1p2beta1.Resource definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/asset/v1p2beta1/assets.proto} - */ -const Resource = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/iam/v1/doc_policy.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/iam/v1/doc_policy.js deleted file mode 100644 index f2ac79a7afa..00000000000 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/iam/v1/doc_policy.js +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Defines an Identity and Access Management (IAM) policy. It is used to - * specify access control policies for Cloud Platform resources. - * - * - * A `Policy` is a collection of `bindings`. A `binding` binds one or more - * `members` to a single `role`. Members can be user accounts, service accounts, - * Google groups, and domains (such as G Suite). A `role` is a named list of - * permissions (defined by IAM or configured by users). A `binding` can - * optionally specify a `condition`, which is a logic expression that further - * constrains the role binding based on attributes about the request and/or - * target resource. - * - * **JSON Example** - * - * { - * "bindings": [ - * { - * "role": "roles/resourcemanager.organizationAdmin", - * "members": [ - * "user:mike@example.com", - * "group:admins@example.com", - * "domain:google.com", - * "serviceAccount:my-project-id@appspot.gserviceaccount.com" - * ] - * }, - * { - * "role": "roles/resourcemanager.organizationViewer", - * "members": ["user:eve@example.com"], - * "condition": { - * "title": "expirable access", - * "description": "Does not grant access after Sep 2020", - * "expression": "request.time < - * timestamp('2020-10-01T00:00:00.000Z')", - * } - * } - * ] - * } - * - * **YAML Example** - * - * bindings: - * - members: - * - user:mike@example.com - * - group:admins@example.com - * - domain:google.com - * - serviceAccount:my-project-id@appspot.gserviceaccount.com - * role: roles/resourcemanager.organizationAdmin - * - members: - * - user:eve@example.com - * role: roles/resourcemanager.organizationViewer - * condition: - * title: expirable access - * description: Does not grant access after Sep 2020 - * expression: request.time < timestamp('2020-10-01T00:00:00.000Z') - * - * For a description of IAM and its features, see the - * [IAM developer's guide](https://cloud.google.com/iam/docs). - * - * @property {number} version - * Specifies the format of the policy. - * - * Valid values are 0, 1, and 3. Requests specifying an invalid value will be - * rejected. - * - * Operations affecting conditional bindings must specify version 3. This can - * be either setting a conditional policy, modifying a conditional binding, - * or removing a binding (conditional or unconditional) from the stored - * conditional policy. - * Operations on non-conditional policies may specify any valid value or - * leave the field unset. - * - * If no etag is provided in the call to `setIamPolicy`, version compliance - * checks against the stored policy is skipped. - * - * @property {Object[]} bindings - * Associates a list of `members` to a `role`. Optionally may specify a - * `condition` that determines when binding is in effect. - * `bindings` with no members will result in an error. - * - * This object should have the same structure as [Binding]{@link google.iam.v1.Binding} - * - * @property {Buffer} etag - * `etag` is used for optimistic concurrency control as a way to help - * prevent simultaneous updates of a policy from overwriting each other. - * It is strongly suggested that systems make use of the `etag` in the - * read-modify-write cycle to perform policy updates in order to avoid race - * conditions: An `etag` is returned in the response to `getIamPolicy`, and - * systems are expected to put that etag in the request to `setIamPolicy` to - * ensure that their change will be applied to the same version of the policy. - * - * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten. Due to blind-set semantics of an etag-less policy, - * 'setIamPolicy' will not fail even if the incoming policy version does not - * meet the requirements for modifying the stored policy. - * - * @typedef Policy - * @memberof google.iam.v1 - * @see [google.iam.v1.Policy definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} - */ -const Policy = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Associates `members` with a `role`. - * - * @property {string} role - * Role that is assigned to `members`. - * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - * - * @property {string[]} members - * Specifies the identities requesting access for a Cloud Platform resource. - * `members` can have the following values: - * - * * `allUsers`: A special identifier that represents anyone who is - * on the internet; with or without a Google account. - * - * * `allAuthenticatedUsers`: A special identifier that represents anyone - * who is authenticated with a Google account or a service account. - * - * * `user:{emailid}`: An email address that represents a specific Google - * account. For example, `alice@example.com` . - * - * - * * `serviceAccount:{emailid}`: An email address that represents a service - * account. For example, `my-other-app@appspot.gserviceaccount.com`. - * - * * `group:{emailid}`: An email address that represents a Google group. - * For example, `admins@example.com`. - * - * - * * `domain:{domain}`: The G Suite domain (primary) that represents all the - * users of that domain. For example, `google.com` or `example.com`. - * - * @property {Object} condition - * The condition that is associated with this binding. - * NOTE: An unsatisfied condition will not allow user access via current - * binding. Different bindings, including their conditions, are examined - * independently. - * - * This object should have the same structure as [Expr]{@link google.type.Expr} - * - * @typedef Binding - * @memberof google.iam.v1 - * @see [google.iam.v1.Binding definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} - */ -const Binding = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/longrunning/doc_operations.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/longrunning/doc_operations.js deleted file mode 100644 index 099e418d620..00000000000 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/longrunning/doc_operations.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * This resource represents a long-running operation that is the result of a - * network API call. - * - * @property {string} name - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the - * `name` should be a resource name ending with `operations/{unique_id}`. - * - * @property {Object} metadata - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. - * Some services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - * - * This object should have the same structure as [Any]{@link google.protobuf.Any} - * - * @property {boolean} done - * If the value is `false`, it means the operation is still in progress. - * If `true`, the operation is completed, and either `error` or `response` is - * available. - * - * @property {Object} error - * The error result of the operation in case of failure or cancellation. - * - * This object should have the same structure as [Status]{@link google.rpc.Status} - * - * @property {Object} response - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` - * is the original method name. For example, if the original method name - * is `TakeSnapshot()`, the inferred response type is - * `TakeSnapshotResponse`. - * - * This object should have the same structure as [Any]{@link google.protobuf.Any} - * - * @typedef Operation - * @memberof google.longrunning - * @see [google.longrunning.Operation definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} - */ -const Operation = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_any.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_any.js deleted file mode 100644 index 813682aa336..00000000000 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_any.js +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * `Any` contains an arbitrary serialized protocol buffer message along with a - * URL that describes the type of the serialized message. - * - * Protobuf library provides support to pack/unpack Any values in the form - * of utility functions or additional generated methods of the Any type. - * - * Example 1: Pack and unpack a message in C++. - * - * Foo foo = ...; - * Any any; - * any.PackFrom(foo); - * ... - * if (any.UnpackTo(&foo)) { - * ... - * } - * - * Example 2: Pack and unpack a message in Java. - * - * Foo foo = ...; - * Any any = Any.pack(foo); - * ... - * if (any.is(Foo.class)) { - * foo = any.unpack(Foo.class); - * } - * - * Example 3: Pack and unpack a message in Python. - * - * foo = Foo(...) - * any = Any() - * any.Pack(foo) - * ... - * if any.Is(Foo.DESCRIPTOR): - * any.Unpack(foo) - * ... - * - * Example 4: Pack and unpack a message in Go - * - * foo := &pb.Foo{...} - * any, err := ptypes.MarshalAny(foo) - * ... - * foo := &pb.Foo{} - * if err := ptypes.UnmarshalAny(any, foo); err != nil { - * ... - * } - * - * The pack methods provided by protobuf library will by default use - * 'type.googleapis.com/full.type.name' as the type URL and the unpack - * methods only use the fully qualified type name after the last '/' - * in the type URL, for example "foo.bar.com/x/y.z" will yield type - * name "y.z". - * - * - * # JSON - * - * The JSON representation of an `Any` value uses the regular - * representation of the deserialized, embedded message, with an - * additional field `@type` which contains the type URL. Example: - * - * package google.profile; - * message Person { - * string first_name = 1; - * string last_name = 2; - * } - * - * { - * "@type": "type.googleapis.com/google.profile.Person", - * "firstName": , - * "lastName": - * } - * - * If the embedded message type is well-known and has a custom JSON - * representation, that representation will be embedded adding a field - * `value` which holds the custom JSON in addition to the `@type` - * field. Example (for message google.protobuf.Duration): - * - * { - * "@type": "type.googleapis.com/google.protobuf.Duration", - * "value": "1.212s" - * } - * - * @property {string} typeUrl - * A URL/resource name that uniquely identifies the type of the serialized - * protocol buffer message. This string must contain at least - * one "/" character. The last segment of the URL's path must represent - * the fully qualified name of the type (as in - * `path/google.protobuf.Duration`). The name should be in a canonical form - * (e.g., leading "." is not accepted). - * - * In practice, teams usually precompile into the binary all types that they - * expect it to use in the context of Any. However, for URLs which use the - * scheme `http`, `https`, or no scheme, one can optionally set up a type - * server that maps type URLs to message definitions as follows: - * - * * If no scheme is provided, `https` is assumed. - * * An HTTP GET on the URL must yield a google.protobuf.Type - * value in binary format, or produce an error. - * * Applications are allowed to cache lookup results based on the - * URL, or have them precompiled into a binary to avoid any - * lookup. Therefore, binary compatibility needs to be preserved - * on changes to types. (Use versioned type names to manage - * breaking changes.) - * - * Note: this functionality is not currently available in the official - * protobuf release, and it is not used for type URLs beginning with - * type.googleapis.com. - * - * Schemes other than `http`, `https` (or the empty scheme) might be - * used with implementation specific semantics. - * - * @property {Buffer} value - * Must be a valid serialized protocol buffer of the above specified type. - * - * @typedef Any - * @memberof google.protobuf - * @see [google.protobuf.Any definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/any.proto} - */ -const Any = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_empty.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_empty.js deleted file mode 100644 index 1e3961d6609..00000000000 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_empty.js +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request - * or the response type of an API method. For instance: - * - * service Foo { - * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - * } - * - * The JSON representation for `Empty` is empty JSON object `{}`. - * @typedef Empty - * @memberof google.protobuf - * @see [google.protobuf.Empty definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/empty.proto} - */ -const Empty = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_field_mask.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_field_mask.js deleted file mode 100644 index 59e745f36c2..00000000000 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_field_mask.js +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * `FieldMask` represents a set of symbolic field paths, for example: - * - * paths: "f.a" - * paths: "f.b.d" - * - * Here `f` represents a field in some root message, `a` and `b` - * fields in the message found in `f`, and `d` a field found in the - * message in `f.b`. - * - * Field masks are used to specify a subset of fields that should be - * returned by a get operation or modified by an update operation. - * Field masks also have a custom JSON encoding (see below). - * - * # Field Masks in Projections - * - * When used in the context of a projection, a response message or - * sub-message is filtered by the API to only contain those fields as - * specified in the mask. For example, if the mask in the previous - * example is applied to a response message as follows: - * - * f { - * a : 22 - * b { - * d : 1 - * x : 2 - * } - * y : 13 - * } - * z: 8 - * - * The result will not contain specific values for fields x,y and z - * (their value will be set to the default, and omitted in proto text - * output): - * - * - * f { - * a : 22 - * b { - * d : 1 - * } - * } - * - * A repeated field is not allowed except at the last position of a - * paths string. - * - * If a FieldMask object is not present in a get operation, the - * operation applies to all fields (as if a FieldMask of all fields - * had been specified). - * - * Note that a field mask does not necessarily apply to the - * top-level response message. In case of a REST get operation, the - * field mask applies directly to the response, but in case of a REST - * list operation, the mask instead applies to each individual message - * in the returned resource list. In case of a REST custom method, - * other definitions may be used. Where the mask applies will be - * clearly documented together with its declaration in the API. In - * any case, the effect on the returned resource/resources is required - * behavior for APIs. - * - * # Field Masks in Update Operations - * - * A field mask in update operations specifies which fields of the - * targeted resource are going to be updated. The API is required - * to only change the values of the fields as specified in the mask - * and leave the others untouched. If a resource is passed in to - * describe the updated values, the API ignores the values of all - * fields not covered by the mask. - * - * If a repeated field is specified for an update operation, new values will - * be appended to the existing repeated field in the target resource. Note that - * a repeated field is only allowed in the last position of a `paths` string. - * - * If a sub-message is specified in the last position of the field mask for an - * update operation, then new value will be merged into the existing sub-message - * in the target resource. - * - * For example, given the target message: - * - * f { - * b { - * d: 1 - * x: 2 - * } - * c: [1] - * } - * - * And an update message: - * - * f { - * b { - * d: 10 - * } - * c: [2] - * } - * - * then if the field mask is: - * - * paths: ["f.b", "f.c"] - * - * then the result will be: - * - * f { - * b { - * d: 10 - * x: 2 - * } - * c: [1, 2] - * } - * - * An implementation may provide options to override this default behavior for - * repeated and message fields. - * - * In order to reset a field's value to the default, the field must - * be in the mask and set to the default value in the provided resource. - * Hence, in order to reset all fields of a resource, provide a default - * instance of the resource and set all fields in the mask, or do - * not provide a mask as described below. - * - * If a field mask is not present on update, the operation applies to - * all fields (as if a field mask of all fields has been specified). - * Note that in the presence of schema evolution, this may mean that - * fields the client does not know and has therefore not filled into - * the request will be reset to their default. If this is unwanted - * behavior, a specific service may require a client to always specify - * a field mask, producing an error if not. - * - * As with get operations, the location of the resource which - * describes the updated values in the request message depends on the - * operation kind. In any case, the effect of the field mask is - * required to be honored by the API. - * - * ## Considerations for HTTP REST - * - * The HTTP kind of an update operation which uses a field mask must - * be set to PATCH instead of PUT in order to satisfy HTTP semantics - * (PUT must only be used for full updates). - * - * # JSON Encoding of Field Masks - * - * In JSON, a field mask is encoded as a single string where paths are - * separated by a comma. Fields name in each path are converted - * to/from lower-camel naming conventions. - * - * As an example, consider the following message declarations: - * - * message Profile { - * User user = 1; - * Photo photo = 2; - * } - * message User { - * string display_name = 1; - * string address = 2; - * } - * - * In proto a field mask for `Profile` may look as such: - * - * mask { - * paths: "user.display_name" - * paths: "photo" - * } - * - * In JSON, the same mask is represented as below: - * - * { - * mask: "user.displayName,photo" - * } - * - * # Field Masks and Oneof Fields - * - * Field masks treat fields in oneofs just as regular fields. Consider the - * following message: - * - * message SampleMessage { - * oneof test_oneof { - * string name = 4; - * SubMessage sub_message = 9; - * } - * } - * - * The field mask can be: - * - * mask { - * paths: "name" - * } - * - * Or: - * - * mask { - * paths: "sub_message" - * } - * - * Note that oneof type names ("test_oneof" in this case) cannot be used in - * paths. - * - * ## Field Mask Verification - * - * The implementation of any API method which has a FieldMask type field in the - * request should verify the included field paths, and return an - * `INVALID_ARGUMENT` error if any path is duplicated or unmappable. - * - * @property {string[]} paths - * The set of field mask paths. - * - * @typedef FieldMask - * @memberof google.protobuf - * @see [google.protobuf.FieldMask definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/field_mask.proto} - */ -const FieldMask = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_struct.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_struct.js deleted file mode 100644 index a143b9a6d2d..00000000000 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_struct.js +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * `Struct` represents a structured data value, consisting of fields - * which map to dynamically typed values. In some languages, `Struct` - * might be supported by a native representation. For example, in - * scripting languages like JS a struct is represented as an - * object. The details of that representation are described together - * with the proto support for the language. - * - * The JSON representation for `Struct` is JSON object. - * - * @property {Object.} fields - * Unordered map of dynamically typed values. - * - * @typedef Struct - * @memberof google.protobuf - * @see [google.protobuf.Struct definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} - */ -const Struct = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * `Value` represents a dynamically typed value which can be either - * null, a number, a string, a boolean, a recursive struct value, or a - * list of values. A producer of value is expected to set one of that - * variants, absence of any variant indicates an error. - * - * The JSON representation for `Value` is JSON value. - * - * @property {number} nullValue - * Represents a null value. - * - * The number should be among the values of [NullValue]{@link google.protobuf.NullValue} - * - * @property {number} numberValue - * Represents a double value. - * - * @property {string} stringValue - * Represents a string value. - * - * @property {boolean} boolValue - * Represents a boolean value. - * - * @property {Object} structValue - * Represents a structured value. - * - * This object should have the same structure as [Struct]{@link google.protobuf.Struct} - * - * @property {Object} listValue - * Represents a repeated `Value`. - * - * This object should have the same structure as [ListValue]{@link google.protobuf.ListValue} - * - * @typedef Value - * @memberof google.protobuf - * @see [google.protobuf.Value definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} - */ -const Value = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * `ListValue` is a wrapper around a repeated field of values. - * - * The JSON representation for `ListValue` is JSON array. - * - * @property {Object[]} values - * Repeated field of dynamically typed values. - * - * This object should have the same structure as [Value]{@link google.protobuf.Value} - * - * @typedef ListValue - * @memberof google.protobuf - * @see [google.protobuf.ListValue definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} - */ -const ListValue = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * `NullValue` is a singleton enumeration to represent the null value for the - * `Value` type union. - * - * The JSON representation for `NullValue` is JSON `null`. - * - * @enum {number} - * @memberof google.protobuf - */ -const NullValue = { - - /** - * Null value. - */ - NULL_VALUE: 0 -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_timestamp.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_timestamp.js deleted file mode 100644 index ad801cc9a10..00000000000 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/protobuf/doc_timestamp.js +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at - * nanosecond resolution. The count is relative to an epoch at UTC midnight on - * January 1, 1970, in the proleptic Gregorian calendar which extends the - * Gregorian calendar backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a [24-hour linear - * smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from [RFC - * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * - * Example 5: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" - * where {year} is always expressed using four digits while {month}, {day}, - * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional - * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - * is required. A proto3 JSON serializer should always use UTC (as indicated by - * "Z") when printing the Timestamp type and a proto3 JSON parser should be - * able to accept both UTC and other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - * 01:30 UTC on January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the - * standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - * the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D) to obtain a formatter capable of generating timestamps in this format. - * - * @property {number} seconds - * Represents seconds of UTC time since Unix epoch - * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - * 9999-12-31T23:59:59Z inclusive. - * - * @property {number} nanos - * Non-negative fractions of a second at nanosecond resolution. Negative - * second values with fractions must still have non-negative nanos values - * that count forward in time. Must be from 0 to 999,999,999 - * inclusive. - * - * @typedef Timestamp - * @memberof google.protobuf - * @see [google.protobuf.Timestamp definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto} - */ -const Timestamp = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/rpc/doc_status.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/rpc/doc_status.js deleted file mode 100644 index 750e0af7689..00000000000 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/rpc/doc_status.js +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). Each `Status` message contains - * three pieces of data: error code, error message, and error details. - * - * You can find out more about this error model and how to work with it in the - * [API Design Guide](https://cloud.google.com/apis/design/errors). - * - * @property {number} code - * The status code, which should be an enum value of google.rpc.Code. - * - * @property {string} message - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - * - * @property {Object[]} details - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - * - * This object should have the same structure as [Any]{@link google.protobuf.Any} - * - * @typedef Status - * @memberof google.rpc - * @see [google.rpc.Status definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto} - */ -const Status = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1p2beta1/doc/google/type/doc_expr.js b/packages/google-cloud-asset/src/v1p2beta1/doc/google/type/doc_expr.js deleted file mode 100644 index c185edde52f..00000000000 --- a/packages/google-cloud-asset/src/v1p2beta1/doc/google/type/doc_expr.js +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Represents an expression text. Example: - * - * title: "User account presence" - * description: "Determines whether the request has a user account" - * expression: "size(request.user) > 0" - * - * @property {string} expression - * Textual representation of an expression in - * Common Expression Language syntax. - * - * The application context of the containing message determines which - * well-known feature set of CEL is supported. - * - * @property {string} title - * An optional title for the expression, i.e. a short string describing - * its purpose. This can be used e.g. in UIs which allow to enter the - * expression. - * - * @property {string} description - * An optional description of the expression. This is a longer text which - * describes the expression, e.g. when hovered over it in a UI. - * - * @property {string} location - * An optional string indicating the location of the expression for error - * reporting, e.g. a file name and a position in the file. - * - * @typedef Expr - * @memberof google.type - * @see [google.type.Expr definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/type/expr.proto} - */ -const Expr = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/packages/google-cloud-asset/src/v1beta1/index.js b/packages/google-cloud-asset/src/v1p2beta1/index.ts similarity index 66% rename from packages/google-cloud-asset/src/v1beta1/index.js rename to packages/google-cloud-asset/src/v1p2beta1/index.ts index 501c92ee4cf..6890c43379a 100644 --- a/packages/google-cloud-asset/src/v1beta1/index.js +++ b/packages/google-cloud-asset/src/v1p2beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,9 +11,9 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** -'use strict'; - -const AssetServiceClient = require('./asset_service_client'); - -module.exports.AssetServiceClient = AssetServiceClient; +export {AssetServiceClient} from './asset_service_client'; diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 71de83499c7..39ae8f116ff 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,28 +1,24 @@ { - "updateTime": "2020-01-28T12:09:25.073655Z", + "updateTime": "2020-01-30T19:19:18.903592Z", "sources": [ { - "generator": { - "name": "artman", - "version": "0.44.3", - "dockerImage": "googleapis/artman@sha256:62b8b29acaae54b06a4183aa772e65b106e92d4bc466eb4db07953ab78bdb90c" + "git": { + "name": ".", + "remote": "git@github.com:googleapis/nodejs-asset.git", + "sha": "603d73dabc4a5979b6b4bec3412b145c9994c8f2" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "8e981acfd9b97ea2f312f11bbaa7b6c16e412dea", - "internalRef": "291821782", - "log": "8e981acfd9b97ea2f312f11bbaa7b6c16e412dea\nBeta launch for PersonDetection and FaceDetection features.\n\nPiperOrigin-RevId: 291821782\n\n994e067fae3b21e195f7da932b08fff806d70b5d\nasset: add annotations to v1p2beta1\n\nPiperOrigin-RevId: 291815259\n\n244e1d2c89346ca2e0701b39e65552330d68545a\nAdd Playable Locations service\n\nPiperOrigin-RevId: 291806349\n\n909f8f67963daf45dd88d020877fb9029b76788d\nasset: add annotations to v1beta2\n\nPiperOrigin-RevId: 291805301\n\n3c39a1d6e23c1ef63c7fba4019c25e76c40dfe19\nKMS: add file-level message for CryptoKeyPath, it is defined in gapic yaml but not\nin proto files.\n\nPiperOrigin-RevId: 291420695\n\nc6f3f350b8387f8d1b85ed4506f30187ebaaddc3\ncontaineranalysis: update v1beta1 and bazel build with annotations\n\nPiperOrigin-RevId: 291401900\n\n92887d74b44e4e636252b7b8477d0d2570cd82db\nfix: fix the location of grpc config file.\n\nPiperOrigin-RevId: 291396015\n\n" + "sha": "3ca2c014e24eb5111c8e7248b1e1eb833977c83d", + "internalRef": "292382559", + "log": "3ca2c014e24eb5111c8e7248b1e1eb833977c83d\nbazel: Add --flaky_test_attempts=3 argument to prevent CI failures caused by flaky tests\n\nPiperOrigin-RevId: 292382559\n\n9933347c1f677e81e19a844c2ef95bfceaf694fe\nbazel:Integrate latest protoc-java-resource-names-plugin changes (fix for PyYAML dependency in bazel rules)\n\nPiperOrigin-RevId: 292376626\n\nb835ab9d2f62c88561392aa26074c0b849fb0bd3\nasset: v1p2beta1 add client config annotations\n\n* remove unintentionally exposed RPCs\n* remove messages relevant to removed RPCs\n\nPiperOrigin-RevId: 292369593\n\nc1246a29e22b0f98e800a536b5b0da2d933a55f2\nUpdating v1 protos with the latest inline documentation (in comments) and config options. Also adding a per-service .yaml file.\n\nPiperOrigin-RevId: 292310790\n\n" } }, { - "template": { - "name": "node_library", - "origin": "synthtool.gcp", - "version": "2019.10.17" - } + "git": {} } ], "destinations": [ @@ -31,9 +27,8 @@ "source": "googleapis", "apiName": "asset", "apiVersion": "v1beta1", - "language": "nodejs", - "generator": "gapic", - "config": "google/cloud/asset/artman_cloudasset_v1beta1.yaml" + "language": "typescript", + "generator": "gapic-generator-typescript" } }, { @@ -41,9 +36,17 @@ "source": "googleapis", "apiName": "asset", "apiVersion": "v1", - "language": "nodejs", - "generator": "gapic", - "config": "google/cloud/asset/artman_cloudasset_v1.yaml" + "language": "typescript", + "generator": "gapic-generator-typescript" + } + }, + { + "client": { + "source": "googleapis", + "apiName": "asset", + "apiVersion": "v1p1beta1", + "language": "typescript", + "generator": "gapic-generator-typescript" } }, { @@ -51,9 +54,8 @@ "source": "googleapis", "apiName": "asset", "apiVersion": "v1p2beta1", - "language": "nodejs", - "generator": "gapic", - "config": "google/cloud/asset/artman_cloudasset_v1p2beta1.yaml" + "language": "typescript", + "generator": "gapic-generator-typescript" } } ], @@ -79,15 +81,9 @@ { "path": ".github/release-please.yml" }, - { - "path": ".gitignore" - }, { "path": ".jsdoc.js" }, - { - "path": ".kokoro/.gitattributes" - }, { "path": ".kokoro/common.cfg" }, @@ -166,9 +162,6 @@ { "path": ".kokoro/publish.sh" }, - { - "path": ".kokoro/release/common.cfg" - }, { "path": ".kokoro/release/docs.cfg" }, @@ -202,12 +195,6 @@ { "path": ".prettierrc" }, - { - "path": ".repo-metadata.json" - }, - { - "path": "CHANGELOG.md" - }, { "path": "CODE_OF_CONDUCT.md" }, @@ -226,9 +213,6 @@ { "path": "linkinator.config.json" }, - { - "path": "package.json" - }, { "path": "protos/google/cloud/asset/v1/asset_service.proto" }, @@ -241,12 +225,21 @@ { "path": "protos/google/cloud/asset/v1beta1/assets.proto" }, + { + "path": "protos/google/cloud/asset/v1p1beta1/asset_service.proto" + }, + { + "path": "protos/google/cloud/asset/v1p1beta1/assets.proto" + }, { "path": "protos/google/cloud/asset/v1p2beta1/asset_service.proto" }, { "path": "protos/google/cloud/asset/v1p2beta1/assets.proto" }, + { + "path": "protos/google/cloud/common_resources.proto" + }, { "path": "protos/protos.d.ts" }, @@ -259,50 +252,11 @@ { "path": "renovate.json" }, - { - "path": "samples/.eslintrc.yml" - }, { "path": "samples/README.md" }, { - "path": "samples/createFeed.js" - }, - { - "path": "samples/deleteFeed.js" - }, - { - "path": "samples/exportAssets.js" - }, - { - "path": "samples/getBatchAssetHistory.js" - }, - { - "path": "samples/getFeed.js" - }, - { - "path": "samples/listFeeds.js" - }, - { - "path": "samples/package.json" - }, - { - "path": "samples/quickstart.js" - }, - { - "path": "samples/test/sample.test.js" - }, - { - "path": "samples/updateFeed.js" - }, - { - "path": "src/browser.js" - }, - { - "path": "src/index.js" - }, - { - "path": "src/v1/asset_service_client.js" + "path": "src/v1/asset_service_client.ts" }, { "path": "src/v1/asset_service_client_config.json" @@ -311,43 +265,10 @@ "path": "src/v1/asset_service_proto_list.json" }, { - "path": "src/v1/doc/google/cloud/asset/v1/doc_asset_service.js" + "path": "src/v1/index.ts" }, { - "path": "src/v1/doc/google/cloud/asset/v1/doc_assets.js" - }, - { - "path": "src/v1/doc/google/iam/v1/doc_policy.js" - }, - { - "path": "src/v1/doc/google/longrunning/doc_operations.js" - }, - { - "path": "src/v1/doc/google/protobuf/doc_any.js" - }, - { - "path": "src/v1/doc/google/protobuf/doc_empty.js" - }, - { - "path": "src/v1/doc/google/protobuf/doc_field_mask.js" - }, - { - "path": "src/v1/doc/google/protobuf/doc_struct.js" - }, - { - "path": "src/v1/doc/google/protobuf/doc_timestamp.js" - }, - { - "path": "src/v1/doc/google/rpc/doc_status.js" - }, - { - "path": "src/v1/doc/google/type/doc_expr.js" - }, - { - "path": "src/v1/index.js" - }, - { - "path": "src/v1beta1/asset_service_client.js" + "path": "src/v1beta1/asset_service_client.ts" }, { "path": "src/v1beta1/asset_service_client_config.json" @@ -356,37 +277,22 @@ "path": "src/v1beta1/asset_service_proto_list.json" }, { - "path": "src/v1beta1/doc/google/cloud/asset/v1beta1/doc_asset_service.js" - }, - { - "path": "src/v1beta1/doc/google/cloud/asset/v1beta1/doc_assets.js" - }, - { - "path": "src/v1beta1/doc/google/iam/v1/doc_policy.js" + "path": "src/v1beta1/index.ts" }, { - "path": "src/v1beta1/doc/google/longrunning/doc_operations.js" + "path": "src/v1p1beta1/asset_service_client.ts" }, { - "path": "src/v1beta1/doc/google/protobuf/doc_any.js" + "path": "src/v1p1beta1/asset_service_client_config.json" }, { - "path": "src/v1beta1/doc/google/protobuf/doc_struct.js" + "path": "src/v1p1beta1/asset_service_proto_list.json" }, { - "path": "src/v1beta1/doc/google/protobuf/doc_timestamp.js" + "path": "src/v1p1beta1/index.ts" }, { - "path": "src/v1beta1/doc/google/rpc/doc_status.js" - }, - { - "path": "src/v1beta1/doc/google/type/doc_expr.js" - }, - { - "path": "src/v1beta1/index.js" - }, - { - "path": "src/v1p2beta1/asset_service_client.js" + "path": "src/v1p2beta1/asset_service_client.ts" }, { "path": "src/v1p2beta1/asset_service_client_config.json" @@ -395,64 +301,38 @@ "path": "src/v1p2beta1/asset_service_proto_list.json" }, { - "path": "src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_asset_service.js" + "path": "src/v1p2beta1/index.ts" }, { - "path": "src/v1p2beta1/doc/google/cloud/asset/v1p2beta1/doc_assets.js" + "path": "system-test/fixtures/sample/src/index.js" }, { - "path": "src/v1p2beta1/doc/google/iam/v1/doc_policy.js" + "path": "system-test/fixtures/sample/src/index.ts" }, { - "path": "src/v1p2beta1/doc/google/longrunning/doc_operations.js" + "path": "system-test/install.ts" }, { - "path": "src/v1p2beta1/doc/google/protobuf/doc_any.js" + "path": "test/gapic-asset_service-v1.ts" }, { - "path": "src/v1p2beta1/doc/google/protobuf/doc_empty.js" + "path": "test/gapic-asset_service-v1beta1.ts" }, { - "path": "src/v1p2beta1/doc/google/protobuf/doc_field_mask.js" + "path": "test/gapic-asset_service-v1p1beta1.ts" }, { - "path": "src/v1p2beta1/doc/google/protobuf/doc_struct.js" + "path": "test/gapic-asset_service-v1p2beta1.ts" }, { - "path": "src/v1p2beta1/doc/google/protobuf/doc_timestamp.js" + "path": "tsconfig.json" }, { - "path": "src/v1p2beta1/doc/google/rpc/doc_status.js" - }, - { - "path": "src/v1p2beta1/doc/google/type/doc_expr.js" - }, - { - "path": "src/v1p2beta1/index.js" - }, - { - "path": "synth.metadata" - }, - { - "path": "synth.py" - }, - { - "path": "system-test/.eslintrc.yml" - }, - { - "path": "system-test/no-tests.js" - }, - { - "path": "test/gapic-v1.js" - }, - { - "path": "test/gapic-v1beta1.js" - }, - { - "path": "test/gapic-v1p2beta1.js" + "path": "tslint.json" }, { "path": "webpack.config.js" } - ] + ], + "combinedCommitLog": "Changes in googleapis:\n3ca2c014e24eb5111c8e7248b1e1eb833977c83d\nbazel: Add --flaky_test_attempts=3 argument to prevent CI failures caused by flaky tests\n\nPiperOrigin-RevId: 292382559\n\n9933347c1f677e81e19a844c2ef95bfceaf694fe\nbazel:Integrate latest protoc-java-resource-names-plugin changes (fix for PyYAML dependency in bazel rules)\n\nPiperOrigin-RevId: 292376626\n\nb835ab9d2f62c88561392aa26074c0b849fb0bd3\nasset: v1p2beta1 add client config annotations\n\n* remove unintentionally exposed RPCs\n* remove messages relevant to removed RPCs\n\nPiperOrigin-RevId: 292369593\n\nc1246a29e22b0f98e800a536b5b0da2d933a55f2\nUpdating v1 protos with the latest inline documentation (in comments) and config options. Also adding a per-service .yaml file.\n\nPiperOrigin-RevId: 292310790\n\n" } \ No newline at end of file diff --git a/packages/google-cloud-asset/synth.py b/packages/google-cloud-asset/synth.py index 6f78852b9c7..aaeb2aa1df8 100644 --- a/packages/google-cloud-asset/synth.py +++ b/packages/google-cloud-asset/synth.py @@ -20,38 +20,30 @@ logging.basicConfig(level=logging.DEBUG) -# run the gapic generator -gapic = gcp.GAPICGenerator() -versions = ['v1beta1', 'v1', 'v1p2beta1'] +gapic = gcp.GAPICMicrogenerator() +versions = ['v1beta1', 'v1', 'v1p1beta1', 'v1p2beta1'] +name = 'asset' for version in versions: - library = gapic.node_library( - 'asset', - version, - config_path=f"artman_cloudasset_{version}.yaml", - artman_output_name=f"asset-{version}") - s.copy(library, excludes=['src/index.js', 'README.md', 'package.json']) + library = gapic.typescript_library( + name, + proto_path=f'google/cloud/{name}/{version}', + generator_args={ + 'grpc-service-config': f'google/cloud/{name}/{version}/cloud{name}_grpc_service_config.json', + 'package-name': f'@google-cloud/{name}' + }, + extra_proto_files=['google/cloud/common_resources.proto'], + version=version) + # skip index, protos, package.json, and README.md + s.copy( + library, + excludes=['package.json', 'src/index.ts'] + ) # Copy common templates common_templates = gcp.CommonTemplates() -templates = common_templates.node_library() +templates = common_templates.node_library(source_location='build/src') s.copy(templates) -# [START fix-dead-link] -discovery_url = 'https://www.googleapis.com/discovery/v1/apis/compute/v1/rest' -s.replace('**/doc/google/cloud/asset/*/doc_assets.js', - f'`"{discovery_url}"`', - f'[`"{discovery_url}"`]({discovery_url})') - -s.replace('**/doc/google/protobuf/doc_timestamp.js', - 'https:\/\/cloud\.google\.com[\s\*]*http:\/\/(.*)[\s\*]*\)', - r"https://\1)") - -s.replace('**/doc/google/protobuf/doc_timestamp.js', - 'toISOString\]', - 'toISOString)') -# [END fix-dead-link] - - # Node.js specific cleanup subprocess.run(['npm', 'install']) subprocess.run(['npm', 'run', 'fix']) diff --git a/packages/google-cloud-asset/system-test/fixtures/sample/src/index.js b/packages/google-cloud-asset/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..6f3575b6c25 --- /dev/null +++ b/packages/google-cloud-asset/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2019 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. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const asset = require('@google-cloud/asset'); + +function main() { + const assetServiceClient = new asset.AssetServiceClient(); +} + +main(); diff --git a/packages/google-cloud-asset/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-asset/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..1c292d6b651 --- /dev/null +++ b/packages/google-cloud-asset/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2019 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 {AssetServiceClient} from '@google-cloud/asset'; + +function main() { + const assetServiceClient = new AssetServiceClient(); +} + +main(); diff --git a/packages/google-cloud-asset/system-test/install.ts b/packages/google-cloud-asset/system-test/install.ts new file mode 100644 index 00000000000..c9aa74ec221 --- /dev/null +++ b/packages/google-cloud-asset/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2019 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 {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('typescript consumer tests', () => { + it('should have correct type signature for typescript users', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), // path to your module. + sample: { + description: 'typescript based user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); // will throw upon error. + }); + + it('should have correct type signature for javascript users', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), // path to your module. + sample: { + description: 'typescript based user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); // will throw upon error. + }); +}); diff --git a/packages/google-cloud-asset/system-test/no-tests.js b/packages/google-cloud-asset/system-test/no-tests.js deleted file mode 100644 index 28550b2df42..00000000000 --- a/packages/google-cloud-asset/system-test/no-tests.js +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2018 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. - -console.log('no system tests 👻'); diff --git a/packages/google-cloud-asset/test/gapic-v1p2beta1.js b/packages/google-cloud-asset/test/gapic-asset_service-v1.ts similarity index 54% rename from packages/google-cloud-asset/test/gapic-v1p2beta1.js rename to packages/google-cloud-asset/test/gapic-asset_service-v1.ts index 8e90dd2a873..5a87d233785 100644 --- a/packages/google-cloud-asset/test/gapic-v1p2beta1.js +++ b/packages/google-cloud-asset/test/gapic-asset_service-v1.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,166 +11,114 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** -'use strict'; - -const assert = require('assert'); -const {describe, it} = require('mocha'); - -const assetModule = require('../src'); +import * as protosTypes from '../protos/protos'; +import * as assert from 'assert'; +import {describe, it} from 'mocha'; +const assetserviceModule = require('../src'); const FAKE_STATUS_CODE = 1; -const error = new Error(); -error.code = FAKE_STATUS_CODE; +class FakeError { + name: string; + message: string; + code: number; + constructor(n: number) { + this.name = 'fakeName'; + this.message = 'fake message'; + this.code = n; + } +} +const error = new FakeError(FAKE_STATUS_CODE); +export interface Callback { + (err: FakeError | null, response?: {} | null): void; +} -describe('AssetServiceClient', () => { +export class Operation { + constructor() {} + promise() {} +} +function mockSimpleGrpcMethod( + expectedRequest: {}, + response: {} | null, + error: FakeError | null +) { + return (actualRequest: {}, options: {}, callback: Callback) => { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} +function mockLongRunningGrpcMethod( + expectedRequest: {}, + response: {} | null, + error?: {} | null +) { + return (request: {}) => { + assert.deepStrictEqual(request, expectedRequest); + const mockOperation = { + promise() { + return new Promise((resolve, reject) => { + if (error) { + reject(error); + } else { + resolve([response]); + } + }); + }, + }; + return Promise.resolve([mockOperation]); + }; +} +describe('v1.AssetServiceClient', () => { it('has servicePath', () => { - const servicePath = assetModule.v1p2beta1.AssetServiceClient.servicePath; + const servicePath = assetserviceModule.v1.AssetServiceClient.servicePath; assert(servicePath); }); - it('has apiEndpoint', () => { - const apiEndpoint = assetModule.v1p2beta1.AssetServiceClient.apiEndpoint; + const apiEndpoint = assetserviceModule.v1.AssetServiceClient.apiEndpoint; assert(apiEndpoint); }); - it('has port', () => { - const port = assetModule.v1p2beta1.AssetServiceClient.port; + const port = assetserviceModule.v1.AssetServiceClient.port; assert(port); assert(typeof port === 'number'); }); - - it('should create a client with no options', () => { - const client = new assetModule.v1p2beta1.AssetServiceClient(); + it('should create a client with no option', () => { + const client = new assetserviceModule.v1.AssetServiceClient(); assert(client); }); - it('should create a client with gRPC fallback', () => { - const client = new assetModule.v1p2beta1.AssetServiceClient({ + const client = new assetserviceModule.v1.AssetServiceClient({ fallback: true, }); assert(client); }); - - describe('exportAssets', function() { - it('invokes exportAssets without error', done => { - const client = new assetModule.v1p2beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const parent = 'parent-995424086'; - const outputConfig = {}; - const request = { - parent: parent, - outputConfig: outputConfig, - }; - - // Mock response - const expectedResponse = {}; - - // Mock Grpc layer - client._innerApiCalls.exportAssets = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - - client - .exportAssets(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(responses => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch(err => { - done(err); - }); - }); - - it('invokes exportAssets with error', done => { - const client = new assetModule.v1p2beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const parent = 'parent-995424086'; - const outputConfig = {}; - const request = { - parent: parent, - outputConfig: outputConfig, - }; - - // Mock Grpc layer - client._innerApiCalls.exportAssets = mockLongRunningGrpcMethod( - request, - null, - error - ); - - client - .exportAssets(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(() => { - assert.fail(); - }) - .catch(err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - - it('has longrunning decoder functions', () => { - const client = new assetModule.v1p2beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert( - client._descriptors.longrunning.exportAssets.responseDecoder instanceof - Function - ); - assert( - client._descriptors.longrunning.exportAssets.metadataDecoder instanceof - Function - ); - }); - }); - describe('batchGetAssetsHistory', () => { it('invokes batchGetAssetsHistory without error', done => { - const client = new assetModule.v1p2beta1.AssetServiceClient({ + const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const parent = 'parent-995424086'; - const assetNames = []; - const contentType = 'CONTENT_TYPE_UNSPECIFIED'; - const request = { - parent: parent, - assetNames: assetNames, - contentType: contentType, - }; - + const request: protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest = {}; // Mock response const expectedResponse = {}; - - // Mock Grpc layer + // Mock gRPC layer client._innerApiCalls.batchGetAssetsHistory = mockSimpleGrpcMethod( request, - expectedResponse + expectedResponse, + null ); - - client.batchGetAssetsHistory(request, (err, response) => { + client.batchGetAssetsHistory(request, (err: {}, response: {}) => { assert.ifError(err); assert.deepStrictEqual(response, expectedResponse); done(); @@ -178,67 +126,45 @@ describe('AssetServiceClient', () => { }); it('invokes batchGetAssetsHistory with error', done => { - const client = new assetModule.v1p2beta1.AssetServiceClient({ + const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const parent = 'parent-995424086'; - const assetNames = []; - const contentType = 'CONTENT_TYPE_UNSPECIFIED'; - const request = { - parent: parent, - assetNames: assetNames, - contentType: contentType, - }; - - // Mock Grpc layer + const request: protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer client._innerApiCalls.batchGetAssetsHistory = mockSimpleGrpcMethod( request, null, error ); - - client.batchGetAssetsHistory(request, (err, response) => { - assert(err instanceof Error); + client.batchGetAssetsHistory(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); assert.strictEqual(err.code, FAKE_STATUS_CODE); assert(typeof response === 'undefined'); done(); }); }); }); - describe('createFeed', () => { it('invokes createFeed without error', done => { - const client = new assetModule.v1p2beta1.AssetServiceClient({ + const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const parent = 'parent-995424086'; - const feedId = 'feedId-976011428'; - const feed = {}; - const request = { - parent: parent, - feedId: feedId, - feed: feed, - }; - + const request: protosTypes.google.cloud.asset.v1.ICreateFeedRequest = {}; // Mock response - const name = 'name3373707'; - const expectedResponse = { - name: name, - }; - - // Mock Grpc layer + const expectedResponse = {}; + // Mock gRPC layer client._innerApiCalls.createFeed = mockSimpleGrpcMethod( request, - expectedResponse + expectedResponse, + null ); - - client.createFeed(request, (err, response) => { + client.createFeed(request, (err: {}, response: {}) => { assert.ifError(err); assert.deepStrictEqual(response, expectedResponse); done(); @@ -246,63 +172,45 @@ describe('AssetServiceClient', () => { }); it('invokes createFeed with error', done => { - const client = new assetModule.v1p2beta1.AssetServiceClient({ + const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const parent = 'parent-995424086'; - const feedId = 'feedId-976011428'; - const feed = {}; - const request = { - parent: parent, - feedId: feedId, - feed: feed, - }; - - // Mock Grpc layer + const request: protosTypes.google.cloud.asset.v1.ICreateFeedRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer client._innerApiCalls.createFeed = mockSimpleGrpcMethod( request, null, error ); - - client.createFeed(request, (err, response) => { - assert(err instanceof Error); + client.createFeed(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); assert.strictEqual(err.code, FAKE_STATUS_CODE); assert(typeof response === 'undefined'); done(); }); }); }); - describe('getFeed', () => { it('invokes getFeed without error', done => { - const client = new assetModule.v1p2beta1.AssetServiceClient({ + const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedName = client.feedPath('[PROJECT]', '[FEED]'); - const request = { - name: formattedName, - }; - + const request: protosTypes.google.cloud.asset.v1.IGetFeedRequest = {}; // Mock response - const name2 = 'name2-1052831874'; - const expectedResponse = { - name: name2, - }; - - // Mock Grpc layer + const expectedResponse = {}; + // Mock gRPC layer client._innerApiCalls.getFeed = mockSimpleGrpcMethod( request, - expectedResponse + expectedResponse, + null ); - - client.getFeed(request, (err, response) => { + client.getFeed(request, (err: {}, response: {}) => { assert.ifError(err); assert.deepStrictEqual(response, expectedResponse); done(); @@ -310,56 +218,45 @@ describe('AssetServiceClient', () => { }); it('invokes getFeed with error', done => { - const client = new assetModule.v1p2beta1.AssetServiceClient({ + const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedName = client.feedPath('[PROJECT]', '[FEED]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer + const request: protosTypes.google.cloud.asset.v1.IGetFeedRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer client._innerApiCalls.getFeed = mockSimpleGrpcMethod( request, null, error ); - - client.getFeed(request, (err, response) => { - assert(err instanceof Error); + client.getFeed(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); assert.strictEqual(err.code, FAKE_STATUS_CODE); assert(typeof response === 'undefined'); done(); }); }); }); - describe('listFeeds', () => { it('invokes listFeeds without error', done => { - const client = new assetModule.v1p2beta1.AssetServiceClient({ + const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const parent = 'parent-995424086'; - const request = { - parent: parent, - }; - + const request: protosTypes.google.cloud.asset.v1.IListFeedsRequest = {}; // Mock response const expectedResponse = {}; - - // Mock Grpc layer + // Mock gRPC layer client._innerApiCalls.listFeeds = mockSimpleGrpcMethod( request, - expectedResponse + expectedResponse, + null ); - - client.listFeeds(request, (err, response) => { + client.listFeeds(request, (err: {}, response: {}) => { assert.ifError(err); assert.deepStrictEqual(response, expectedResponse); done(); @@ -367,61 +264,47 @@ describe('AssetServiceClient', () => { }); it('invokes listFeeds with error', done => { - const client = new assetModule.v1p2beta1.AssetServiceClient({ + const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const parent = 'parent-995424086'; - const request = { - parent: parent, - }; - - // Mock Grpc layer + const request: protosTypes.google.cloud.asset.v1.IListFeedsRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer client._innerApiCalls.listFeeds = mockSimpleGrpcMethod( request, null, error ); - - client.listFeeds(request, (err, response) => { - assert(err instanceof Error); + client.listFeeds(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); assert.strictEqual(err.code, FAKE_STATUS_CODE); assert(typeof response === 'undefined'); done(); }); }); }); - describe('updateFeed', () => { it('invokes updateFeed without error', done => { - const client = new assetModule.v1p2beta1.AssetServiceClient({ + const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const feed = {}; - const updateMask = {}; - const request = { - feed: feed, - updateMask: updateMask, - }; - + const request: protosTypes.google.cloud.asset.v1.IUpdateFeedRequest = {}; + request.feed = {}; + request.feed.name = ''; // Mock response - const name = 'name3373707'; - const expectedResponse = { - name: name, - }; - - // Mock Grpc layer + const expectedResponse = {}; + // Mock gRPC layer client._innerApiCalls.updateFeed = mockSimpleGrpcMethod( request, - expectedResponse + expectedResponse, + null ); - - client.updateFeed(request, (err, response) => { + client.updateFeed(request, (err: {}, response: {}) => { assert.ifError(err); assert.deepStrictEqual(response, expectedResponse); done(); @@ -429,112 +312,135 @@ describe('AssetServiceClient', () => { }); it('invokes updateFeed with error', done => { - const client = new assetModule.v1p2beta1.AssetServiceClient({ + const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const feed = {}; - const updateMask = {}; - const request = { - feed: feed, - updateMask: updateMask, - }; - - // Mock Grpc layer + const request: protosTypes.google.cloud.asset.v1.IUpdateFeedRequest = {}; + request.feed = {}; + request.feed.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer client._innerApiCalls.updateFeed = mockSimpleGrpcMethod( request, null, error ); - - client.updateFeed(request, (err, response) => { - assert(err instanceof Error); + client.updateFeed(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); assert.strictEqual(err.code, FAKE_STATUS_CODE); assert(typeof response === 'undefined'); done(); }); }); }); - describe('deleteFeed', () => { it('invokes deleteFeed without error', done => { - const client = new assetModule.v1p2beta1.AssetServiceClient({ + const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedName = client.feedPath('[PROJECT]', '[FEED]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteFeed = mockSimpleGrpcMethod(request); - - client.deleteFeed(request, err => { + const request: protosTypes.google.cloud.asset.v1.IDeleteFeedRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteFeed = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.deleteFeed(request, (err: {}, response: {}) => { assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); done(); }); }); it('invokes deleteFeed with error', done => { - const client = new assetModule.v1p2beta1.AssetServiceClient({ + const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedName = client.feedPath('[PROJECT]', '[FEED]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer + const request: protosTypes.google.cloud.asset.v1.IDeleteFeedRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer client._innerApiCalls.deleteFeed = mockSimpleGrpcMethod( request, null, error ); - - client.deleteFeed(request, err => { - assert(err instanceof Error); + client.deleteFeed(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); done(); }); }); }); -}); - -function mockSimpleGrpcMethod(expectedRequest, response, error) { - return function(actualRequest, options, callback) { - assert.deepStrictEqual(actualRequest, expectedRequest); - if (error) { - callback(error); - } else if (response) { - callback(null, response); - } else { - callback(null); - } - }; -} + describe('exportAssets', () => { + it('invokes exportAssets without error', done => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1.IExportAssetsRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.exportAssets = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + client + .exportAssets(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then((responses: [Operation]) => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch((err: {}) => { + done(err); + }); + }); -function mockLongRunningGrpcMethod(expectedRequest, response, error) { - return request => { - assert.deepStrictEqual(request, expectedRequest); - const mockOperation = { - promise: function() { - return new Promise((resolve, reject) => { - if (error) { - reject(error); - } else { - resolve([response]); - } + it('invokes exportAssets with error', done => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1.IExportAssetsRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.exportAssets = mockLongRunningGrpcMethod( + request, + null, + error + ); + client + .exportAssets(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then(() => { + assert.fail(); + }) + .catch((err: FakeError) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); }); - }, - }; - return Promise.resolve([mockOperation]); - }; -} + }); + }); +}); diff --git a/packages/google-cloud-asset/test/gapic-v1beta1.js b/packages/google-cloud-asset/test/gapic-asset_service-v1beta1.ts similarity index 52% rename from packages/google-cloud-asset/test/gapic-v1beta1.js rename to packages/google-cloud-asset/test/gapic-asset_service-v1beta1.ts index a06ab6d3ebc..a403153c98c 100644 --- a/packages/google-cloud-asset/test/gapic-v1beta1.js +++ b/packages/google-cloud-asset/test/gapic-asset_service-v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,230 +11,204 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** -'use strict'; - -const assert = require('assert'); -const {describe, it} = require('mocha'); - -const assetModule = require('../src'); +import * as protosTypes from '../protos/protos'; +import * as assert from 'assert'; +import {describe, it} from 'mocha'; +const assetserviceModule = require('../src'); const FAKE_STATUS_CODE = 1; -const error = new Error(); -error.code = FAKE_STATUS_CODE; +class FakeError { + name: string; + message: string; + code: number; + constructor(n: number) { + this.name = 'fakeName'; + this.message = 'fake message'; + this.code = n; + } +} +const error = new FakeError(FAKE_STATUS_CODE); +export interface Callback { + (err: FakeError | null, response?: {} | null): void; +} -describe('AssetServiceClient', () => { +export class Operation { + constructor() {} + promise() {} +} +function mockSimpleGrpcMethod( + expectedRequest: {}, + response: {} | null, + error: FakeError | null +) { + return (actualRequest: {}, options: {}, callback: Callback) => { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} +function mockLongRunningGrpcMethod( + expectedRequest: {}, + response: {} | null, + error?: {} | null +) { + return (request: {}) => { + assert.deepStrictEqual(request, expectedRequest); + const mockOperation = { + promise() { + return new Promise((resolve, reject) => { + if (error) { + reject(error); + } else { + resolve([response]); + } + }); + }, + }; + return Promise.resolve([mockOperation]); + }; +} +describe('v1beta1.AssetServiceClient', () => { it('has servicePath', () => { - const servicePath = assetModule.v1beta1.AssetServiceClient.servicePath; + const servicePath = + assetserviceModule.v1beta1.AssetServiceClient.servicePath; assert(servicePath); }); - it('has apiEndpoint', () => { - const apiEndpoint = assetModule.v1beta1.AssetServiceClient.apiEndpoint; + const apiEndpoint = + assetserviceModule.v1beta1.AssetServiceClient.apiEndpoint; assert(apiEndpoint); }); - it('has port', () => { - const port = assetModule.v1beta1.AssetServiceClient.port; + const port = assetserviceModule.v1beta1.AssetServiceClient.port; assert(port); assert(typeof port === 'number'); }); - - it('should create a client with no options', () => { - const client = new assetModule.v1beta1.AssetServiceClient(); + it('should create a client with no option', () => { + const client = new assetserviceModule.v1beta1.AssetServiceClient(); assert(client); }); - it('should create a client with gRPC fallback', () => { - const client = new assetModule.v1beta1.AssetServiceClient({fallback: true}); + const client = new assetserviceModule.v1beta1.AssetServiceClient({ + fallback: true, + }); assert(client); }); + describe('batchGetAssetsHistory', () => { + it('invokes batchGetAssetsHistory without error', done => { + const client = new assetserviceModule.v1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.batchGetAssetsHistory = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.batchGetAssetsHistory(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); - describe('exportAssets', function() { + it('invokes batchGetAssetsHistory with error', done => { + const client = new assetserviceModule.v1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.batchGetAssetsHistory = mockSimpleGrpcMethod( + request, + null, + error + ); + client.batchGetAssetsHistory(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('exportAssets', () => { it('invokes exportAssets without error', done => { - const client = new assetModule.v1beta1.AssetServiceClient({ + const client = new assetserviceModule.v1beta1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const outputConfig = {}; - const request = { - parent: formattedParent, - outputConfig: outputConfig, - }; - + const request: protosTypes.google.cloud.asset.v1beta1.IExportAssetsRequest = {}; // Mock response const expectedResponse = {}; - - // Mock Grpc layer + // Mock gRPC layer client._innerApiCalls.exportAssets = mockLongRunningGrpcMethod( request, expectedResponse ); - client .exportAssets(request) - .then(responses => { + .then((responses: [Operation]) => { const operation = responses[0]; - return operation.promise(); + return operation ? operation.promise() : {}; }) - .then(responses => { + .then((responses: [Operation]) => { assert.deepStrictEqual(responses[0], expectedResponse); done(); }) - .catch(err => { + .catch((err: {}) => { done(err); }); }); it('invokes exportAssets with error', done => { - const client = new assetModule.v1beta1.AssetServiceClient({ + const client = new assetserviceModule.v1beta1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const outputConfig = {}; - const request = { - parent: formattedParent, - outputConfig: outputConfig, - }; - - // Mock Grpc layer + const request: protosTypes.google.cloud.asset.v1beta1.IExportAssetsRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer client._innerApiCalls.exportAssets = mockLongRunningGrpcMethod( request, null, error ); - client .exportAssets(request) - .then(responses => { + .then((responses: [Operation]) => { const operation = responses[0]; - return operation.promise(); + return operation ? operation.promise() : {}; }) .then(() => { assert.fail(); }) - .catch(err => { - assert(err instanceof Error); + .catch((err: FakeError) => { + assert(err instanceof FakeError); assert.strictEqual(err.code, FAKE_STATUS_CODE); done(); }); }); - - it('has longrunning decoder functions', () => { - const client = new assetModule.v1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert( - client._descriptors.longrunning.exportAssets.responseDecoder instanceof - Function - ); - assert( - client._descriptors.longrunning.exportAssets.metadataDecoder instanceof - Function - ); - }); - }); - - describe('batchGetAssetsHistory', () => { - it('invokes batchGetAssetsHistory without error', done => { - const client = new assetModule.v1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const contentType = 'CONTENT_TYPE_UNSPECIFIED'; - const readTimeWindow = {}; - const request = { - parent: formattedParent, - contentType: contentType, - readTimeWindow: readTimeWindow, - }; - - // Mock response - const expectedResponse = {}; - - // Mock Grpc layer - client._innerApiCalls.batchGetAssetsHistory = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.batchGetAssetsHistory(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes batchGetAssetsHistory with error', done => { - const client = new assetModule.v1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const contentType = 'CONTENT_TYPE_UNSPECIFIED'; - const readTimeWindow = {}; - const request = { - parent: formattedParent, - contentType: contentType, - readTimeWindow: readTimeWindow, - }; - - // Mock Grpc layer - client._innerApiCalls.batchGetAssetsHistory = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.batchGetAssetsHistory(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); }); }); - -function mockSimpleGrpcMethod(expectedRequest, response, error) { - return function(actualRequest, options, callback) { - assert.deepStrictEqual(actualRequest, expectedRequest); - if (error) { - callback(error); - } else if (response) { - callback(null, response); - } else { - callback(null); - } - }; -} - -function mockLongRunningGrpcMethod(expectedRequest, response, error) { - return request => { - assert.deepStrictEqual(request, expectedRequest); - const mockOperation = { - promise: function() { - return new Promise((resolve, reject) => { - if (error) { - reject(error); - } else { - resolve([response]); - } - }); - }, - }; - return Promise.resolve([mockOperation]); - }; -} diff --git a/packages/google-cloud-asset/test/gapic-asset_service-v1p1beta1.ts b/packages/google-cloud-asset/test/gapic-asset_service-v1p1beta1.ts new file mode 100644 index 00000000000..1c0bf79c478 --- /dev/null +++ b/packages/google-cloud-asset/test/gapic-asset_service-v1p1beta1.ts @@ -0,0 +1,298 @@ +// Copyright 2019 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 protosTypes from '../protos/protos'; +import * as assert from 'assert'; +import {describe, it} from 'mocha'; +const assetserviceModule = require('../src'); + +const FAKE_STATUS_CODE = 1; +class FakeError { + name: string; + message: string; + code: number; + constructor(n: number) { + this.name = 'fakeName'; + this.message = 'fake message'; + this.code = n; + } +} +const error = new FakeError(FAKE_STATUS_CODE); +export interface Callback { + (err: FakeError | null, response?: {} | null): void; +} + +export class Operation { + constructor() {} + promise() {} +} +describe('v1p1beta1.AssetServiceClient', () => { + it('has servicePath', () => { + const servicePath = + assetserviceModule.v1p1beta1.AssetServiceClient.servicePath; + assert(servicePath); + }); + it('has apiEndpoint', () => { + const apiEndpoint = + assetserviceModule.v1p1beta1.AssetServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + it('has port', () => { + const port = assetserviceModule.v1p1beta1.AssetServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + it('should create a client with no option', () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient(); + assert(client); + }); + it('should create a client with gRPC fallback', () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + fallback: true, + }); + assert(client); + }); + describe('searchResources', () => { + it('invokes searchResources without error', done => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.searchResources = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.searchResources(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('searchResourcesStream', () => { + it('invokes searchResourcesStream without error', done => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.searchResources = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .searchResourcesStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(request); + }); + }); + describe('searchIamPolicies', () => { + it('invokes searchIamPolicies without error', done => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.searchIamPolicies = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.searchIamPolicies(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('searchIamPoliciesStream', () => { + it('invokes searchIamPoliciesStream without error', done => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.searchIamPolicies = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .searchIamPoliciesStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(request); + }); + }); + describe('searchAllResources', () => { + it('invokes searchAllResources without error', done => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.searchAllResources = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.searchAllResources(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('searchAllResourcesStream', () => { + it('invokes searchAllResourcesStream without error', done => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.searchAllResources = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .searchAllResourcesStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(request); + }); + }); + describe('searchAllIamPolicies', () => { + it('invokes searchAllIamPolicies without error', done => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.searchAllIamPolicies = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.searchAllIamPolicies(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('searchAllIamPoliciesStream', () => { + it('invokes searchAllIamPoliciesStream without error', done => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.searchAllIamPolicies = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .searchAllIamPoliciesStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(request); + }); + }); +}); diff --git a/packages/google-cloud-asset/test/gapic-asset_service-v1p2beta1.ts b/packages/google-cloud-asset/test/gapic-asset_service-v1p2beta1.ts new file mode 100644 index 00000000000..98e7b145c75 --- /dev/null +++ b/packages/google-cloud-asset/test/gapic-asset_service-v1p2beta1.ts @@ -0,0 +1,320 @@ +// Copyright 2019 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 protosTypes from '../protos/protos'; +import * as assert from 'assert'; +import {describe, it} from 'mocha'; +const assetserviceModule = require('../src'); + +const FAKE_STATUS_CODE = 1; +class FakeError { + name: string; + message: string; + code: number; + constructor(n: number) { + this.name = 'fakeName'; + this.message = 'fake message'; + this.code = n; + } +} +const error = new FakeError(FAKE_STATUS_CODE); +export interface Callback { + (err: FakeError | null, response?: {} | null): void; +} + +export class Operation { + constructor() {} + promise() {} +} +function mockSimpleGrpcMethod( + expectedRequest: {}, + response: {} | null, + error: FakeError | null +) { + return (actualRequest: {}, options: {}, callback: Callback) => { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} +describe('v1p2beta1.AssetServiceClient', () => { + it('has servicePath', () => { + const servicePath = + assetserviceModule.v1p2beta1.AssetServiceClient.servicePath; + assert(servicePath); + }); + it('has apiEndpoint', () => { + const apiEndpoint = + assetserviceModule.v1p2beta1.AssetServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + it('has port', () => { + const port = assetserviceModule.v1p2beta1.AssetServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + it('should create a client with no option', () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient(); + assert(client); + }); + it('should create a client with gRPC fallback', () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + fallback: true, + }); + assert(client); + }); + describe('createFeed', () => { + it('invokes createFeed without error', done => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1p2beta1.ICreateFeedRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createFeed = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.createFeed(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createFeed with error', done => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1p2beta1.ICreateFeedRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createFeed = mockSimpleGrpcMethod( + request, + null, + error + ); + client.createFeed(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('getFeed', () => { + it('invokes getFeed without error', done => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1p2beta1.IGetFeedRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getFeed = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getFeed(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getFeed with error', done => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1p2beta1.IGetFeedRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getFeed = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getFeed(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('listFeeds', () => { + it('invokes listFeeds without error', done => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1p2beta1.IListFeedsRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.listFeeds = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.listFeeds(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes listFeeds with error', done => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1p2beta1.IListFeedsRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.listFeeds = mockSimpleGrpcMethod( + request, + null, + error + ); + client.listFeeds(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('updateFeed', () => { + it('invokes updateFeed without error', done => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1p2beta1.IUpdateFeedRequest = {}; + request.feed = {}; + request.feed.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateFeed = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.updateFeed(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes updateFeed with error', done => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1p2beta1.IUpdateFeedRequest = {}; + request.feed = {}; + request.feed.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateFeed = mockSimpleGrpcMethod( + request, + null, + error + ); + client.updateFeed(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('deleteFeed', () => { + it('invokes deleteFeed without error', done => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1p2beta1.IDeleteFeedRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteFeed = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.deleteFeed(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes deleteFeed with error', done => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.asset.v1p2beta1.IDeleteFeedRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteFeed = mockSimpleGrpcMethod( + request, + null, + error + ); + client.deleteFeed(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); +}); diff --git a/packages/google-cloud-asset/test/gapic-v1.js b/packages/google-cloud-asset/test/gapic-v1.js deleted file mode 100644 index 38624f8f70c..00000000000 --- a/packages/google-cloud-asset/test/gapic-v1.js +++ /dev/null @@ -1,538 +0,0 @@ -// Copyright 2020 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. - -'use strict'; - -const assert = require('assert'); -const {describe, it} = require('mocha'); - -const assetModule = require('../src'); - -const FAKE_STATUS_CODE = 1; -const error = new Error(); -error.code = FAKE_STATUS_CODE; - -describe('AssetServiceClient', () => { - it('has servicePath', () => { - const servicePath = assetModule.v1.AssetServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = assetModule.v1.AssetServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = assetModule.v1.AssetServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no options', () => { - const client = new assetModule.v1.AssetServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new assetModule.v1.AssetServiceClient({fallback: true}); - assert(client); - }); - - describe('exportAssets', function() { - it('invokes exportAssets without error', done => { - const client = new assetModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const parent = 'parent-995424086'; - const outputConfig = {}; - const request = { - parent: parent, - outputConfig: outputConfig, - }; - - // Mock response - const expectedResponse = {}; - - // Mock Grpc layer - client._innerApiCalls.exportAssets = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - - client - .exportAssets(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(responses => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch(err => { - done(err); - }); - }); - - it('invokes exportAssets with error', done => { - const client = new assetModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const parent = 'parent-995424086'; - const outputConfig = {}; - const request = { - parent: parent, - outputConfig: outputConfig, - }; - - // Mock Grpc layer - client._innerApiCalls.exportAssets = mockLongRunningGrpcMethod( - request, - null, - error - ); - - client - .exportAssets(request) - .then(responses => { - const operation = responses[0]; - return operation.promise(); - }) - .then(() => { - assert.fail(); - }) - .catch(err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - - it('has longrunning decoder functions', () => { - const client = new assetModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert( - client._descriptors.longrunning.exportAssets.responseDecoder instanceof - Function - ); - assert( - client._descriptors.longrunning.exportAssets.metadataDecoder instanceof - Function - ); - }); - }); - - describe('batchGetAssetsHistory', () => { - it('invokes batchGetAssetsHistory without error', done => { - const client = new assetModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const parent = 'parent-995424086'; - const contentType = 'CONTENT_TYPE_UNSPECIFIED'; - const readTimeWindow = {}; - const request = { - parent: parent, - contentType: contentType, - readTimeWindow: readTimeWindow, - }; - - // Mock response - const expectedResponse = {}; - - // Mock Grpc layer - client._innerApiCalls.batchGetAssetsHistory = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.batchGetAssetsHistory(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes batchGetAssetsHistory with error', done => { - const client = new assetModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const parent = 'parent-995424086'; - const contentType = 'CONTENT_TYPE_UNSPECIFIED'; - const readTimeWindow = {}; - const request = { - parent: parent, - contentType: contentType, - readTimeWindow: readTimeWindow, - }; - - // Mock Grpc layer - client._innerApiCalls.batchGetAssetsHistory = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.batchGetAssetsHistory(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('createFeed', () => { - it('invokes createFeed without error', done => { - const client = new assetModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const parent = 'parent-995424086'; - const feedId = 'feedId-976011428'; - const feed = {}; - const request = { - parent: parent, - feedId: feedId, - feed: feed, - }; - - // Mock response - const name = 'name3373707'; - const expectedResponse = { - name: name, - }; - - // Mock Grpc layer - client._innerApiCalls.createFeed = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.createFeed(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createFeed with error', done => { - const client = new assetModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const parent = 'parent-995424086'; - const feedId = 'feedId-976011428'; - const feed = {}; - const request = { - parent: parent, - feedId: feedId, - feed: feed, - }; - - // Mock Grpc layer - client._innerApiCalls.createFeed = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.createFeed(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('getFeed', () => { - it('invokes getFeed without error', done => { - const client = new assetModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.feedPath('[PROJECT]', '[FEED]'); - const request = { - name: formattedName, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const expectedResponse = { - name: name2, - }; - - // Mock Grpc layer - client._innerApiCalls.getFeed = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getFeed(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getFeed with error', done => { - const client = new assetModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.feedPath('[PROJECT]', '[FEED]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.getFeed = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getFeed(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('listFeeds', () => { - it('invokes listFeeds without error', done => { - const client = new assetModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const parent = 'parent-995424086'; - const request = { - parent: parent, - }; - - // Mock response - const expectedResponse = {}; - - // Mock Grpc layer - client._innerApiCalls.listFeeds = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.listFeeds(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes listFeeds with error', done => { - const client = new assetModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const parent = 'parent-995424086'; - const request = { - parent: parent, - }; - - // Mock Grpc layer - client._innerApiCalls.listFeeds = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listFeeds(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('updateFeed', () => { - it('invokes updateFeed without error', done => { - const client = new assetModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const feed = {}; - const updateMask = {}; - const request = { - feed: feed, - updateMask: updateMask, - }; - - // Mock response - const name = 'name3373707'; - const expectedResponse = { - name: name, - }; - - // Mock Grpc layer - client._innerApiCalls.updateFeed = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.updateFeed(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateFeed with error', done => { - const client = new assetModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const feed = {}; - const updateMask = {}; - const request = { - feed: feed, - updateMask: updateMask, - }; - - // Mock Grpc layer - client._innerApiCalls.updateFeed = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.updateFeed(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('deleteFeed', () => { - it('invokes deleteFeed without error', done => { - const client = new assetModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.feedPath('[PROJECT]', '[FEED]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteFeed = mockSimpleGrpcMethod(request); - - client.deleteFeed(request, err => { - assert.ifError(err); - done(); - }); - }); - - it('invokes deleteFeed with error', done => { - const client = new assetModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.feedPath('[PROJECT]', '[FEED]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteFeed = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.deleteFeed(request, err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); -}); - -function mockSimpleGrpcMethod(expectedRequest, response, error) { - return function(actualRequest, options, callback) { - assert.deepStrictEqual(actualRequest, expectedRequest); - if (error) { - callback(error); - } else if (response) { - callback(null, response); - } else { - callback(null); - } - }; -} - -function mockLongRunningGrpcMethod(expectedRequest, response, error) { - return request => { - assert.deepStrictEqual(request, expectedRequest); - const mockOperation = { - promise: function() { - return new Promise((resolve, reject) => { - if (error) { - reject(error); - } else { - resolve([response]); - } - }); - }, - }; - return Promise.resolve([mockOperation]); - }; -} diff --git a/packages/google-cloud-asset/tsconfig.json b/packages/google-cloud-asset/tsconfig.json new file mode 100644 index 00000000000..613d35597b5 --- /dev/null +++ b/packages/google-cloud-asset/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2016", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/packages/google-cloud-asset/tslint.json b/packages/google-cloud-asset/tslint.json new file mode 100644 index 00000000000..617dc975bae --- /dev/null +++ b/packages/google-cloud-asset/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "gts/tslint.json" +} diff --git a/packages/google-cloud-asset/webpack.config.js b/packages/google-cloud-asset/webpack.config.js index 03328fdf838..c49be15531d 100644 --- a/packages/google-cloud-asset/webpack.config.js +++ b/packages/google-cloud-asset/webpack.config.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,11 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. +const path = require('path'); + module.exports = { - entry: './src/browser.js', + entry: './src/index.ts', output: { - library: 'asset', - filename: './asset.js', + library: 'AssetService', + filename: './asset-service.js', }, node: { child_process: 'empty', @@ -24,21 +26,37 @@ module.exports = { crypto: 'empty', }, resolve: { - extensions: ['.js', '.json'], + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], }, module: { rules: [ { - test: /node_modules[\\/]retry-request[\\/]/, - use: 'null-loader', + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' }, { - test: /node_modules[\\/]https-proxy-agent[\\/]/, - use: 'null-loader', + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' }, { - test: /node_modules[\\/]gtoken[\\/]/, - use: 'null-loader', + test: /node_modules[\\/]gtoken/, + use: 'null-loader' }, ], },