From 42b9d2c4b467c73560173484cb1cb5642348054b Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 14 Aug 2020 09:15:13 -0700 Subject: [PATCH] feat: added support OutputResult in ExportAssetsResponse. docs: updated existing docs. (#381) Clients receive detailed OutputResult in ExportAssetsResponse. PiperOrigin-RevId: 326582222 Source-Author: Google APIs Source-Date: Thu Aug 13 20:45:57 2020 -0700 Source-Repo: googleapis/googleapis Source-Sha: 3a54e988edcbdef1e47c6ac19d3074a87214f667 Source-Link: https://github.com/googleapis/googleapis/commit/3a54e988edcbdef1e47c6ac19d3074a87214f667 --- .../google/cloud/asset/v1/asset_service.proto | 284 +++++---- .../protos/google/cloud/asset/v1/assets.proto | 65 ++- .../google-cloud-asset/protos/protos.d.ts | 189 ++++++ packages/google-cloud-asset/protos/protos.js | 441 ++++++++++++++ .../google-cloud-asset/protos/protos.json | 28 + .../src/v1/asset_service_client.ts | 547 ++++++++++-------- packages/google-cloud-asset/synth.metadata | 6 +- 7 files changed, 1163 insertions(+), 397 deletions(-) diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto index db3ca4123df..4aa3ee74ee2 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto @@ -38,20 +38,18 @@ option php_namespace = "Google\\Cloud\\Asset\\V1"; // 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"; + 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/BigQuery table. For Cloud Storage location destinations, the // output format is newline-delimited JSON. Each line represents a - // [google.cloud.asset.v1.Asset][google.cloud.asset.v1.Asset] in the JSON - // format; for BigQuery table destinations, the output table stores the fields - // in asset proto as columns. This API implements the - // [google.longrunning.Operation][google.longrunning.Operation] API , which - // allows you to keep track of the export. We recommend intervals of at least - // 2 seconds with exponential retry to poll the export operation result. For - // regular-size resource parent, the export operation usually finishes within - // 5 minutes. + // [google.cloud.asset.v1.Asset][google.cloud.asset.v1.Asset] in the JSON format; for BigQuery table + // destinations, the output table stores the fields in asset proto as columns. + // This API implements the [google.longrunning.Operation][google.longrunning.Operation] API + // , which allows you to keep track of the export. We recommend intervals of + // at least 2 seconds with exponential retry to poll the export operation + // result. For regular-size resource parent, the export operation usually + // finishes within 5 minutes. rpc ExportAssets(ExportAssetsRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=*/*}:exportAssets" @@ -70,8 +68,7 @@ service AssetService { // deleted status. // If a specified asset does not exist, this API returns an INVALID_ARGUMENT // error. - rpc BatchGetAssetsHistory(BatchGetAssetsHistoryRequest) - returns (BatchGetAssetsHistoryResponse) { + rpc BatchGetAssetsHistory(BatchGetAssetsHistoryRequest) returns (BatchGetAssetsHistoryResponse) { option (google.api.http) = { get: "/v1/{parent=*/*}:batchGetAssetsHistory" }; @@ -120,24 +117,22 @@ service AssetService { option (google.api.method_signature) = "name"; } - // Searches all the resources within the given accessible scope (e.g., a - // project, a folder or an organization). Callers should have - // cloud.assets.SearchAllResources permission upon the requested scope, + // Searches all Cloud resources within the specified scope, such as a project, + // folder, or organization. The caller must be granted the + // `cloudasset.assets.searchAllResources` permission on the desired scope, // otherwise the request will be rejected. - rpc SearchAllResources(SearchAllResourcesRequest) - returns (SearchAllResourcesResponse) { + rpc SearchAllResources(SearchAllResourcesRequest) returns (SearchAllResourcesResponse) { option (google.api.http) = { get: "/v1/{scope=*/*}:searchAllResources" }; option (google.api.method_signature) = "scope,query,asset_types"; } - // Searches all the IAM policies within the given accessible scope (e.g., a - // project, a folder or an organization). Callers should have - // cloud.assets.SearchAllIamPolicies permission upon the requested scope, + // Searches all IAM policies within the specified scope, such as a project, + // folder, or organization. The caller must be granted the + // `cloudasset.assets.searchAllIamPolicies` permission on the desired scope, // otherwise the request will be rejected. - rpc SearchAllIamPolicies(SearchAllIamPoliciesRequest) - returns (SearchAllIamPoliciesResponse) { + rpc SearchAllIamPolicies(SearchAllIamPoliciesRequest) returns (SearchAllIamPoliciesResponse) { option (google.api.http) = { get: "/v1/{scope=*/*}:searchAllIamPolicies" }; @@ -165,9 +160,22 @@ message ExportAssetsRequest { // 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. Example: - // "compute.googleapis.com/Disk". If specified, only matching assets will be - // returned. See [Introduction to Cloud Asset + // A list of asset types to take a snapshot for. For example: + // "compute.googleapis.com/Disk". + // + // Regular expressions are also supported. For example: + // + // * "compute.googleapis.com.*" snapshots resources whose asset type starts + // with "compute.googleapis.com". + // * ".*Instance" snapshots resources whose asset type ends with "Instance". + // * ".*Instance.*" snapshots resources whose asset type contains "Instance". + // + // See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + // regular expression syntax. If the regular expression does not match any + // supported asset type, an INVALID_ARGUMENT error will be returned. + // + // If specified, only matching assets will be returned, otherwise, it will + // snapshot all asset types. See [Introduction to Cloud Asset // Inventory](https://cloud.google.com/asset-inventory/docs/overview) // for all supported asset types. repeated string asset_types = 3; @@ -176,22 +184,26 @@ message ExportAssetsRequest { // returned. ContentType content_type = 4; - // Required. Output configuration indicating where the results will be output - // to. + // Required. Output configuration indicating where the results will be output to. OutputConfig output_config = 5 [(google.api.field_behavior) = REQUIRED]; } // 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. +// [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. OutputConfig output_config = 2; + + // Output result indicating where the assets were exported to. For example, a + // set of actual Google Cloud Storage object uris where the assets are + // exported to. The uris can be different from what [output_config] has + // specified, as the service will split the output object into multiple ones + // once it exceeds a single Google Cloud Storage object limit. + OutputResult output_result = 3; } // Batch get assets history request. @@ -247,8 +259,9 @@ message CreateFeedRequest { // be unique under a specific parent project/folder/organization. string feed_id = 2 [(google.api.field_behavior) = REQUIRED]; - // 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 + // 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 [(google.api.field_behavior) = REQUIRED]; @@ -262,7 +275,9 @@ message GetFeedRequest { // organizations/organization_number/feeds/feed_id string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "cloudasset.googleapis.com/Feed" } + (google.api.resource_reference) = { + type: "cloudasset.googleapis.com/Feed" + } ]; } @@ -281,8 +296,8 @@ message ListFeedsResponse { // Update asset feed request. message UpdateFeedRequest { - // Required. The new values of feed details. It must match an existing feed - // and the field `name` must be in the format of: + // 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. @@ -291,8 +306,7 @@ message UpdateFeedRequest { // 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.api.field_behavior) = REQUIRED]; + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; } message DeleteFeedRequest { @@ -302,7 +316,9 @@ message DeleteFeedRequest { // organizations/organization_number/feeds/feed_id string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "cloudasset.googleapis.com/Feed" } + (google.api.resource_reference) = { + type: "cloudasset.googleapis.com/Feed" + } ]; } @@ -319,6 +335,22 @@ message OutputConfig { } } +// Output result of export assets. +message OutputResult { + // Asset export result. + oneof result { + // Export result on Cloud Storage. + GcsOutputResult gcs_result = 1; + } +} + +// A Cloud Storage output result. +message GcsOutputResult { + // List of uris of the Cloud Storage objects. Example: + // "gs://bucket_name/object_name". + repeated string uris = 1; +} + // A Cloud Storage location. message GcsDestination { // Required. @@ -428,8 +460,7 @@ message Feed { // Required. Feed output configuration defining where the asset updates are // published to. - FeedOutputConfig feed_output_config = 5 - [(google.api.field_behavior) = REQUIRED]; + FeedOutputConfig feed_output_config = 5 [(google.api.field_behavior) = REQUIRED]; // A condition which determines whether an asset update should be published. // If specified, an asset will be returned only when the expression evaluates @@ -437,82 +468,92 @@ message Feed { // When set, `expression` field in the `Expr` must be a valid [CEL expression] // (https://github.com/google/cel-spec) on a TemporalAsset with name // `temporal_asset`. Example: a Feed with expression ("temporal_asset.deleted - // == true") will only publish Asset deletions. Other fields in `Expr` are + // == true") will only publish Asset deletions. Other fields of `Expr` are // optional. + // + // See our [user + // guide](https://cloud.google.com/asset-inventory/docs/monitoring-asset-changes#feed_with_condition) + // for detailed instructions. google.type.Expr condition = 6; } // Search all resources request. message SearchAllResourcesRequest { - // Required. A scope can be a project, a folder or an organization. The search - // is limited to the resources within the `scope`. + // Required. A scope can be a project, a folder, or an organization. The search is + // limited to the resources within the `scope`. The caller must be granted the + // [`cloudasset.assets.searchAllResources`](http://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + // permission on the desired scope. // // The allowed values are: // - // * projects/{PROJECT_ID} - // * projects/{PROJECT_NUMBER} - // * folders/{FOLDER_NUMBER} - // * organizations/{ORGANIZATION_NUMBER} + // * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + // * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + // * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + // * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") string scope = 1 [(google.api.field_behavior) = REQUIRED]; - // Optional. The query statement. An empty query can be specified to search - // all the resources of certain `asset_types` within the given `scope`. + // Optional. The query statement. See [how to construct a + // query](http://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) + // for more information. If not specified or empty, it will search all the + // resources within the specified `scope`. Note that the query string is + // compared against each Cloud IAM policy binding, including its members, + // roles, and Cloud IAM conditions. The returned Cloud IAM policies will only + // contain the bindings that match your query. To learn more about the IAM + // policy structure, see [IAM policy + // doc](https://cloud.google.com/iam/docs/policies#structure). // // Examples: // - // * `name : "Important"` to find Cloud resources whose name contains + // * `name:Important` to find Cloud resources whose name contains // "Important" as a word. - // * `displayName : "Impor*"` to find Cloud resources whose display name - // contains "Impor" as a word prefix. - // * `description : "*por*"` to find Cloud resources whose description + // * `displayName:Impor*` to find Cloud resources whose display name + // contains "Impor" as a prefix. + // * `description:*por*` to find Cloud resources whose description // contains "por" as a substring. - // * `location : "us-west*"` to find Cloud resources whose location is + // * `location:us-west*` to find Cloud resources whose location is // prefixed with "us-west". - // * `labels : "prod"` to find Cloud resources whose labels contain "prod" as + // * `labels:prod` to find Cloud resources whose labels contain "prod" as // a key or value. - // * `labels.env : "prod"` to find Cloud resources which have a label "env" + // * `labels.env:prod` to find Cloud resources that have a label "env" // and its value is "prod". - // * `labels.env : *` to find Cloud resources which have a label "env". - // * `"Important"` to find Cloud resources which contain "Important" as a word + // * `labels.env:*` to find Cloud resources that have a label "env". + // * `Important` to find Cloud resources that contain "Important" as a word // in any of the searchable fields. - // * `"Impor*"` to find Cloud resources which contain "Impor" as a word prefix + // * `Impor*` to find Cloud resources that contain "Impor" as a prefix // in any of the searchable fields. - // * `"*por*"` to find Cloud resources which contain "por" as a substring in + // * `*por*` to find Cloud resources that contain "por" as a substring in // any of the searchable fields. - // * `("Important" AND location : ("us-west1" OR "global"))` to find Cloud - // resources which contain "Important" as a word in any of the searchable + // * `Important location:(us-west1 OR global)` to find Cloud + // resources that contain "Important" as a word in any of the searchable // fields and are also located in the "us-west1" region or the "global" // location. - // - // See [how to construct a - // query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) - // for more details. 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 [searchable asset + // Optional. A list of asset types that this request searches for. If empty, it will + // search all the [searchable asset // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). repeated string asset_types = 3 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The page size for search result pagination. Page size is capped - // at 500 even if a larger value is given. If set to zero, server will pick an - // appropriate default. Returned results may be fewer than requested. When - // this happens, there could be more results as long as `next_page_token` is - // returned. + // Optional. The page size for search result pagination. Page size is capped at 500 even + // if a larger value is given. If set to zero, server will pick an appropriate + // default. Returned results may be fewer than requested. When this happens, + // there could be more results as long as `next_page_token` is returned. 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. + // 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]; - // Optional. A comma separated list of fields specifying the sorting order of - // the results. The default order is ascending. Add " DESC" after the field - // name to indicate descending order. Redundant space characters are ignored. - // Example: "location DESC, name". See [supported resource metadata - // fields](https://cloud.google.com/asset-inventory/docs/searching-resources#query_on_resource_metadata_fields) - // for more details. + // Optional. A comma separated list of fields specifying the sorting order of the + // results. The default order is ascending. Add " DESC" after the field name + // to indicate descending order. Redundant space characters are ignored. + // Example: "location DESC, name". Only string fields in the response are + // sortable, including `name`, `displayName`, `description`, `location`. All + // the other fields such as repeated fields (e.g., `networkTags`), map + // fields (e.g., `labels`) and struct fields (e.g., `additionalAttributes`) + // are not supported. string order_by = 6 [(google.api.field_behavior) = OPTIONAL]; } @@ -530,51 +571,58 @@ message SearchAllResourcesResponse { // Search all IAM policies request. message SearchAllIamPoliciesRequest { - // Required. A scope can be a project, a folder or an organization. The search - // is limited to the IAM policies within the `scope`. + // Required. A scope can be a project, a folder, or an organization. The search is + // limited to the IAM policies within the `scope`. The caller must be granted + // the + // [`cloudasset.assets.searchAllIamPolicies`](http://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + // permission on the desired scope. // // The allowed values are: // - // * projects/{PROJECT_ID} - // * projects/{PROJECT_NUMBER} - // * folders/{FOLDER_NUMBER} - // * organizations/{ORGANIZATION_NUMBER} + // * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + // * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + // * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + // * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") string scope = 1 [(google.api.field_behavior) = REQUIRED]; - // Optional. The query statement. An empty query can be specified to search - // all the IAM policies within the given `scope`. + // Optional. The query statement. See [how to construct a + // query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) + // for more information. If not specified or empty, it will search all the + // IAM policies within the specified `scope`. // // Examples: // - // * `policy : "amy@gmail.com"` to find Cloud IAM policy bindings that - // specify user "amy@gmail.com". - // * `policy : "roles/compute.admin"` to find Cloud IAM policy bindings that - // specify the Compute Admin role. - // * `policy.role.permissions : "storage.buckets.update"` to find Cloud IAM - // policy bindings that specify a role containing "storage.buckets.update" - // permission. - // * `resource : "organizations/123"` to find Cloud IAM policy bindings that - // are set on "organizations/123". - // * `(resource : ("organizations/123" OR "folders/1234") AND policy : "amy")` - // to find Cloud IAM policy bindings that are set on "organizations/123" or - // "folders/1234", and also specify user "amy". - // - // See [how to construct a - // query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) - // for more details. + // * `policy:amy@gmail.com` to find IAM policy bindings that specify user + // "amy@gmail.com". + // * `policy:roles/compute.admin` to find IAM policy bindings that specify + // the Compute Admin role. + // * `policy.role.permissions:storage.buckets.update` to find IAM policy + // bindings that specify a role containing "storage.buckets.update" + // permission. Note that if callers don't have `iam.roles.get` access to a + // role's included permissions, policy bindings that specify this role will + // be dropped from the search results. + // * `resource:organizations/123456` to find IAM policy bindings + // that are set on "organizations/123456". + // * `Important` to find IAM policy bindings that contain "Important" as a + // word in any of the searchable fields (except for the included + // permissions). + // * `*por*` to find IAM policy bindings that contain "por" as a substring + // in any of the searchable fields (except for the included permissions). + // * `resource:(instance1 OR instance2) policy:amy` to find + // IAM policy bindings that are set on resources "instance1" or + // "instance2" and also specify user "amy". string query = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The page size for search result pagination. Page size is capped - // at 500 even if a larger value is given. If set to zero, server will pick an - // appropriate default. Returned results may be fewer than requested. When - // this happens, there could be more results as long as `next_page_token` is - // returned. + // Optional. The page size for search result pagination. Page size is capped at 500 even + // if a larger value is given. If set to zero, server will pick an appropriate + // default. Returned results may be fewer than requested. When this happens, + // there could be more results as long as `next_page_token` is returned. 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. + // 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]; } @@ -604,6 +652,6 @@ enum ContentType { // The Cloud Organization Policy set on an asset. ORG_POLICY = 4; - // The Cloud Access context mananger Policy set on an asset. + // The Cloud Access context manager Policy set on an asset. ACCESS_POLICY = 5; } diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto index 584259b18ff..b9d56744e16 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto @@ -16,7 +16,6 @@ syntax = "proto3"; package google.cloud.asset.v1; -import "google/api/annotations.proto"; import "google/api/resource.proto"; import "google/cloud/orgpolicy/v1/orgpolicy.proto"; import "google/iam/v1/policy.proto"; @@ -27,6 +26,7 @@ import "google/protobuf/any.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; import "google/rpc/code.proto"; +import "google/api/annotations.proto"; option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.Asset.V1"; @@ -150,8 +150,7 @@ message Asset { // Please also refer to the [service perimeter user // guide](https://cloud.google.com/vpc-service-controls/docs/overview). - google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = - 9; + google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9; } // The ancestry path of an asset in Google Cloud [resource @@ -215,7 +214,7 @@ message Resource { string location = 8; } -// A result of Resource Search, containing information of a cloud resoure. +// A result of Resource Search, containing information of a cloud resource. message ResourceSearchResult { // The full resource name of this resource. Example: // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. @@ -225,8 +224,8 @@ message ResourceSearchResult { // // To search against the `name`: // - // * use a field query. Example: `name : "instance1"` - // * use a free text query. Example: `"instance1"` + // * use a field query. Example: `name:instance1` + // * use a free text query. Example: `instance1` string name = 1; // The type of this resource. Example: `compute.googleapis.com/Disk`. @@ -248,7 +247,7 @@ message ResourceSearchResult { // // To search against the `display_name`: // - // * use a field query. Example: `displayName : "My Instance"` + // * use a field query. Example: `displayName:"My Instance"` // * use a free text query. Example: `"My Instance"` string display_name = 4; @@ -257,7 +256,7 @@ message ResourceSearchResult { // // To search against the `description`: // - // * use a field query. Example: `description : "*important instance*"` + // * use a field query. Example: `description:"*important instance*"` // * use a free text query. Example: `"*important instance*"` string description = 5; @@ -266,8 +265,8 @@ message ResourceSearchResult { // // To search against the `location`: // - // * use a field query. Example: `location : "us-west*"` - // * use a free text query. Example: `"us-west*"` + // * use a field query. Example: `location:us-west*` + // * use a free text query. Example: `us-west*` string location = 6; // Labels associated with this resource. See [Labelling and grouping GCP @@ -276,11 +275,11 @@ message ResourceSearchResult { // // To search against the `labels`: // - // * use a field query, as following: - // - query on any label's key or value. Example: `labels : "prod"` - // - query by a given label. Example: `labels.env : "prod"` - // - query by a given label'sexistence. Example: `labels.env : *` - // * use a free text query. Example: `"prod"` + // * use a field query: + // - query on any label's key or value. Example: `labels:prod` + // - query by a given label. Example: `labels.env:prod` + // - query by a given label's existence. Example: `labels.env:*` + // * use a free text query. Example: `prod` map labels = 7; // Network tags associated with this resource. Like labels, network tags are a @@ -290,19 +289,29 @@ message ResourceSearchResult { // // To search against the `network_tags`: // - // * use a field query. Example: `networkTags : "internal"` - // * use a free text query. Example: `"internal"` + // * use a field query. Example: `networkTags:internal` + // * use a free text query. Example: `internal` repeated string network_tags = 8; - // The additional attributes of this resource. The attributes may vary from - // one resource type to another. Examples: `projectId` for Project, - // `dnsName` for DNS ManagedZone. + // The additional searchable attributes of this resource. The attributes may + // vary from one resource type to another. Examples: `projectId` for Project, + // `dnsName` for DNS ManagedZone. This field contains a subset of the resource + // metadata fields that are returned by the List or Get APIs provided by the + // corresponding GCP service (e.g., Compute Engine). see [API references and + // supported searchable + // attributes](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types) + // for more information. + // + // You can search values of these fields through free text search. However, + // you should not consume the field programically as the field names and + // values may change as the GCP service updates to a new incompatible API + // version. // // To search against the `additional_attributes`: // // * use a free text query to match the attributes values. Example: to search // `additional_attributes = { dnsName: "foobar" }`, you can issue a query - // `"foobar"`. + // `foobar`. google.protobuf.Struct additional_attributes = 9; } @@ -318,7 +327,7 @@ message IamPolicySearchResult { // The map from roles to their included permissions that match the // permission query (i.e., a query containing `policy.role.permissions:`). - // Example: if query `policy.role.permissions : "compute.disk.get"` + // Example: if query `policy.role.permissions:compute.disk.get` // matches a policy binding that contains owner role, the // matched_permissions will be `{"roles/owner": ["compute.disk.get"]}`. The // roles can also be found in the returned `policy` bindings. Note that the @@ -335,7 +344,7 @@ message IamPolicySearchResult { // // To search against the `resource`: // - // * use a field query. Example: `resource : "organizations/123"` + // * use a field query. Example: `resource:organizations/123` string resource = 1; // The project that the associated GCP resource belongs to, in the form of @@ -356,13 +365,13 @@ message IamPolicySearchResult { // // To search against the `policy` bindings: // - // * use a field query, as following: + // * use a field query: // - query by the policy contained members. Example: - // `policy : "amy@gmail.com"` + // `policy:amy@gmail.com` // - query by the policy contained roles. Example: - // `policy : "roles/compute.admin"` - // - query by the policy contained roles' implied permissions. Example: - // `policy.role.permissions : "compute.instances.create"` + // `policy:roles/compute.admin` + // - query by the policy contained roles' included permissions. Example: + // `policy.role.permissions:compute.instances.create` google.iam.v1.Policy policy = 3; // Explanation about the IAM policy search result. It contains additional diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index 2cb313c9d4a..5e5c844f96b 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -361,6 +361,9 @@ export namespace google { /** ExportAssetsResponse outputConfig */ outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); + + /** ExportAssetsResponse outputResult */ + outputResult?: (google.cloud.asset.v1.IOutputResult|null); } /** Represents an ExportAssetsResponse. */ @@ -378,6 +381,9 @@ export namespace google { /** ExportAssetsResponse outputConfig. */ public outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); + /** ExportAssetsResponse outputResult. */ + public outputResult?: (google.cloud.asset.v1.IOutputResult|null); + /** * Creates a new ExportAssetsResponse instance using the specified properties. * @param [properties] Properties to set @@ -1304,6 +1310,189 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of an OutputResult. */ + interface IOutputResult { + + /** OutputResult gcsResult */ + gcsResult?: (google.cloud.asset.v1.IGcsOutputResult|null); + } + + /** Represents an OutputResult. */ + class OutputResult implements IOutputResult { + + /** + * Constructs a new OutputResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IOutputResult); + + /** OutputResult gcsResult. */ + public gcsResult?: (google.cloud.asset.v1.IGcsOutputResult|null); + + /** OutputResult result. */ + public result?: "gcsResult"; + + /** + * Creates a new OutputResult instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputResult instance + */ + public static create(properties?: google.cloud.asset.v1.IOutputResult): google.cloud.asset.v1.OutputResult; + + /** + * Encodes the specified OutputResult message. Does not implicitly {@link google.cloud.asset.v1.OutputResult.verify|verify} messages. + * @param message OutputResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IOutputResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutputResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.OutputResult.verify|verify} messages. + * @param message OutputResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IOutputResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OutputResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutputResult + * @throws {Error} If the payload is not a 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.OutputResult; + + /** + * Decodes an OutputResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutputResult + * @throws {Error} If the payload is 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.OutputResult; + + /** + * Verifies an OutputResult message. + * @param message Plain 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 OutputResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutputResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.OutputResult; + + /** + * Creates a plain object from an OutputResult message. Also converts values to other types if specified. + * @param message OutputResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.OutputResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutputResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GcsOutputResult. */ + interface IGcsOutputResult { + + /** GcsOutputResult uris */ + uris?: (string[]|null); + } + + /** Represents a GcsOutputResult. */ + class GcsOutputResult implements IGcsOutputResult { + + /** + * Constructs a new GcsOutputResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IGcsOutputResult); + + /** GcsOutputResult uris. */ + public uris: string[]; + + /** + * Creates a new GcsOutputResult instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsOutputResult instance + */ + public static create(properties?: google.cloud.asset.v1.IGcsOutputResult): google.cloud.asset.v1.GcsOutputResult; + + /** + * Encodes the specified GcsOutputResult message. Does not implicitly {@link google.cloud.asset.v1.GcsOutputResult.verify|verify} messages. + * @param message GcsOutputResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IGcsOutputResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsOutputResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GcsOutputResult.verify|verify} messages. + * @param message GcsOutputResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IGcsOutputResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsOutputResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsOutputResult + * @throws {Error} If the payload is not a 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.GcsOutputResult; + + /** + * Decodes a GcsOutputResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsOutputResult + * @throws {Error} If the payload is 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.GcsOutputResult; + + /** + * Verifies a GcsOutputResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcsOutputResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsOutputResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.GcsOutputResult; + + /** + * Creates a plain object from a GcsOutputResult message. Also converts values to other types if specified. + * @param message GcsOutputResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.GcsOutputResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsOutputResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a GcsDestination. */ interface IGcsDestination { diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index 75dce3c91c8..75251f38f6e 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -737,6 +737,7 @@ * @interface IExportAssetsResponse * @property {google.protobuf.ITimestamp|null} [readTime] ExportAssetsResponse readTime * @property {google.cloud.asset.v1.IOutputConfig|null} [outputConfig] ExportAssetsResponse outputConfig + * @property {google.cloud.asset.v1.IOutputResult|null} [outputResult] ExportAssetsResponse outputResult */ /** @@ -770,6 +771,14 @@ */ ExportAssetsResponse.prototype.outputConfig = null; + /** + * ExportAssetsResponse outputResult. + * @member {google.cloud.asset.v1.IOutputResult|null|undefined} outputResult + * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @instance + */ + ExportAssetsResponse.prototype.outputResult = null; + /** * Creates a new ExportAssetsResponse instance using the specified properties. * @function create @@ -798,6 +807,8 @@ $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) $root.google.cloud.asset.v1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.outputResult != null && Object.hasOwnProperty.call(message, "outputResult")) + $root.google.cloud.asset.v1.OutputResult.encode(message.outputResult, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -838,6 +849,9 @@ case 2: message.outputConfig = $root.google.cloud.asset.v1.OutputConfig.decode(reader, reader.uint32()); break; + case 3: + message.outputResult = $root.google.cloud.asset.v1.OutputResult.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -883,6 +897,11 @@ if (error) return "outputConfig." + error; } + if (message.outputResult != null && message.hasOwnProperty("outputResult")) { + var error = $root.google.cloud.asset.v1.OutputResult.verify(message.outputResult); + if (error) + return "outputResult." + error; + } return null; }; @@ -908,6 +927,11 @@ throw TypeError(".google.cloud.asset.v1.ExportAssetsResponse.outputConfig: object expected"); message.outputConfig = $root.google.cloud.asset.v1.OutputConfig.fromObject(object.outputConfig); } + if (object.outputResult != null) { + if (typeof object.outputResult !== "object") + throw TypeError(".google.cloud.asset.v1.ExportAssetsResponse.outputResult: object expected"); + message.outputResult = $root.google.cloud.asset.v1.OutputResult.fromObject(object.outputResult); + } return message; }; @@ -927,11 +951,14 @@ if (options.defaults) { object.readTime = null; object.outputConfig = null; + object.outputResult = 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.v1.OutputConfig.toObject(message.outputConfig, options); + if (message.outputResult != null && message.hasOwnProperty("outputResult")) + object.outputResult = $root.google.cloud.asset.v1.OutputResult.toObject(message.outputResult, options); return object; }; @@ -2932,6 +2959,420 @@ return OutputConfig; })(); + v1.OutputResult = (function() { + + /** + * Properties of an OutputResult. + * @memberof google.cloud.asset.v1 + * @interface IOutputResult + * @property {google.cloud.asset.v1.IGcsOutputResult|null} [gcsResult] OutputResult gcsResult + */ + + /** + * Constructs a new OutputResult. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an OutputResult. + * @implements IOutputResult + * @constructor + * @param {google.cloud.asset.v1.IOutputResult=} [properties] Properties to set + */ + function OutputResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OutputResult gcsResult. + * @member {google.cloud.asset.v1.IGcsOutputResult|null|undefined} gcsResult + * @memberof google.cloud.asset.v1.OutputResult + * @instance + */ + OutputResult.prototype.gcsResult = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OutputResult result. + * @member {"gcsResult"|undefined} result + * @memberof google.cloud.asset.v1.OutputResult + * @instance + */ + Object.defineProperty(OutputResult.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["gcsResult"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OutputResult instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.OutputResult + * @static + * @param {google.cloud.asset.v1.IOutputResult=} [properties] Properties to set + * @returns {google.cloud.asset.v1.OutputResult} OutputResult instance + */ + OutputResult.create = function create(properties) { + return new OutputResult(properties); + }; + + /** + * Encodes the specified OutputResult message. Does not implicitly {@link google.cloud.asset.v1.OutputResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.OutputResult + * @static + * @param {google.cloud.asset.v1.IOutputResult} message OutputResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsResult != null && Object.hasOwnProperty.call(message, "gcsResult")) + $root.google.cloud.asset.v1.GcsOutputResult.encode(message.gcsResult, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OutputResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.OutputResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.OutputResult + * @static + * @param {google.cloud.asset.v1.IOutputResult} message OutputResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OutputResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.OutputResult + * @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.OutputResult} OutputResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputResult.decode = function decode(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.OutputResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsResult = $root.google.cloud.asset.v1.GcsOutputResult.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OutputResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.OutputResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.OutputResult} OutputResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OutputResult message. + * @function verify + * @memberof google.cloud.asset.v1.OutputResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OutputResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsResult != null && message.hasOwnProperty("gcsResult")) { + properties.result = 1; + { + var error = $root.google.cloud.asset.v1.GcsOutputResult.verify(message.gcsResult); + if (error) + return "gcsResult." + error; + } + } + return null; + }; + + /** + * Creates an OutputResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.OutputResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.OutputResult} OutputResult + */ + OutputResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.OutputResult) + return object; + var message = new $root.google.cloud.asset.v1.OutputResult(); + if (object.gcsResult != null) { + if (typeof object.gcsResult !== "object") + throw TypeError(".google.cloud.asset.v1.OutputResult.gcsResult: object expected"); + message.gcsResult = $root.google.cloud.asset.v1.GcsOutputResult.fromObject(object.gcsResult); + } + return message; + }; + + /** + * Creates a plain object from an OutputResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.OutputResult + * @static + * @param {google.cloud.asset.v1.OutputResult} message OutputResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OutputResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsResult != null && message.hasOwnProperty("gcsResult")) { + object.gcsResult = $root.google.cloud.asset.v1.GcsOutputResult.toObject(message.gcsResult, options); + if (options.oneofs) + object.result = "gcsResult"; + } + return object; + }; + + /** + * Converts this OutputResult to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.OutputResult + * @instance + * @returns {Object.} JSON object + */ + OutputResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OutputResult; + })(); + + v1.GcsOutputResult = (function() { + + /** + * Properties of a GcsOutputResult. + * @memberof google.cloud.asset.v1 + * @interface IGcsOutputResult + * @property {Array.|null} [uris] GcsOutputResult uris + */ + + /** + * Constructs a new GcsOutputResult. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a GcsOutputResult. + * @implements IGcsOutputResult + * @constructor + * @param {google.cloud.asset.v1.IGcsOutputResult=} [properties] Properties to set + */ + function GcsOutputResult(properties) { + this.uris = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcsOutputResult uris. + * @member {Array.} uris + * @memberof google.cloud.asset.v1.GcsOutputResult + * @instance + */ + GcsOutputResult.prototype.uris = $util.emptyArray; + + /** + * Creates a new GcsOutputResult instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.GcsOutputResult + * @static + * @param {google.cloud.asset.v1.IGcsOutputResult=} [properties] Properties to set + * @returns {google.cloud.asset.v1.GcsOutputResult} GcsOutputResult instance + */ + GcsOutputResult.create = function create(properties) { + return new GcsOutputResult(properties); + }; + + /** + * Encodes the specified GcsOutputResult message. Does not implicitly {@link google.cloud.asset.v1.GcsOutputResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.GcsOutputResult + * @static + * @param {google.cloud.asset.v1.IGcsOutputResult} message GcsOutputResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsOutputResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uris != null && message.uris.length) + for (var i = 0; i < message.uris.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uris[i]); + return writer; + }; + + /** + * Encodes the specified GcsOutputResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GcsOutputResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.GcsOutputResult + * @static + * @param {google.cloud.asset.v1.IGcsOutputResult} message GcsOutputResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsOutputResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsOutputResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.GcsOutputResult + * @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.GcsOutputResult} GcsOutputResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsOutputResult.decode = function decode(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.GcsOutputResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.uris && message.uris.length)) + message.uris = []; + message.uris.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsOutputResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.GcsOutputResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.GcsOutputResult} GcsOutputResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsOutputResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsOutputResult message. + * @function verify + * @memberof google.cloud.asset.v1.GcsOutputResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsOutputResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uris != null && message.hasOwnProperty("uris")) { + if (!Array.isArray(message.uris)) + return "uris: array expected"; + for (var i = 0; i < message.uris.length; ++i) + if (!$util.isString(message.uris[i])) + return "uris: string[] expected"; + } + return null; + }; + + /** + * Creates a GcsOutputResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.GcsOutputResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.GcsOutputResult} GcsOutputResult + */ + GcsOutputResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.GcsOutputResult) + return object; + var message = new $root.google.cloud.asset.v1.GcsOutputResult(); + if (object.uris) { + if (!Array.isArray(object.uris)) + throw TypeError(".google.cloud.asset.v1.GcsOutputResult.uris: array expected"); + message.uris = []; + for (var i = 0; i < object.uris.length; ++i) + message.uris[i] = String(object.uris[i]); + } + return message; + }; + + /** + * Creates a plain object from a GcsOutputResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.GcsOutputResult + * @static + * @param {google.cloud.asset.v1.GcsOutputResult} message GcsOutputResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsOutputResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uris = []; + if (message.uris && message.uris.length) { + object.uris = []; + for (var j = 0; j < message.uris.length; ++j) + object.uris[j] = message.uris[j]; + } + return object; + }; + + /** + * Converts this GcsOutputResult to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.GcsOutputResult + * @instance + * @returns {Object.} JSON object + */ + GcsOutputResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GcsOutputResult; + })(); + v1.GcsDestination = (function() { /** diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index 152c8eea39c..e4d819f310f 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -141,6 +141,10 @@ "outputConfig": { "type": "OutputConfig", "id": 2 + }, + "outputResult": { + "type": "OutputResult", + "id": 3 } } }, @@ -291,6 +295,30 @@ } } }, + "OutputResult": { + "oneofs": { + "result": { + "oneof": [ + "gcsResult" + ] + } + }, + "fields": { + "gcsResult": { + "type": "GcsOutputResult", + "id": 1 + } + } + }, + "GcsOutputResult": { + "fields": { + "uris": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, "GcsDestination": { "oneofs": { "objectUri": { diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index 6afa5594263..c6827482b5d 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -513,8 +513,9 @@ export class AssetServiceClient { * 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 + * 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] @@ -761,8 +762,8 @@ export class AssetServiceClient { * @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: + * 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. @@ -940,14 +941,13 @@ export class AssetServiceClient { * Exports assets with time and resource types to a given Cloud Storage * location/BigQuery table. For Cloud Storage location destinations, the * output format is newline-delimited JSON. Each line represents a - * {@link google.cloud.asset.v1.Asset|google.cloud.asset.v1.Asset} in the JSON - * format; for BigQuery table destinations, the output table stores the fields - * in asset proto as columns. This API implements the - * {@link google.longrunning.Operation|google.longrunning.Operation} API , which - * allows you to keep track of the export. We recommend intervals of at least - * 2 seconds with exponential retry to poll the export operation result. For - * regular-size resource parent, the export operation usually finishes within - * 5 minutes. + * {@link google.cloud.asset.v1.Asset|google.cloud.asset.v1.Asset} in the JSON format; for BigQuery table + * destinations, the output table stores the fields in asset proto as columns. + * This API implements the {@link google.longrunning.Operation|google.longrunning.Operation} API + * , which allows you to keep track of the export. We recommend intervals of + * at least 2 seconds with exponential retry to poll the export operation + * result. For regular-size resource parent, the export operation usually + * finishes within 5 minutes. * * @param {Object} request * The request object that will be sent. @@ -963,17 +963,29 @@ export class AssetServiceClient { * 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. Example: - * "compute.googleapis.com/Disk". If specified, only matching assets will be - * returned. See [Introduction to Cloud Asset + * A list of asset types to take a snapshot for. For example: + * "compute.googleapis.com/Disk". + * + * Regular expressions are also supported. For example: + * + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * + * If specified, only matching assets will be returned, otherwise, it will + * snapshot all asset types. 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. + * Required. Output configuration indicating where the results will be output to. * @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. @@ -1097,78 +1109,84 @@ export class AssetServiceClient { > ): void; /** - * Searches all the resources within the given accessible scope (e.g., a - * project, a folder or an organization). Callers should have - * cloud.assets.SearchAllResources permission upon the requested scope, + * Searches all Cloud resources within the specified scope, such as a project, + * folder, or organization. The caller must be granted the + * `cloudasset.assets.searchAllResources` permission on the desired scope, * otherwise the request will be rejected. * * @param {Object} request * The request object that will be sent. * @param {string} request.scope - * Required. A scope can be a project, a folder or an organization. The search - * is limited to the resources within the `scope`. + * Required. A scope can be a project, a folder, or an organization. The search is + * limited to the resources within the `scope`. The caller must be granted the + * [`cloudasset.assets.searchAllResources`](http://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * permission on the desired scope. * * The allowed values are: * - * * projects/{PROJECT_ID} - * * projects/{PROJECT_NUMBER} - * * folders/{FOLDER_NUMBER} - * * organizations/{ORGANIZATION_NUMBER} + * * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") * @param {string} [request.query] - * Optional. The query statement. An empty query can be specified to search - * all the resources of certain `asset_types` within the given `scope`. + * Optional. The query statement. See [how to construct a + * query](http://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) + * for more information. If not specified or empty, it will search all the + * resources within the specified `scope`. Note that the query string is + * compared against each Cloud IAM policy binding, including its members, + * roles, and Cloud IAM conditions. The returned Cloud IAM policies will only + * contain the bindings that match your query. To learn more about the IAM + * policy structure, see [IAM policy + * doc](https://cloud.google.com/iam/docs/policies#structure). * * Examples: * - * * `name : "Important"` to find Cloud resources whose name contains + * * `name:Important` to find Cloud resources whose name contains * "Important" as a word. - * * `displayName : "Impor*"` to find Cloud resources whose display name - * contains "Impor" as a word prefix. - * * `description : "*por*"` to find Cloud resources whose description + * * `displayName:Impor*` to find Cloud resources whose display name + * contains "Impor" as a prefix. + * * `description:*por*` to find Cloud resources whose description * contains "por" as a substring. - * * `location : "us-west*"` to find Cloud resources whose location is + * * `location:us-west*` to find Cloud resources whose location is * prefixed with "us-west". - * * `labels : "prod"` to find Cloud resources whose labels contain "prod" as + * * `labels:prod` to find Cloud resources whose labels contain "prod" as * a key or value. - * * `labels.env : "prod"` to find Cloud resources which have a label "env" + * * `labels.env:prod` to find Cloud resources that have a label "env" * and its value is "prod". - * * `labels.env : *` to find Cloud resources which have a label "env". - * * `"Important"` to find Cloud resources which contain "Important" as a word + * * `labels.env:*` to find Cloud resources that have a label "env". + * * `Important` to find Cloud resources that contain "Important" as a word * in any of the searchable fields. - * * `"Impor*"` to find Cloud resources which contain "Impor" as a word prefix + * * `Impor*` to find Cloud resources that contain "Impor" as a prefix * in any of the searchable fields. - * * `"*por*"` to find Cloud resources which contain "por" as a substring in + * * `*por*` to find Cloud resources that contain "por" as a substring in * any of the searchable fields. - * * `("Important" AND location : ("us-west1" OR "global"))` to find Cloud - * resources which contain "Important" as a word in any of the searchable + * * `Important location:(us-west1 OR global)` to find Cloud + * resources that contain "Important" as a word in any of the searchable * fields and are also located in the "us-west1" region or the "global" * location. - * - * See [how to construct a - * query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) - * for more details. * @param {string[]} [request.assetTypes] - * Optional. A list of asset types that this request searches for. If empty, - * it will search all the [searchable asset + * Optional. A list of asset types that this request searches for. If empty, it will + * search all the [searchable asset * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Page size is capped - * at 500 even if a larger value is given. If set to zero, server will pick an - * appropriate default. Returned results may be fewer than requested. When - * this happens, there could be more results as long as `next_page_token` is - * returned. + * Optional. The page size for search result pagination. Page size is capped at 500 even + * if a larger value is given. If set to zero, server will pick an appropriate + * default. Returned results may be fewer than requested. When this happens, + * there could be more results as long as `next_page_token` is returned. * @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. + * 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 {string} [request.orderBy] - * Optional. A comma separated list of fields specifying the sorting order of - * the results. The default order is ascending. Add " DESC" after the field - * name to indicate descending order. Redundant space characters are ignored. - * Example: "location DESC, name". See [supported resource metadata - * fields](https://cloud.google.com/asset-inventory/docs/searching-resources#query_on_resource_metadata_fields) - * for more details. + * Optional. A comma separated list of fields specifying the sorting order of the + * results. The default order is ascending. Add " DESC" after the field name + * to indicate descending order. Redundant space characters are ignored. + * Example: "location DESC, name". Only string fields in the response are + * sortable, including `name`, `displayName`, `description`, `location`. All + * the other fields such as repeated fields (e.g., `networkTags`), map + * fields (e.g., `labels`) and struct fields (e.g., `additionalAttributes`) + * are not supported. * @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. @@ -1248,70 +1266,76 @@ export class AssetServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.scope - * Required. A scope can be a project, a folder or an organization. The search - * is limited to the resources within the `scope`. + * Required. A scope can be a project, a folder, or an organization. The search is + * limited to the resources within the `scope`. The caller must be granted the + * [`cloudasset.assets.searchAllResources`](http://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * permission on the desired scope. * * The allowed values are: * - * * projects/{PROJECT_ID} - * * projects/{PROJECT_NUMBER} - * * folders/{FOLDER_NUMBER} - * * organizations/{ORGANIZATION_NUMBER} + * * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") * @param {string} [request.query] - * Optional. The query statement. An empty query can be specified to search - * all the resources of certain `asset_types` within the given `scope`. + * Optional. The query statement. See [how to construct a + * query](http://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) + * for more information. If not specified or empty, it will search all the + * resources within the specified `scope`. Note that the query string is + * compared against each Cloud IAM policy binding, including its members, + * roles, and Cloud IAM conditions. The returned Cloud IAM policies will only + * contain the bindings that match your query. To learn more about the IAM + * policy structure, see [IAM policy + * doc](https://cloud.google.com/iam/docs/policies#structure). * * Examples: * - * * `name : "Important"` to find Cloud resources whose name contains + * * `name:Important` to find Cloud resources whose name contains * "Important" as a word. - * * `displayName : "Impor*"` to find Cloud resources whose display name - * contains "Impor" as a word prefix. - * * `description : "*por*"` to find Cloud resources whose description + * * `displayName:Impor*` to find Cloud resources whose display name + * contains "Impor" as a prefix. + * * `description:*por*` to find Cloud resources whose description * contains "por" as a substring. - * * `location : "us-west*"` to find Cloud resources whose location is + * * `location:us-west*` to find Cloud resources whose location is * prefixed with "us-west". - * * `labels : "prod"` to find Cloud resources whose labels contain "prod" as + * * `labels:prod` to find Cloud resources whose labels contain "prod" as * a key or value. - * * `labels.env : "prod"` to find Cloud resources which have a label "env" + * * `labels.env:prod` to find Cloud resources that have a label "env" * and its value is "prod". - * * `labels.env : *` to find Cloud resources which have a label "env". - * * `"Important"` to find Cloud resources which contain "Important" as a word + * * `labels.env:*` to find Cloud resources that have a label "env". + * * `Important` to find Cloud resources that contain "Important" as a word * in any of the searchable fields. - * * `"Impor*"` to find Cloud resources which contain "Impor" as a word prefix + * * `Impor*` to find Cloud resources that contain "Impor" as a prefix * in any of the searchable fields. - * * `"*por*"` to find Cloud resources which contain "por" as a substring in + * * `*por*` to find Cloud resources that contain "por" as a substring in * any of the searchable fields. - * * `("Important" AND location : ("us-west1" OR "global"))` to find Cloud - * resources which contain "Important" as a word in any of the searchable + * * `Important location:(us-west1 OR global)` to find Cloud + * resources that contain "Important" as a word in any of the searchable * fields and are also located in the "us-west1" region or the "global" * location. - * - * See [how to construct a - * query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) - * for more details. * @param {string[]} [request.assetTypes] - * Optional. A list of asset types that this request searches for. If empty, - * it will search all the [searchable asset + * Optional. A list of asset types that this request searches for. If empty, it will + * search all the [searchable asset * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Page size is capped - * at 500 even if a larger value is given. If set to zero, server will pick an - * appropriate default. Returned results may be fewer than requested. When - * this happens, there could be more results as long as `next_page_token` is - * returned. + * Optional. The page size for search result pagination. Page size is capped at 500 even + * if a larger value is given. If set to zero, server will pick an appropriate + * default. Returned results may be fewer than requested. When this happens, + * there could be more results as long as `next_page_token` is returned. * @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. + * 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 {string} [request.orderBy] - * Optional. A comma separated list of fields specifying the sorting order of - * the results. The default order is ascending. Add " DESC" after the field - * name to indicate descending order. Redundant space characters are ignored. - * Example: "location DESC, name". See [supported resource metadata - * fields](https://cloud.google.com/asset-inventory/docs/searching-resources#query_on_resource_metadata_fields) - * for more details. + * Optional. A comma separated list of fields specifying the sorting order of the + * results. The default order is ascending. Add " DESC" after the field name + * to indicate descending order. Redundant space characters are ignored. + * Example: "location DESC, name". Only string fields in the response are + * sortable, including `name`, `displayName`, `description`, `location`. All + * the other fields such as repeated fields (e.g., `networkTags`), map + * fields (e.g., `labels`) and struct fields (e.g., `additionalAttributes`) + * are not supported. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} @@ -1347,70 +1371,76 @@ export class AssetServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.scope - * Required. A scope can be a project, a folder or an organization. The search - * is limited to the resources within the `scope`. + * Required. A scope can be a project, a folder, or an organization. The search is + * limited to the resources within the `scope`. The caller must be granted the + * [`cloudasset.assets.searchAllResources`](http://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * permission on the desired scope. * * The allowed values are: * - * * projects/{PROJECT_ID} - * * projects/{PROJECT_NUMBER} - * * folders/{FOLDER_NUMBER} - * * organizations/{ORGANIZATION_NUMBER} + * * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") * @param {string} [request.query] - * Optional. The query statement. An empty query can be specified to search - * all the resources of certain `asset_types` within the given `scope`. + * Optional. The query statement. See [how to construct a + * query](http://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) + * for more information. If not specified or empty, it will search all the + * resources within the specified `scope`. Note that the query string is + * compared against each Cloud IAM policy binding, including its members, + * roles, and Cloud IAM conditions. The returned Cloud IAM policies will only + * contain the bindings that match your query. To learn more about the IAM + * policy structure, see [IAM policy + * doc](https://cloud.google.com/iam/docs/policies#structure). * * Examples: * - * * `name : "Important"` to find Cloud resources whose name contains + * * `name:Important` to find Cloud resources whose name contains * "Important" as a word. - * * `displayName : "Impor*"` to find Cloud resources whose display name - * contains "Impor" as a word prefix. - * * `description : "*por*"` to find Cloud resources whose description + * * `displayName:Impor*` to find Cloud resources whose display name + * contains "Impor" as a prefix. + * * `description:*por*` to find Cloud resources whose description * contains "por" as a substring. - * * `location : "us-west*"` to find Cloud resources whose location is + * * `location:us-west*` to find Cloud resources whose location is * prefixed with "us-west". - * * `labels : "prod"` to find Cloud resources whose labels contain "prod" as + * * `labels:prod` to find Cloud resources whose labels contain "prod" as * a key or value. - * * `labels.env : "prod"` to find Cloud resources which have a label "env" + * * `labels.env:prod` to find Cloud resources that have a label "env" * and its value is "prod". - * * `labels.env : *` to find Cloud resources which have a label "env". - * * `"Important"` to find Cloud resources which contain "Important" as a word + * * `labels.env:*` to find Cloud resources that have a label "env". + * * `Important` to find Cloud resources that contain "Important" as a word * in any of the searchable fields. - * * `"Impor*"` to find Cloud resources which contain "Impor" as a word prefix + * * `Impor*` to find Cloud resources that contain "Impor" as a prefix * in any of the searchable fields. - * * `"*por*"` to find Cloud resources which contain "por" as a substring in + * * `*por*` to find Cloud resources that contain "por" as a substring in * any of the searchable fields. - * * `("Important" AND location : ("us-west1" OR "global"))` to find Cloud - * resources which contain "Important" as a word in any of the searchable + * * `Important location:(us-west1 OR global)` to find Cloud + * resources that contain "Important" as a word in any of the searchable * fields and are also located in the "us-west1" region or the "global" * location. - * - * See [how to construct a - * query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) - * for more details. * @param {string[]} [request.assetTypes] - * Optional. A list of asset types that this request searches for. If empty, - * it will search all the [searchable asset + * Optional. A list of asset types that this request searches for. If empty, it will + * search all the [searchable asset * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Page size is capped - * at 500 even if a larger value is given. If set to zero, server will pick an - * appropriate default. Returned results may be fewer than requested. When - * this happens, there could be more results as long as `next_page_token` is - * returned. + * Optional. The page size for search result pagination. Page size is capped at 500 even + * if a larger value is given. If set to zero, server will pick an appropriate + * default. Returned results may be fewer than requested. When this happens, + * there could be more results as long as `next_page_token` is returned. * @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. + * 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 {string} [request.orderBy] - * Optional. A comma separated list of fields specifying the sorting order of - * the results. The default order is ascending. Add " DESC" after the field - * name to indicate descending order. Redundant space characters are ignored. - * Example: "location DESC, name". See [supported resource metadata - * fields](https://cloud.google.com/asset-inventory/docs/searching-resources#query_on_resource_metadata_fields) - * for more details. + * Optional. A comma separated list of fields specifying the sorting order of the + * results. The default order is ascending. Add " DESC" after the field name + * to indicate descending order. Redundant space characters are ignored. + * Example: "location DESC, name". Only string fields in the response are + * sortable, including `name`, `displayName`, `description`, `location`. All + * the other fields such as repeated fields (e.g., `networkTags`), map + * fields (e.g., `labels`) and struct fields (e.g., `additionalAttributes`) + * are not supported. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} @@ -1470,56 +1500,63 @@ export class AssetServiceClient { > ): void; /** - * Searches all the IAM policies within the given accessible scope (e.g., a - * project, a folder or an organization). Callers should have - * cloud.assets.SearchAllIamPolicies permission upon the requested scope, + * Searches all IAM policies within the specified scope, such as a project, + * folder, or organization. The caller must be granted the + * `cloudasset.assets.searchAllIamPolicies` permission on the desired scope, * otherwise the request will be rejected. * * @param {Object} request * The request object that will be sent. * @param {string} request.scope - * Required. A scope can be a project, a folder or an organization. The search - * is limited to the IAM policies within the `scope`. + * Required. A scope can be a project, a folder, or an organization. The search is + * limited to the IAM policies within the `scope`. The caller must be granted + * the + * [`cloudasset.assets.searchAllIamPolicies`](http://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * permission on the desired scope. * * The allowed values are: * - * * projects/{PROJECT_ID} - * * projects/{PROJECT_NUMBER} - * * folders/{FOLDER_NUMBER} - * * organizations/{ORGANIZATION_NUMBER} + * * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") * @param {string} [request.query] - * Optional. The query statement. An empty query can be specified to search - * all the IAM policies within the given `scope`. + * Optional. The query statement. See [how to construct a + * query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) + * for more information. If not specified or empty, it will search all the + * IAM policies within the specified `scope`. * * Examples: * - * * `policy : "amy@gmail.com"` to find Cloud IAM policy bindings that - * specify user "amy@gmail.com". - * * `policy : "roles/compute.admin"` to find Cloud IAM policy bindings that - * specify the Compute Admin role. - * * `policy.role.permissions : "storage.buckets.update"` to find Cloud IAM - * policy bindings that specify a role containing "storage.buckets.update" - * permission. - * * `resource : "organizations/123"` to find Cloud IAM policy bindings that - * are set on "organizations/123". - * * `(resource : ("organizations/123" OR "folders/1234") AND policy : "amy")` - * to find Cloud IAM policy bindings that are set on "organizations/123" or - * "folders/1234", and also specify user "amy". - * - * See [how to construct a - * query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) - * for more details. + * * `policy:amy@gmail.com` to find IAM policy bindings that specify user + * "amy@gmail.com". + * * `policy:roles/compute.admin` to find IAM policy bindings that specify + * the Compute Admin role. + * * `policy.role.permissions:storage.buckets.update` to find IAM policy + * bindings that specify a role containing "storage.buckets.update" + * permission. Note that if callers don't have `iam.roles.get` access to a + * role's included permissions, policy bindings that specify this role will + * be dropped from the search results. + * * `resource:organizations/123456` to find IAM policy bindings + * that are set on "organizations/123456". + * * `Important` to find IAM policy bindings that contain "Important" as a + * word in any of the searchable fields (except for the included + * permissions). + * * `*por*` to find IAM policy bindings that contain "por" as a substring + * in any of the searchable fields (except for the included permissions). + * * `resource:(instance1 OR instance2) policy:amy` to find + * IAM policy bindings that are set on resources "instance1" or + * "instance2" and also specify user "amy". * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Page size is capped - * at 500 even if a larger value is given. If set to zero, server will pick an - * appropriate default. Returned results may be fewer than requested. When - * this happens, there could be more results as long as `next_page_token` is - * returned. + * Optional. The page size for search result pagination. Page size is capped at 500 even + * if a larger value is given. If set to zero, server will pick an appropriate + * default. Returned results may be fewer than requested. When this happens, + * there could be more results as long as `next_page_token` is returned. * @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. + * 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. @@ -1599,48 +1636,55 @@ export class AssetServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.scope - * Required. A scope can be a project, a folder or an organization. The search - * is limited to the IAM policies within the `scope`. + * Required. A scope can be a project, a folder, or an organization. The search is + * limited to the IAM policies within the `scope`. The caller must be granted + * the + * [`cloudasset.assets.searchAllIamPolicies`](http://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * permission on the desired scope. * * The allowed values are: * - * * projects/{PROJECT_ID} - * * projects/{PROJECT_NUMBER} - * * folders/{FOLDER_NUMBER} - * * organizations/{ORGANIZATION_NUMBER} + * * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") * @param {string} [request.query] - * Optional. The query statement. An empty query can be specified to search - * all the IAM policies within the given `scope`. + * Optional. The query statement. See [how to construct a + * query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) + * for more information. If not specified or empty, it will search all the + * IAM policies within the specified `scope`. * * Examples: * - * * `policy : "amy@gmail.com"` to find Cloud IAM policy bindings that - * specify user "amy@gmail.com". - * * `policy : "roles/compute.admin"` to find Cloud IAM policy bindings that - * specify the Compute Admin role. - * * `policy.role.permissions : "storage.buckets.update"` to find Cloud IAM - * policy bindings that specify a role containing "storage.buckets.update" - * permission. - * * `resource : "organizations/123"` to find Cloud IAM policy bindings that - * are set on "organizations/123". - * * `(resource : ("organizations/123" OR "folders/1234") AND policy : "amy")` - * to find Cloud IAM policy bindings that are set on "organizations/123" or - * "folders/1234", and also specify user "amy". - * - * See [how to construct a - * query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) - * for more details. + * * `policy:amy@gmail.com` to find IAM policy bindings that specify user + * "amy@gmail.com". + * * `policy:roles/compute.admin` to find IAM policy bindings that specify + * the Compute Admin role. + * * `policy.role.permissions:storage.buckets.update` to find IAM policy + * bindings that specify a role containing "storage.buckets.update" + * permission. Note that if callers don't have `iam.roles.get` access to a + * role's included permissions, policy bindings that specify this role will + * be dropped from the search results. + * * `resource:organizations/123456` to find IAM policy bindings + * that are set on "organizations/123456". + * * `Important` to find IAM policy bindings that contain "Important" as a + * word in any of the searchable fields (except for the included + * permissions). + * * `*por*` to find IAM policy bindings that contain "por" as a substring + * in any of the searchable fields (except for the included permissions). + * * `resource:(instance1 OR instance2) policy:amy` to find + * IAM policy bindings that are set on resources "instance1" or + * "instance2" and also specify user "amy". * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Page size is capped - * at 500 even if a larger value is given. If set to zero, server will pick an - * appropriate default. Returned results may be fewer than requested. When - * this happens, there could be more results as long as `next_page_token` is - * returned. + * Optional. The page size for search result pagination. Page size is capped at 500 even + * if a larger value is given. If set to zero, server will pick an appropriate + * default. Returned results may be fewer than requested. When this happens, + * there could be more results as long as `next_page_token` is returned. * @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. + * 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} @@ -1676,48 +1720,55 @@ export class AssetServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.scope - * Required. A scope can be a project, a folder or an organization. The search - * is limited to the IAM policies within the `scope`. + * Required. A scope can be a project, a folder, or an organization. The search is + * limited to the IAM policies within the `scope`. The caller must be granted + * the + * [`cloudasset.assets.searchAllIamPolicies`](http://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * permission on the desired scope. * * The allowed values are: * - * * projects/{PROJECT_ID} - * * projects/{PROJECT_NUMBER} - * * folders/{FOLDER_NUMBER} - * * organizations/{ORGANIZATION_NUMBER} + * * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") * @param {string} [request.query] - * Optional. The query statement. An empty query can be specified to search - * all the IAM policies within the given `scope`. + * Optional. The query statement. See [how to construct a + * query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) + * for more information. If not specified or empty, it will search all the + * IAM policies within the specified `scope`. * * Examples: * - * * `policy : "amy@gmail.com"` to find Cloud IAM policy bindings that - * specify user "amy@gmail.com". - * * `policy : "roles/compute.admin"` to find Cloud IAM policy bindings that - * specify the Compute Admin role. - * * `policy.role.permissions : "storage.buckets.update"` to find Cloud IAM - * policy bindings that specify a role containing "storage.buckets.update" - * permission. - * * `resource : "organizations/123"` to find Cloud IAM policy bindings that - * are set on "organizations/123". - * * `(resource : ("organizations/123" OR "folders/1234") AND policy : "amy")` - * to find Cloud IAM policy bindings that are set on "organizations/123" or - * "folders/1234", and also specify user "amy". - * - * See [how to construct a - * query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) - * for more details. + * * `policy:amy@gmail.com` to find IAM policy bindings that specify user + * "amy@gmail.com". + * * `policy:roles/compute.admin` to find IAM policy bindings that specify + * the Compute Admin role. + * * `policy.role.permissions:storage.buckets.update` to find IAM policy + * bindings that specify a role containing "storage.buckets.update" + * permission. Note that if callers don't have `iam.roles.get` access to a + * role's included permissions, policy bindings that specify this role will + * be dropped from the search results. + * * `resource:organizations/123456` to find IAM policy bindings + * that are set on "organizations/123456". + * * `Important` to find IAM policy bindings that contain "Important" as a + * word in any of the searchable fields (except for the included + * permissions). + * * `*por*` to find IAM policy bindings that contain "por" as a substring + * in any of the searchable fields (except for the included permissions). + * * `resource:(instance1 OR instance2) policy:amy` to find + * IAM policy bindings that are set on resources "instance1" or + * "instance2" and also specify user "amy". * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Page size is capped - * at 500 even if a larger value is given. If set to zero, server will pick an - * appropriate default. Returned results may be fewer than requested. When - * this happens, there could be more results as long as `next_page_token` is - * returned. + * Optional. The page size for search result pagination. Page size is capped at 500 even + * if a larger value is given. If set to zero, server will pick an appropriate + * default. Returned results may be fewer than requested. When this happens, + * there could be more results as long as `next_page_token` is returned. * @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. + * 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 {Object} diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index bae50597055..bcaa6e4b5a8 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-asset.git", - "sha": "14fb06a1ca1d56888d0b86a5e16dd89cd1d65b6d" + "sha": "9aaf3976088f3e0a84aaf56637326c086d7bc767" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "94006b3cb8d2fb44703cf535da15608eed6bf7db", - "internalRef": "325949033" + "sha": "3a54e988edcbdef1e47c6ac19d3074a87214f667", + "internalRef": "326582222" } }, {