From 0ac3b3d48cc93941a5232793d812349f1fc91726 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 17 May 2022 17:00:34 -0700 Subject: [PATCH] feat: Add SavedQuery CURD support (#627) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Add SavedQuery CURD support feat: Add tags support feat!:*Add RelatedAsset and deprecate RelatedAssets for relationship GA *The previous representation of the relationship feature is deprecated and unimplemented. The RelatedAsset message represents the new stable format. PiperOrigin-RevId: 449306805 Source-Link: https://github.com/googleapis/googleapis/commit/3d7bd9d4a8772e0c7e1d39a2763e1914bfb5963d Source-Link: https://github.com/googleapis/googleapis-gen/commit/71a93d05d6076271d04b7592f7fad0d3f0c7a040 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNzFhOTNkMDVkNjA3NjI3MWQwNGI3NTkyZjdmYWQwZDNmMGM3YTA0MCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../google/cloud/asset/v1/asset_service.proto | 715 +- .../protos/google/cloud/asset/v1/assets.proto | 142 +- .../google-cloud-asset/protos/protos.d.ts | 6192 ++++++++++------- packages/google-cloud-asset/protos/protos.js | 5429 ++++++++++++--- .../google-cloud-asset/protos/protos.json | 519 +- .../v1/asset_service.analyze_iam_policy.js | 19 +- ..._service.analyze_iam_policy_longrunning.js | 19 +- ...ervice.batch_get_effective_iam_policies.js | 74 + .../generated/v1/asset_service.create_feed.js | 5 +- .../v1/asset_service.create_saved_query.js | 79 + .../v1/asset_service.delete_saved_query.js | 62 + .../v1/asset_service.export_assets.js | 3 +- .../v1/asset_service.get_saved_query.js | 61 + .../generated/v1/asset_service.list_assets.js | 9 +- .../v1/asset_service.list_saved_queries.js | 85 + .../asset_service.search_all_iam_policies.js | 40 +- .../v1/asset_service.search_all_resources.js | 43 +- .../generated/v1/asset_service.update_feed.js | 4 +- .../v1/asset_service.update_saved_query.js | 68 + ...nippet_metadata.google.cloud.asset.v1.json | 292 +- .../src/v1/asset_service_client.ts | 1284 +++- .../src/v1/asset_service_client_config.json | 24 + .../src/v1/gapic_metadata.json | 64 + .../test/gapic_asset_service_v1.ts | 2074 ++++-- 24 files changed, 12843 insertions(+), 4463 deletions(-) create mode 100644 packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_effective_iam_policies.js create mode 100644 packages/google-cloud-asset/samples/generated/v1/asset_service.create_saved_query.js create mode 100644 packages/google-cloud-asset/samples/generated/v1/asset_service.delete_saved_query.js create mode 100644 packages/google-cloud-asset/samples/generated/v1/asset_service.get_saved_query.js create mode 100644 packages/google-cloud-asset/samples/generated/v1/asset_service.list_saved_queries.js create mode 100644 packages/google-cloud-asset/samples/generated/v1/asset_service.update_saved_query.js 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 80a3da247fe..cf581222616 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 @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,11 +21,11 @@ import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/asset/v1/assets.proto"; +import "google/iam/v1/policy.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; -import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; import "google/rpc/status.proto"; import "google/type/expr.proto"; @@ -40,18 +40,20 @@ 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 Protobuf 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" @@ -79,7 +81,8 @@ 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" }; @@ -132,7 +135,8 @@ service AssetService { // 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" }; @@ -143,7 +147,8 @@ service AssetService { // 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" }; @@ -152,7 +157,8 @@ service AssetService { // Analyzes IAM policies to answer which identities have what accesses on // which resources. - rpc AnalyzeIamPolicy(AnalyzeIamPolicyRequest) returns (AnalyzeIamPolicyResponse) { + rpc AnalyzeIamPolicy(AnalyzeIamPolicyRequest) + returns (AnalyzeIamPolicyResponse) { option (google.api.http) = { get: "/v1/{analysis_query.scope=*/*}:analyzeIamPolicy" }; @@ -162,12 +168,14 @@ service AssetService { // accesses on which resources, and writes the analysis results to a Google // Cloud Storage or a BigQuery destination. For Cloud Storage destination, the // output format is the JSON format that represents a - // [AnalyzeIamPolicyResponse][google.cloud.asset.v1.AnalyzeIamPolicyResponse]. This method implements the - // [google.longrunning.Operation][google.longrunning.Operation], which allows you to track the operation - // status. We recommend intervals of at least 2 seconds with exponential - // backoff retry to poll the operation result. The metadata contains the - // metadata for the long-running operation. - rpc AnalyzeIamPolicyLongrunning(AnalyzeIamPolicyLongrunningRequest) returns (google.longrunning.Operation) { + // [AnalyzeIamPolicyResponse][google.cloud.asset.v1.AnalyzeIamPolicyResponse]. + // This method implements the + // [google.longrunning.Operation][google.longrunning.Operation], which allows + // you to track the operation status. We recommend intervals of at least 2 + // seconds with exponential backoff retry to poll the operation result. The + // metadata contains the metadata for the long-running operation. + rpc AnalyzeIamPolicyLongrunning(AnalyzeIamPolicyLongrunningRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{analysis_query.scope=*/*}:analyzeIamPolicyLongrunning" body: "*" @@ -188,13 +196,66 @@ service AssetService { get: "/v1/{resource=*/*}:analyzeMove" }; } + + // Creates a saved query in a parent project/folder/organization. + rpc CreateSavedQuery(CreateSavedQueryRequest) returns (SavedQuery) { + option (google.api.http) = { + post: "/v1/{parent=*/*}/savedQueries" + body: "saved_query" + }; + option (google.api.method_signature) = "parent,saved_query,saved_query_id"; + } + + // Gets details about a saved query. + rpc GetSavedQuery(GetSavedQueryRequest) returns (SavedQuery) { + option (google.api.http) = { + get: "/v1/{name=*/*/savedQueries/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all saved queries in a parent project/folder/organization. + rpc ListSavedQueries(ListSavedQueriesRequest) + returns (ListSavedQueriesResponse) { + option (google.api.http) = { + get: "/v1/{parent=*/*}/savedQueries" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates a saved query. + rpc UpdateSavedQuery(UpdateSavedQueryRequest) returns (SavedQuery) { + option (google.api.http) = { + patch: "/v1/{saved_query.name=*/*/savedQueries/*}" + body: "saved_query" + }; + option (google.api.method_signature) = "saved_query,update_mask"; + } + + // Deletes a saved query. + rpc DeleteSavedQuery(DeleteSavedQueryRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=*/*/savedQueries/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets effective IAM policies for a batch of resources. + rpc BatchGetEffectiveIamPolicies(BatchGetEffectiveIamPoliciesRequest) + returns (BatchGetEffectiveIamPoliciesResponse) { + option (google.api.http) = { + get: "/v1/{scope=*/*}/effectiveIamPolicies:batchGet" + }; + } } // Represents the metadata of the longrunning operation for the // AnalyzeIamPolicyLongrunning rpc. message AnalyzeIamPolicyLongrunningMetadata { // Output only. The time the operation was created. - google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // Export asset request. @@ -241,7 +302,8 @@ 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]; // A list of relationship types to export, for example: @@ -263,8 +325,10 @@ message ExportAssetsRequest { } // 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; @@ -282,10 +346,11 @@ message ExportAssetsResponse { // ListAssets request. message ListAssetsRequest { - // Required. Name of the organization or project the assets belong to. Format: - // "organizations/[organization-number]" (such as "organizations/123"), - // "projects/[project-id]" (such as "projects/my-project-id"), or - // "projects/[project-number]" (such as "projects/12345"). + // Required. Name of the organization, folder, or project the assets belong + // to. Format: "organizations/[organization-number]" (such as + // "organizations/123"), "projects/[project-id]" (such as + // "projects/my-project-id"), "projects/[project-number]" (such as + // "projects/12345"), or "folders/[folder-number]" (such as "folders/12345"). string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -414,7 +479,8 @@ message BatchGetAssetsHistoryRequest { // See [Introduction to Cloud Asset // Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all // supported asset types and relationship types. - repeated string relationship_types = 5 [(google.api.field_behavior) = OPTIONAL]; + repeated string relationship_types = 5 + [(google.api.field_behavior) = OPTIONAL]; } // Batch get assets history response. @@ -436,9 +502,8 @@ 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]; @@ -452,9 +517,7 @@ 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" } ]; } @@ -473,8 +536,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. @@ -483,7 +546,8 @@ 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 { @@ -493,9 +557,7 @@ 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" } ]; } @@ -507,7 +569,7 @@ message OutputConfig { GcsDestination gcs_destination = 1; // Destination on BigQuery. The output table stores the fields in asset - // proto as columns in BigQuery. + // Protobuf as columns in BigQuery. BigQueryDestination bigquery_destination = 2; } } @@ -561,7 +623,11 @@ message BigQueryDestination { // Required. The BigQuery dataset in format // "projects/projectId/datasets/datasetId", to which the snapshot result // should be exported. If this dataset does not exist, the export call returns - // an INVALID_ARGUMENT error. + // an INVALID_ARGUMENT error. Setting the `contentType` for `exportAssets` + // determines the + // [schema](/asset-inventory/docs/exporting-to-bigquery#bigquery-schema) + // of the BigQuery table. Setting `separateTablesPerAssetType` to `TRUE` also + // influences the schema. string dataset = 1 [(google.api.field_behavior) = REQUIRED]; // Required. The BigQuery table to which the snapshot result should be @@ -697,9 +763,8 @@ message Feed { // specified asset_names or asset_types are exported to the feed. // Example: // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. - // See [Resource - // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) - // for more info. + // For a list of the full names for supported asset types, see [Resource + // name format](/asset-inventory/docs/resource-name-format). repeated string asset_names = 2; // A list of types of the assets to receive updates. You must specify either @@ -707,9 +772,8 @@ message Feed { // specified asset_names or asset_types are exported to the feed. // Example: `"compute.googleapis.com/Disk"` // - // See [this - // topic](https://cloud.google.com/asset-inventory/docs/supported-asset-types) - // for a list of all supported asset types. + // For a list of all supported asset types, see + // [Supported asset types](/asset-inventory/docs/supported-asset-types). repeated string asset_types = 3; // Asset content type. If not specified, no content but the asset name and @@ -718,7 +782,8 @@ 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 @@ -755,8 +820,9 @@ message Feed { // 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`. The caller must be granted the + // 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`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) // permission on the desired scope. // @@ -810,8 +876,8 @@ message SearchAllResourcesRequest { // location. 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). // // Regular expressions are also supported. For example: @@ -826,21 +892,22 @@ message SearchAllResourcesRequest { // supported asset type, an INVALID_ARGUMENT error will be returned. 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. + // 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 singular primitive fields in the response are sortable: // @@ -862,10 +929,10 @@ message SearchAllResourcesRequest { // are not supported. string order_by = 6 [(google.api.field_behavior) = OPTIONAL]; - // Optional. A comma-separated list of fields specifying which fields to be returned in - // ResourceSearchResult. Only '*' or combination of top level fields can be - // specified. Field names of both snake_case and camelCase are supported. - // Examples: `"*"`, `"name,location"`, `"name,versionedResources"`. + // Optional. A comma-separated list of fields specifying which fields to be + // returned in ResourceSearchResult. Only '*' or combination of top level + // fields can be specified. Field names of both snake_case and camelCase are + // supported. Examples: `"*"`, `"name,location"`, `"name,versionedResources"`. // // The read_mask paths must be valid field paths listed but not limited to // (both snake_case and camelCase are supported): @@ -876,6 +943,9 @@ message SearchAllResourcesRequest { // * displayName // * description // * location + // * tagKeys + // * tagValues + // * tagValueIds // * labels // * networkTags // * kmsKey @@ -890,7 +960,8 @@ message SearchAllResourcesRequest { // If only '*' is specified, all fields including versionedResources will be // returned. // Any invalid field path will trigger INVALID_ARGUMENT error. - google.protobuf.FieldMask read_mask = 8 [(google.api.field_behavior) = OPTIONAL]; + google.protobuf.FieldMask read_mask = 8 + [(google.api.field_behavior) = OPTIONAL]; } // Search all resources response. @@ -907,9 +978,9 @@ 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`. The caller must be granted - // the + // 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`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) // permission on the desired scope. // @@ -925,7 +996,7 @@ message SearchAllIamPoliciesRequest { // 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`. Note that the query string is - // compared against each Cloud IAM policy binding, including its members, + // compared against each Cloud IAM policy binding, including its principals, // 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 @@ -961,24 +1032,26 @@ message SearchAllIamPoliciesRequest { // "instance2" and also specify user "amy". // * `roles:roles/compute.admin` to find IAM policy bindings that specify the // Compute Admin role. - // * `memberTypes:user` to find IAM policy bindings that contain the "user" - // member type. + // * `memberTypes:user` to find IAM policy bindings that contain the + // principal type "user". 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]; - // Optional. A list of asset types that the IAM policies are attached to. If empty, it - // will search the IAM policies that are attached to all the [searchable asset + // Optional. A list of asset types that the IAM policies are attached to. If + // empty, it will search the IAM policies that are attached to all the + // [searchable asset // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). // // Regular expressions are also supported. For example: @@ -995,9 +1068,9 @@ message SearchAllIamPoliciesRequest { // supported asset type, an INVALID_ARGUMENT error will be returned. repeated string asset_types = 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. + // 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: "assetType DESC, resource". // Only singular primitive fields in the response are sortable: // * resource @@ -1020,7 +1093,7 @@ message SearchAllIamPoliciesResponse { string next_page_token = 2; } -// ## IAM policy analysis query message. +// IAM policy analysis query message. message IamPolicyAnalysisQuery { // Specifies the resource to analyze for access policies, which may be set // directly on the resource, or on ancestors such as organizations, folders or @@ -1037,7 +1110,7 @@ message IamPolicyAnalysisQuery { // roles assigned either directly to them or to the groups they belong to, // directly or indirectly. message IdentitySelector { - // Required. The identity appear in the form of members in + // Required. The identity appear in the form of principals in // [IAM policy // binding](https://cloud.google.com/iam/reference/rest/v1/Binding). // @@ -1070,9 +1143,13 @@ message IamPolicyAnalysisQuery { // Optional. If true, the identities section of the result will expand any // Google groups appearing in an IAM policy binding. // - // If [IamPolicyAnalysisQuery.identity_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.identity_selector] is specified, the - // identity in the result will be determined by the selector, and this flag - // is not allowed to set. + // If + // [IamPolicyAnalysisQuery.identity_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.identity_selector] + // is specified, the identity in the result will be determined by the + // selector, and this flag is not allowed to set. + // + // If true, the default max expansion per group is 1000 for + // AssetService.AnalyzeIamPolicy][]. // // Default is false. bool expand_groups = 1 [(google.api.field_behavior) = OPTIONAL]; @@ -1080,51 +1157,58 @@ message IamPolicyAnalysisQuery { // Optional. If true, the access section of result will expand any roles // appearing in IAM policy bindings to include their permissions. // - // If [IamPolicyAnalysisQuery.access_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.access_selector] is specified, the access - // section of the result will be determined by the selector, and this flag - // is not allowed to set. + // If + // [IamPolicyAnalysisQuery.access_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.access_selector] + // is specified, the access section of the result will be determined by the + // selector, and this flag is not allowed to set. // // Default is false. bool expand_roles = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. If true and [IamPolicyAnalysisQuery.resource_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.resource_selector] is not - // specified, the resource section of the result will expand any resource - // attached to an IAM policy to include resources lower in the resource - // hierarchy. + // Optional. If true and + // [IamPolicyAnalysisQuery.resource_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.resource_selector] + // is not specified, the resource section of the result will expand any + // resource attached to an IAM policy to include resources lower in the + // resource hierarchy. // // For example, if the request analyzes for which resources user A has // permission P, and the results include an IAM policy with P on a GCP // folder, the results will also include resources in that folder with // permission P. // - // If true and [IamPolicyAnalysisQuery.resource_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.resource_selector] is specified, - // the resource section of the result will expand the specified resource to - // include resources lower in the resource hierarchy. Only project or - // lower resources are supported. Folder and organization resource cannot be - // used together with this option. + // If true and + // [IamPolicyAnalysisQuery.resource_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.resource_selector] + // is specified, the resource section of the result will expand the + // specified resource to include resources lower in the resource hierarchy. + // Only project or lower resources are supported. Folder and organization + // resource cannot be used together with this option. // // For example, if the request analyzes for which users have permission P on // a GCP project with this option enabled, the results will include all // users who have permission P on that project or any lower resource. // + // If true, the default max expansion per resource is 1000 for + // AssetService.AnalyzeIamPolicy][] and 100000 for + // AssetService.AnalyzeIamPolicyLongrunning][]. + // // Default is false. bool expand_resources = 3 [(google.api.field_behavior) = OPTIONAL]; - // Optional. If true, the result will output resource edges, starting - // from the policy attached resource, to any expanded resources. - // Default is false. + // Optional. If true, the result will output the relevant parent/child + // relationships between resources. Default is false. bool output_resource_edges = 4 [(google.api.field_behavior) = OPTIONAL]; - // Optional. If true, the result will output group identity edges, starting - // from the binding's group members, to any expanded identities. - // Default is false. + // Optional. If true, the result will output the relevant membership + // relationships between groups and other groups, and between groups and + // principals. Default is false. bool output_group_edges = 5 [(google.api.field_behavior) = OPTIONAL]; - // Optional. If true, the response will include access analysis from identities to - // resources via service account impersonation. This is a very expensive - // operation, because many derived queries will be executed. We highly - // recommend you use [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning] rpc - // instead. + // Optional. If true, the response will include access analysis from + // identities to resources via service account impersonation. This is a very + // expensive operation, because many derived queries will be executed. We + // highly recommend you use + // [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning] + // rpc instead. // // For example, if the request analyzes for which resources user A has // permission P, and there's an IAM policy states user A has @@ -1142,8 +1226,18 @@ message IamPolicyAnalysisQuery { // F. And those advanced analysis results will be included in // [AnalyzeIamPolicyResponse.service_account_impersonation_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis]. // + // Only the following permissions are considered in this analysis: + // + // * `iam.serviceAccounts.actAs` + // * `iam.serviceAccounts.signBlob` + // * `iam.serviceAccounts.signJwt` + // * `iam.serviceAccounts.getAccessToken` + // * `iam.serviceAccounts.getOpenIdToken` + // * `iam.serviceAccounts.implicitDelegation` + // // Default is false. - bool analyze_service_account_impersonation = 6 [(google.api.field_behavior) = OPTIONAL]; + bool analyze_service_account_impersonation = 6 + [(google.api.field_behavior) = OPTIONAL]; } // The IAM conditions context. @@ -1157,8 +1251,8 @@ message IamPolicyAnalysisQuery { } } - // Required. The relative name of the root asset. Only resources and IAM policies within - // the scope will be analyzed. + // Required. The relative name of the root asset. Only resources and IAM + // policies within the scope will be analyzed. // // This can only be an organization number (such as "organizations/123"), a // folder number (such as "folders/123"), a project ID (such as @@ -1172,10 +1266,12 @@ message IamPolicyAnalysisQuery { string scope = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. Specifies a resource for analysis. - ResourceSelector resource_selector = 2 [(google.api.field_behavior) = OPTIONAL]; + ResourceSelector resource_selector = 2 + [(google.api.field_behavior) = OPTIONAL]; // Optional. Specifies an identity for analysis. - IdentitySelector identity_selector = 3 [(google.api.field_behavior) = OPTIONAL]; + IdentitySelector identity_selector = 3 + [(google.api.field_behavior) = OPTIONAL]; // Optional. Specifies roles or permissions for analysis. This is optional. AccessSelector access_selector = 4 [(google.api.field_behavior) = OPTIONAL]; @@ -1184,15 +1280,37 @@ message IamPolicyAnalysisQuery { Options options = 5 [(google.api.field_behavior) = OPTIONAL]; // Optional. The hypothetical context for IAM conditions evaluation. - ConditionContext condition_context = 6 [(google.api.field_behavior) = OPTIONAL]; + ConditionContext condition_context = 6 + [(google.api.field_behavior) = OPTIONAL]; } -// A request message for [AssetService.AnalyzeIamPolicy][google.cloud.asset.v1.AssetService.AnalyzeIamPolicy]. +// A request message for +// [AssetService.AnalyzeIamPolicy][google.cloud.asset.v1.AssetService.AnalyzeIamPolicy]. message AnalyzeIamPolicyRequest { // Required. The request query. - IamPolicyAnalysisQuery analysis_query = 1 [(google.api.field_behavior) = REQUIRED]; + IamPolicyAnalysisQuery analysis_query = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. The name of a saved query, which must be in the format of: + // + // * projects/project_number/savedQueries/saved_query_id + // * folders/folder_number/savedQueries/saved_query_id + // * organizations/organization_number/savedQueries/saved_query_id + // + // If both `analysis_query` and `saved_analysis_query` are provided, they + // will be merged together with the `saved_analysis_query` as base and + // the `analysis_query` as overrides. For more details of the merge behavior, + // please refer to the + // [MergeFrom](https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details) + // page. + // + // Note that you cannot override primitive fields with default value, such as + // 0 or empty string, etc., because we use proto3, which doesn't support field + // presence yet. + string saved_analysis_query = 3 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Amount of time executable has to complete. See JSON representation of + // Optional. Amount of time executable has to complete. See JSON + // representation of // [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json). // // If this field is set with a value less than the RPC deadline, and the @@ -1202,22 +1320,26 @@ message AnalyzeIamPolicyRequest { // If it's not finished until then, you will get a DEADLINE_EXCEEDED error. // // Default is empty. - google.protobuf.Duration execution_timeout = 2 [(google.api.field_behavior) = OPTIONAL]; + google.protobuf.Duration execution_timeout = 2 + [(google.api.field_behavior) = OPTIONAL]; } -// A response message for [AssetService.AnalyzeIamPolicy][google.cloud.asset.v1.AssetService.AnalyzeIamPolicy]. +// A response message for +// [AssetService.AnalyzeIamPolicy][google.cloud.asset.v1.AssetService.AnalyzeIamPolicy]. message AnalyzeIamPolicyResponse { // An analysis message to group the query and results. message IamPolicyAnalysis { // The analysis query. IamPolicyAnalysisQuery analysis_query = 1; - // A list of [IamPolicyAnalysisResult][google.cloud.asset.v1.IamPolicyAnalysisResult] that matches the analysis query, or - // empty if no result is found. + // A list of + // [IamPolicyAnalysisResult][google.cloud.asset.v1.IamPolicyAnalysisResult] + // that matches the analysis query, or empty if no result is found. repeated IamPolicyAnalysisResult analysis_results = 2; - // Represents whether all entries in the [analysis_results][google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.analysis_results] have been - // fully explored to answer the query. + // Represents whether all entries in the + // [analysis_results][google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.analysis_results] + // have been fully explored to answer the query. bool fully_explored = 3; // A list of non-critical errors happened during the query handling. @@ -1232,9 +1354,11 @@ message AnalyzeIamPolicyResponse { // enabled. repeated IamPolicyAnalysis service_account_impersonation_analysis = 2; - // Represents whether all entries in the [main_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.main_analysis] and - // [service_account_impersonation_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis] have been fully explored to - // answer the query in the request. + // Represents whether all entries in the + // [main_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.main_analysis] + // and + // [service_account_impersonation_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis] + // have been fully explored to answer the query in the request. bool fully_explored = 3; } @@ -1242,8 +1366,8 @@ message AnalyzeIamPolicyResponse { message IamPolicyAnalysisOutputConfig { // A Cloud Storage location. message GcsDestination { - // Required. The uri of the Cloud Storage object. It's the same uri that is used by - // gsutil. Example: "gs://bucket_name/object_name". See [Viewing and + // Required. The uri of the Cloud Storage object. It's the same uri that is + // used by gsutil. Example: "gs://bucket_name/object_name". See [Viewing and // Editing Object // Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) // for more information. @@ -1271,13 +1395,15 @@ message IamPolicyAnalysisOutputConfig { REQUEST_TIME = 1; } - // Required. The BigQuery dataset in format "projects/projectId/datasets/datasetId", - // to which the analysis results should be exported. If this dataset does - // not exist, the export call will return an INVALID_ARGUMENT error. + // Required. The BigQuery dataset in format + // "projects/projectId/datasets/datasetId", to which the analysis results + // should be exported. If this dataset does not exist, the export call will + // return an INVALID_ARGUMENT error. string dataset = 1 [(google.api.field_behavior) = REQUIRED]; - // Required. The prefix of the BigQuery tables to which the analysis results will be - // written. Tables will be created based on this table_prefix if not exist: + // Required. The prefix of the BigQuery tables to which the analysis results + // will be written. Tables will be created based on this table_prefix if not + // exist: // * _analysis table will contain export operation's metadata. // * _analysis_result will contain all the // [IamPolicyAnalysisResult][google.cloud.asset.v1.IamPolicyAnalysisResult]. @@ -1288,8 +1414,8 @@ message IamPolicyAnalysisOutputConfig { // The partition key for BigQuery partitioned table. PartitionKey partition_key = 3; - // Optional. Specifies the action that occurs if the destination table or partition - // already exists. The following values are supported: + // Optional. Specifies the action that occurs if the destination table or + // partition already exists. The following values are supported: // // * WRITE_TRUNCATE: If the table or partition already exists, BigQuery // overwrites the entire table or all the partitions data. @@ -1314,18 +1440,219 @@ message IamPolicyAnalysisOutputConfig { } } -// A request message for [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning]. +// A request message for +// [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning]. message AnalyzeIamPolicyLongrunningRequest { // Required. The request query. - IamPolicyAnalysisQuery analysis_query = 1 [(google.api.field_behavior) = REQUIRED]; + IamPolicyAnalysisQuery analysis_query = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. The name of a saved query, which must be in the format of: + // + // * projects/project_number/savedQueries/saved_query_id + // * folders/folder_number/savedQueries/saved_query_id + // * organizations/organization_number/savedQueries/saved_query_id + // + // If both `analysis_query` and `saved_analysis_query` are provided, they + // will be merged together with the `saved_analysis_query` as base and + // the `analysis_query` as overrides. For more details of the merge behavior, + // please refer to the + // [MergeFrom](https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details) + // doc. + // + // Note that you cannot override primitive fields with default value, such as + // 0 or empty string, etc., because we use proto3, which doesn't support field + // presence yet. + string saved_analysis_query = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Output configuration indicating where the results will be output + // to. + IamPolicyAnalysisOutputConfig output_config = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// A response message for +// [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning]. +message AnalyzeIamPolicyLongrunningResponse {} + +// A saved query which can be shared with others or used later. +message SavedQuery { + option (google.api.resource) = { + type: "cloudasset.googleapis.com/SavedQuery" + pattern: "projects/{project}/savedQueries/{saved_query}" + pattern: "folders/{folder}/savedQueries/{saved_query}" + pattern: "organizations/{organization}/savedQueries/{saved_query}" + }; + + // The query content. + message QueryContent { + oneof query_content { + // An IAM Policy Analysis query, which could be used in + // the + // [AssetService.AnalyzeIamPolicy][google.cloud.asset.v1.AssetService.AnalyzeIamPolicy] + // rpc or the + // [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning] + // rpc. + IamPolicyAnalysisQuery iam_policy_analysis_query = 1; + } + } + + // The resource name of the saved query. The format must be: + // + // * projects/project_number/savedQueries/saved_query_id + // * folders/folder_number/savedQueries/saved_query_id + // * organizations/organization_number/savedQueries/saved_query_id + string name = 1; + + // The description of this saved query. This value should be fewer than 255 + // characters. + string description = 2; + + // Output only. The create time of this saved query. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The account's email address who has created this saved query. + string creator = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last update time of this saved query. + google.protobuf.Timestamp last_update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The account's email address who has updated this saved query + // most recently. + string last_updater = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels applied on the resource. + // This value should not contain more than 10 entries. The key and value of + // each entry must be non-empty and fewer than 64 characters. + map labels = 7; + + // The query content. + QueryContent content = 8; +} + +// Request to create a saved query. +message CreateSavedQueryRequest { + // Required. The name of the project/folder/organization where this + // saved_query should be created in. It can only be an organization number + // (such as "organizations/123"), a folder number (such as "folders/123"), a + // project ID (such as "projects/my-project-id")", or a project number (such + // as "projects/12345"). + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudasset.googleapis.com/SavedQuery" + } + ]; + + // Required. The saved_query details. The `name` field must be empty as it + // will be generated based on the parent and saved_query_id. + SavedQuery saved_query = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. Output configuration indicating where the results will be output to. - IamPolicyAnalysisOutputConfig output_config = 2 [(google.api.field_behavior) = REQUIRED]; + // Required. The ID to use for the saved query, which must be unique in the + // specified parent. It will become the final component of the saved query's + // resource name. + // + // This value should be 4-63 characters, and valid characters + // are /[a-z][0-9]-/. + // + // Notice that this field is required in the saved query creation, and the + // `name` field of the `saved_query` will be ignored. + string saved_query_id = 3 [(google.api.field_behavior) = REQUIRED]; } -// A response message for [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning]. -message AnalyzeIamPolicyLongrunningResponse { +// Request to get a saved query. +message GetSavedQueryRequest { + // Required. The name of the saved query and it must be in the format of: + // + // * projects/project_number/savedQueries/saved_query_id + // * folders/folder_number/savedQueries/saved_query_id + // * organizations/organization_number/savedQueries/saved_query_id + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudasset.googleapis.com/SavedQuery" + } + ]; +} +// Request to list saved queries. +message ListSavedQueriesRequest { + // Required. The parent project/folder/organization whose savedQueries are to + // be listed. It can only be using project/folder/organization number (such as + // "folders/12345")", or a project ID (such as "projects/my-project-id"). + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudasset.googleapis.com/SavedQuery" + } + ]; + + // Optional. The expression to filter resources. + // The expression is a list of zero or more restrictions combined via logical + // operators `AND` and `OR`. When `AND` and `OR` are both used in the + // expression, parentheses must be appropriately used to group the + // combinations. The expression may also contain regular expressions. + // + // See https://google.aip.dev/160 for more information on the grammar. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of saved queries to return per page. The + // service may return fewer than this value. If unspecified, at most 50 will + // be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListSavedQueries` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListSavedQueries` must + // match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response of listing saved queries. +message ListSavedQueriesResponse { + // A list of savedQueries. + repeated SavedQuery saved_queries = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request to update a saved query. +message UpdateSavedQueryRequest { + // Required. The saved query to update. + // + // The saved query's `name` field is used to identify the one to update, + // which has format as below: + // + // * projects/project_number/savedQueries/saved_query_id + // * folders/folder_number/savedQueries/saved_query_id + // * organizations/organization_number/savedQueries/saved_query_id + SavedQuery saved_query = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request to delete a saved query. +message DeleteSavedQueryRequest { + // Required. The name of the saved query to delete. It must be in the format + // of: + // + // * projects/project_number/savedQueries/saved_query_id + // * folders/folder_number/savedQueries/saved_query_id + // * organizations/organization_number/savedQueries/saved_query_id + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudasset.googleapis.com/SavedQuery" + } + ]; } // The request message for performing resource move analysis. @@ -1426,3 +1753,91 @@ enum ContentType { // The related resources. RELATIONSHIP = 7; } + +// A request message for +// [AssetService.BatchGetEffectiveIamPolicies][google.cloud.asset.v1.AssetService.BatchGetEffectiveIamPolicies]. +message BatchGetEffectiveIamPoliciesRequest { + // Required. Only IAM policies on or below the scope will be returned. + // + // This can only be an organization number (such as "organizations/123"), a + // folder number (such as "folders/123"), a project ID (such as + // "projects/my-project-id"), or a project number (such as "projects/12345"). + // + // To know how to get organization id, visit [here + // ](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). + // + // To know how to get folder or project id, visit [here + // ](https://cloud.google.com/resource-manager/docs/creating-managing-folders#viewing_or_listing_folders_and_projects). + string scope = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { child_type: "*" } + ]; + + // Required. The names refer to the [full_resource_names] + // (https://cloud.google.com/asset-inventory/docs/resource-name-format) + // of [searchable asset + // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). + // A maximum of 20 resources' effective policies can be retrieved in a batch. + repeated string names = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "*" } + ]; +} + +// A response message for +// [AssetService.BatchGetEffectiveIamPolicies][google.cloud.asset.v1.AssetService.BatchGetEffectiveIamPolicies]. +message BatchGetEffectiveIamPoliciesResponse { + // The effective IAM policies on one resource. + message EffectiveIamPolicy { + // The IAM policy and its attached resource. + message PolicyInfo { + // The full resource name the + // [policy][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.policy] + // is directly attached to. + string attached_resource = 1; + + // The IAM policy that's directly attached to the + // [attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource]. + google.iam.v1.Policy policy = 2; + } + + // The [full_resource_name] + // (https://cloud.google.com/asset-inventory/docs/resource-name-format) + // for which the + // [policies][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.policies] + // are computed. This is one of the + // [BatchGetEffectiveIamPoliciesRequest.names][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.names] + // the caller provides in the request. + string full_resource_name = 1; + + // The effective policies for the + // [full_resource_name][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.full_resource_name]. + // + // These policies include the policy set on the + // [full_resource_name][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.full_resource_name] + // and those set on its parents and ancestors up to the + // [BatchGetEffectiveIamPoliciesRequest.scope][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.scope]. + // Note that these policies are not filtered according to the resource type + // of the + // [full_resource_name][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.full_resource_name]. + // + // These policies are hierarchically ordered by + // [PolicyInfo.attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource] + // starting from + // [full_resource_name][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.full_resource_name] + // itself to its parents and ancestors, such that policies[i]'s + // [PolicyInfo.attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource] + // is the child of policies[i+1]'s + // [PolicyInfo.attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource], + // if policies[i+1] exists. + repeated PolicyInfo policies = 2; + } + + // The effective policies for a batch of resources. Note that the results + // order is the same as the order of + // [BatchGetEffectiveIamPoliciesRequest.names][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.names]. + // When a resource does not have any effective IAM policies, its corresponding + // policy_result will contain empty + // [EffectiveIamPolicy.policies][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.policies]. + repeated EffectiveIamPolicy policy_results = 2; +} 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 3d433b8f3fe..ebc093ca388 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 @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,18 +16,17 @@ syntax = "proto3"; package google.cloud.asset.v1; +import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/orgpolicy/v1/orgpolicy.proto"; +import "google/cloud/osconfig/v1/inventory.proto"; import "google/iam/v1/policy.proto"; import "google/identity/accesscontextmanager/v1/access_level.proto"; import "google/identity/accesscontextmanager/v1/access_policy.proto"; -import "google/cloud/osconfig/v1/inventory.proto"; import "google/identity/accesscontextmanager/v1/service_perimeter.proto"; -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"; @@ -152,7 +151,8 @@ 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; } // A representation of runtime OS Inventory information. See [this @@ -160,9 +160,15 @@ message Asset { // for more information. google.cloud.osconfig.v1.Inventory os_inventory = 12; - // The related assets of the asset of one relationship type. - // One asset only represents one type of relationship. - RelatedAssets related_assets = 13; + // DEPRECATED. This field only presents for the purpose of + // backward-compatibility. The server will never generate responses with this + // field. + // The related assets of the asset of one relationship type. One asset + // only represents one type of relationship. + RelatedAssets related_assets = 13 [deprecated = true]; + + // One related asset of the current asset. + RelatedAsset related_asset = 15; // The ancestry path of an asset in Google Cloud [resource // hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), @@ -225,8 +231,13 @@ message Resource { string location = 8; } +// DEPRECATED. This message only presents for the purpose of +// backward-compatibility. The server will never populate this message in +// responses. // The detailed related assets with the `relationship_type`. message RelatedAssets { + option deprecated = true; + // The detailed relationship attributes. RelationshipAttributes relationship_attributes = 1; @@ -234,9 +245,14 @@ message RelatedAssets { repeated RelatedAsset assets = 2; } +// DEPRECATED. This message only presents for the purpose of +// backward-compatibility. The server will never populate this message in +// responses. // The relationship attributes which include `type`, `source_resource_type`, // `target_resource_type` and `action`. message RelationshipAttributes { + option deprecated = true; + // The unique identifier of the relationship type. Example: // `INSTANCE_TO_INSTANCEGROUP` string type = 4; @@ -251,7 +267,7 @@ message RelationshipAttributes { string action = 3; } -// An asset identify in Google Cloud which contains its name, type and +// An asset identifier in Google Cloud which contains its name, type and // ancestors. An asset can be any resource in the Google Cloud [resource // hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), // a resource outside the Google Cloud resource hierarchy (such as Google @@ -267,8 +283,8 @@ message RelatedAsset { // names](https://cloud.google.com/apis/design/resource_names#full_resource_name) // for more information. string asset = 1 [(google.api.resource_reference) = { - type: "cloudasset.googleapis.com/Asset" - }]; + type: "cloudasset.googleapis.com/Asset" + }]; // The type of the asset. Example: `compute.googleapis.com/Disk` // @@ -284,6 +300,10 @@ message RelatedAsset { // // Example: `["projects/123456789", "folders/5432", "organizations/1234"]` repeated string ancestors = 3; + + // The unique identifier of the relationship type. Example: + // `INSTANCE_TO_INSTANCEGROUP` + string relationship_type = 4; } // A result of Resource Search, containing information of a cloud resource. @@ -341,7 +361,7 @@ message ResourceSearchResult { string organization = 18; // The display name of this resource. This field is available only when the - // resource's proto contains it. + // resource's Protobuf contains it. // // To search against the `display_name`: // @@ -351,7 +371,7 @@ message ResourceSearchResult { // One or more paragraphs of text description of this resource. Maximum length // could be up to 1M bytes. This field is available only when the resource's - // proto contains it. + // Protobuf contains it. // // To search against the `description`: // @@ -360,7 +380,7 @@ message ResourceSearchResult { string description = 5; // Location can be `global`, regional like `us-east1`, or zonal like - // `us-west1-b`. This field is available only when the resource's proto + // `us-west1-b`. This field is available only when the resource's Protobuf // contains it. // // To search against the `location`: @@ -372,7 +392,7 @@ message ResourceSearchResult { // Labels associated with this resource. See [Labelling and grouping GCP // resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources) // for more information. This field is available only when the resource's - // proto contains it. + // Protobuf contains it. // // To search against the `labels`: // @@ -387,7 +407,7 @@ message ResourceSearchResult { // type of annotations used to group GCP resources. See [Labelling GCP // resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources) // for more information. This field is available only when the resource's - // proto contains it. + // Protobuf contains it. // // To search against the `network_tags`: // @@ -396,10 +416,11 @@ message ResourceSearchResult { repeated string network_tags = 8; // The Cloud KMS - // [CryptoKey](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys?hl=en) + // [CryptoKey](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys) // name or - // [CryptoKeyVersion](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions?hl=en) - // name. This field is available only when the resource's proto contains it. + // [CryptoKeyVersion](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions) + // name. This field is available only when the resource's Protobuf contains + // it. // // To search against the `kms_key`: // @@ -409,7 +430,7 @@ message ResourceSearchResult { // The create timestamp of this resource, at which the resource was created. // The granularity is in seconds. Timestamp.nanos will always be 0. This field - // is available only when the resource's proto contains it. + // is available only when the resource's Protobuf contains it. // // To search against `create_time`: // @@ -422,7 +443,7 @@ message ResourceSearchResult { // The last update timestamp of this resource, at which the resource was last // modified or deleted. The granularity is in seconds. Timestamp.nanos will - // always be 0. This field is available only when the resource's proto + // always be 0. This field is available only when the resource's Protobuf // contains it. // // To search against `update_time`: @@ -436,7 +457,8 @@ message ResourceSearchResult { // The state of this resource. Different resources types have different state // definitions that are mapped from various fields of different resource - // types. This field is available only when the resource's proto contains it. + // types. This field is available only when the resource's Protobuf contains + // it. // // Example: // If the resource is an instance provided by Compute Engine, @@ -511,6 +533,43 @@ message ResourceSearchResult { // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#supported_relationship_types). map relationships = 21; + // TagKey namespaced names, in the format of {ORG_ID}/{TAG_KEY_SHORT_NAME}. + // To search against the `tagKeys`: + // + // * use a field query. Example: + // - `tagKeys:"123456789/env*"` + // - `tagKeys="123456789/env"` + // - `tagKeys:"env"` + // + // * use a free text query. Example: + // - `env` + repeated string tag_keys = 23; + + // TagValue namespaced names, in the format of + // {ORG_ID}/{TAG_KEY_SHORT_NAME}/{TAG_VALUE_SHORT_NAME}. + // To search against the `tagValues`: + // + // * use a field query. Example: + // - `tagValues:"env"` + // - `tagValues:"env/prod"` + // - `tagValues:"123456789/env/prod*"` + // - `tagValues="123456789/env/prod"` + // + // * use a free text query. Example: + // - `prod` + repeated string tag_values = 25; + + // TagValue IDs, in the format of tagValues/{TAG_VALUE_ID}. + // To search against the `tagValueIds`: + // + // * use a field query. Example: + // - `tagValueIds:"456"` + // - `tagValueIds="tagValues/456"` + // + // * use a free text query. Example: + // - `456` + repeated string tag_value_ids = 26; + // The type of this resource's immediate parent, if there is one. // // To search against the `parent_asset_type`: @@ -798,8 +857,10 @@ message IamPolicyAnalysisResult { repeated Access accesses = 2; // Resource edges of the graph starting from the policy attached - // resource to any descendant resources. The [Edge.source_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.source_node] contains - // the full resource name of a parent resource and [Edge.target_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.target_node] + // resource to any descendant resources. The + // [Edge.source_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.source_node] + // contains the full resource name of a parent resource and + // [Edge.target_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.target_node] // contains the full resource name of a child resource. This field is // present only if the output_resource_edges option is enabled in request. repeated Edge resource_edges = 3; @@ -818,32 +879,41 @@ message IamPolicyAnalysisResult { repeated Identity identities = 1; // Group identity edges of the graph starting from the binding's - // group members to any node of the [identities][google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.identities]. The [Edge.source_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.source_node] + // group members to any node of the + // [identities][google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.identities]. + // The + // [Edge.source_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.source_node] // contains a group, such as `group:parent@google.com`. The - // [Edge.target_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.target_node] contains a member of the group, - // such as `group:child@google.com` or `user:foo@google.com`. - // This field is present only if the output_group_edges option is enabled in - // request. + // [Edge.target_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.target_node] + // contains a member of the group, such as `group:child@google.com` or + // `user:foo@google.com`. This field is present only if the + // output_group_edges option is enabled in request. repeated Edge group_edges = 2; } // The [full resource // name](https://cloud.google.com/asset-inventory/docs/resource-name-format) - // of the resource to which the [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] policy attaches. + // of the resource to which the + // [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] + // policy attaches. string attached_resource_full_name = 1; // The Cloud IAM policy binding under analysis. google.iam.v1.Binding iam_binding = 2; - // The access control lists derived from the [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] that match or - // potentially match resource and access selectors specified in the request. + // The access control lists derived from the + // [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] + // that match or potentially match resource and access selectors specified in + // the request. repeated AccessControlList access_control_lists = 3; - // The identity list derived from members of the [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] that match or - // potentially match identity selector specified in the request. + // The identity list derived from members of the + // [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] + // that match or potentially match identity selector specified in the request. IdentityList identity_list = 4; - // Represents whether all analyses on the [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] have successfully - // finished. + // Represents whether all analyses on the + // [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] + // have successfully finished. bool fully_explored = 5; } diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index f58eeafa203..9e8aa4d040e 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -227,6 +227,90 @@ export namespace google { * @returns Promise */ public analyzeMove(request: google.cloud.asset.v1.IAnalyzeMoveRequest): Promise; + + /** + * Calls CreateSavedQuery. + * @param request CreateSavedQueryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SavedQuery + */ + public createSavedQuery(request: google.cloud.asset.v1.ICreateSavedQueryRequest, callback: google.cloud.asset.v1.AssetService.CreateSavedQueryCallback): void; + + /** + * Calls CreateSavedQuery. + * @param request CreateSavedQueryRequest message or plain object + * @returns Promise + */ + public createSavedQuery(request: google.cloud.asset.v1.ICreateSavedQueryRequest): Promise; + + /** + * Calls GetSavedQuery. + * @param request GetSavedQueryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SavedQuery + */ + public getSavedQuery(request: google.cloud.asset.v1.IGetSavedQueryRequest, callback: google.cloud.asset.v1.AssetService.GetSavedQueryCallback): void; + + /** + * Calls GetSavedQuery. + * @param request GetSavedQueryRequest message or plain object + * @returns Promise + */ + public getSavedQuery(request: google.cloud.asset.v1.IGetSavedQueryRequest): Promise; + + /** + * Calls ListSavedQueries. + * @param request ListSavedQueriesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSavedQueriesResponse + */ + public listSavedQueries(request: google.cloud.asset.v1.IListSavedQueriesRequest, callback: google.cloud.asset.v1.AssetService.ListSavedQueriesCallback): void; + + /** + * Calls ListSavedQueries. + * @param request ListSavedQueriesRequest message or plain object + * @returns Promise + */ + public listSavedQueries(request: google.cloud.asset.v1.IListSavedQueriesRequest): Promise; + + /** + * Calls UpdateSavedQuery. + * @param request UpdateSavedQueryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SavedQuery + */ + public updateSavedQuery(request: google.cloud.asset.v1.IUpdateSavedQueryRequest, callback: google.cloud.asset.v1.AssetService.UpdateSavedQueryCallback): void; + + /** + * Calls UpdateSavedQuery. + * @param request UpdateSavedQueryRequest message or plain object + * @returns Promise + */ + public updateSavedQuery(request: google.cloud.asset.v1.IUpdateSavedQueryRequest): Promise; + + /** + * Calls DeleteSavedQuery. + * @param request DeleteSavedQueryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteSavedQuery(request: google.cloud.asset.v1.IDeleteSavedQueryRequest, callback: google.cloud.asset.v1.AssetService.DeleteSavedQueryCallback): void; + + /** + * Calls DeleteSavedQuery. + * @param request DeleteSavedQueryRequest message or plain object + * @returns Promise + */ + public deleteSavedQuery(request: google.cloud.asset.v1.IDeleteSavedQueryRequest): Promise; + + /** + * Calls BatchGetEffectiveIamPolicies. + * @param request BatchGetEffectiveIamPoliciesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchGetEffectiveIamPoliciesResponse + */ + public batchGetEffectiveIamPolicies(request: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest, callback: google.cloud.asset.v1.AssetService.BatchGetEffectiveIamPoliciesCallback): void; + + /** + * Calls BatchGetEffectiveIamPolicies. + * @param request BatchGetEffectiveIamPoliciesRequest message or plain object + * @returns Promise + */ + public batchGetEffectiveIamPolicies(request: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest): Promise; } namespace AssetService { @@ -321,6 +405,48 @@ export namespace google { * @param [response] AnalyzeMoveResponse */ type AnalyzeMoveCallback = (error: (Error|null), response?: google.cloud.asset.v1.AnalyzeMoveResponse) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#createSavedQuery}. + * @param error Error, if any + * @param [response] SavedQuery + */ + type CreateSavedQueryCallback = (error: (Error|null), response?: google.cloud.asset.v1.SavedQuery) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#getSavedQuery}. + * @param error Error, if any + * @param [response] SavedQuery + */ + type GetSavedQueryCallback = (error: (Error|null), response?: google.cloud.asset.v1.SavedQuery) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#listSavedQueries}. + * @param error Error, if any + * @param [response] ListSavedQueriesResponse + */ + type ListSavedQueriesCallback = (error: (Error|null), response?: google.cloud.asset.v1.ListSavedQueriesResponse) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#updateSavedQuery}. + * @param error Error, if any + * @param [response] SavedQuery + */ + type UpdateSavedQueryCallback = (error: (Error|null), response?: google.cloud.asset.v1.SavedQuery) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#deleteSavedQuery}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteSavedQueryCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#batchGetEffectiveIamPolicies}. + * @param error Error, if any + * @param [response] BatchGetEffectiveIamPoliciesResponse + */ + type BatchGetEffectiveIamPoliciesCallback = (error: (Error|null), response?: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse) => void; } /** Properties of an AnalyzeIamPolicyLongrunningMetadata. */ @@ -3585,6 +3711,9 @@ export namespace google { /** AnalyzeIamPolicyRequest analysisQuery */ analysisQuery?: (google.cloud.asset.v1.IIamPolicyAnalysisQuery|null); + /** AnalyzeIamPolicyRequest savedAnalysisQuery */ + savedAnalysisQuery?: (string|null); + /** AnalyzeIamPolicyRequest executionTimeout */ executionTimeout?: (google.protobuf.IDuration|null); } @@ -3601,6 +3730,9 @@ export namespace google { /** AnalyzeIamPolicyRequest analysisQuery. */ public analysisQuery?: (google.cloud.asset.v1.IIamPolicyAnalysisQuery|null); + /** AnalyzeIamPolicyRequest savedAnalysisQuery. */ + public savedAnalysisQuery: string; + /** AnalyzeIamPolicyRequest executionTimeout. */ public executionTimeout?: (google.protobuf.IDuration|null); @@ -4203,6 +4335,9 @@ export namespace google { /** AnalyzeIamPolicyLongrunningRequest analysisQuery */ analysisQuery?: (google.cloud.asset.v1.IIamPolicyAnalysisQuery|null); + /** AnalyzeIamPolicyLongrunningRequest savedAnalysisQuery */ + savedAnalysisQuery?: (string|null); + /** AnalyzeIamPolicyLongrunningRequest outputConfig */ outputConfig?: (google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig|null); } @@ -4219,6 +4354,9 @@ export namespace google { /** AnalyzeIamPolicyLongrunningRequest analysisQuery. */ public analysisQuery?: (google.cloud.asset.v1.IIamPolicyAnalysisQuery|null); + /** AnalyzeIamPolicyLongrunningRequest savedAnalysisQuery. */ + public savedAnalysisQuery: string; + /** AnalyzeIamPolicyLongrunningRequest outputConfig. */ public outputConfig?: (google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig|null); @@ -4377,2627 +4515,3851 @@ export namespace google { public toJSON(): { [k: string]: any }; } - /** Properties of an AnalyzeMoveRequest. */ - interface IAnalyzeMoveRequest { + /** Properties of a SavedQuery. */ + interface ISavedQuery { - /** AnalyzeMoveRequest resource */ - resource?: (string|null); + /** SavedQuery name */ + name?: (string|null); - /** AnalyzeMoveRequest destinationParent */ - destinationParent?: (string|null); + /** SavedQuery description */ + description?: (string|null); - /** AnalyzeMoveRequest view */ - view?: (google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView|keyof typeof google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView|null); + /** SavedQuery createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** SavedQuery creator */ + creator?: (string|null); + + /** SavedQuery lastUpdateTime */ + lastUpdateTime?: (google.protobuf.ITimestamp|null); + + /** SavedQuery lastUpdater */ + lastUpdater?: (string|null); + + /** SavedQuery labels */ + labels?: ({ [k: string]: string }|null); + + /** SavedQuery content */ + content?: (google.cloud.asset.v1.SavedQuery.IQueryContent|null); } - /** Represents an AnalyzeMoveRequest. */ - class AnalyzeMoveRequest implements IAnalyzeMoveRequest { + /** Represents a SavedQuery. */ + class SavedQuery implements ISavedQuery { /** - * Constructs a new AnalyzeMoveRequest. + * Constructs a new SavedQuery. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IAnalyzeMoveRequest); + constructor(properties?: google.cloud.asset.v1.ISavedQuery); - /** AnalyzeMoveRequest resource. */ - public resource: string; + /** SavedQuery name. */ + public name: string; - /** AnalyzeMoveRequest destinationParent. */ - public destinationParent: string; + /** SavedQuery description. */ + public description: string; - /** AnalyzeMoveRequest view. */ - public view: (google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView|keyof typeof google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView); + /** SavedQuery createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** SavedQuery creator. */ + public creator: string; + + /** SavedQuery lastUpdateTime. */ + public lastUpdateTime?: (google.protobuf.ITimestamp|null); + + /** SavedQuery lastUpdater. */ + public lastUpdater: string; + + /** SavedQuery labels. */ + public labels: { [k: string]: string }; + + /** SavedQuery content. */ + public content?: (google.cloud.asset.v1.SavedQuery.IQueryContent|null); /** - * Creates a new AnalyzeMoveRequest instance using the specified properties. + * Creates a new SavedQuery instance using the specified properties. * @param [properties] Properties to set - * @returns AnalyzeMoveRequest instance + * @returns SavedQuery instance */ - public static create(properties?: google.cloud.asset.v1.IAnalyzeMoveRequest): google.cloud.asset.v1.AnalyzeMoveRequest; + public static create(properties?: google.cloud.asset.v1.ISavedQuery): google.cloud.asset.v1.SavedQuery; /** - * Encodes the specified AnalyzeMoveRequest message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveRequest.verify|verify} messages. - * @param message AnalyzeMoveRequest message or plain object to encode + * Encodes the specified SavedQuery message. Does not implicitly {@link google.cloud.asset.v1.SavedQuery.verify|verify} messages. + * @param message SavedQuery message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IAnalyzeMoveRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.ISavedQuery, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AnalyzeMoveRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveRequest.verify|verify} messages. - * @param message AnalyzeMoveRequest message or plain object to encode + * Encodes the specified SavedQuery message, length delimited. Does not implicitly {@link google.cloud.asset.v1.SavedQuery.verify|verify} messages. + * @param message SavedQuery message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IAnalyzeMoveRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.ISavedQuery, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AnalyzeMoveRequest message from the specified reader or buffer. + * Decodes a SavedQuery message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AnalyzeMoveRequest + * @returns SavedQuery * @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.AnalyzeMoveRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.SavedQuery; /** - * Decodes an AnalyzeMoveRequest message from the specified reader or buffer, length delimited. + * Decodes a SavedQuery message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AnalyzeMoveRequest + * @returns SavedQuery * @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.AnalyzeMoveRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.SavedQuery; /** - * Verifies an AnalyzeMoveRequest message. + * Verifies a SavedQuery 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 AnalyzeMoveRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SavedQuery message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AnalyzeMoveRequest + * @returns SavedQuery */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeMoveRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.SavedQuery; /** - * Creates a plain object from an AnalyzeMoveRequest message. Also converts values to other types if specified. - * @param message AnalyzeMoveRequest + * Creates a plain object from a SavedQuery message. Also converts values to other types if specified. + * @param message SavedQuery * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.AnalyzeMoveRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.SavedQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AnalyzeMoveRequest to JSON. + * Converts this SavedQuery to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace AnalyzeMoveRequest { + namespace SavedQuery { - /** AnalysisView enum. */ - enum AnalysisView { - ANALYSIS_VIEW_UNSPECIFIED = 0, - FULL = 1, - BASIC = 2 + /** Properties of a QueryContent. */ + interface IQueryContent { + + /** QueryContent iamPolicyAnalysisQuery */ + iamPolicyAnalysisQuery?: (google.cloud.asset.v1.IIamPolicyAnalysisQuery|null); + } + + /** Represents a QueryContent. */ + class QueryContent implements IQueryContent { + + /** + * Constructs a new QueryContent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.SavedQuery.IQueryContent); + + /** QueryContent iamPolicyAnalysisQuery. */ + public iamPolicyAnalysisQuery?: (google.cloud.asset.v1.IIamPolicyAnalysisQuery|null); + + /** QueryContent queryContent. */ + public queryContent?: "iamPolicyAnalysisQuery"; + + /** + * Creates a new QueryContent instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryContent instance + */ + public static create(properties?: google.cloud.asset.v1.SavedQuery.IQueryContent): google.cloud.asset.v1.SavedQuery.QueryContent; + + /** + * Encodes the specified QueryContent message. Does not implicitly {@link google.cloud.asset.v1.SavedQuery.QueryContent.verify|verify} messages. + * @param message QueryContent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.SavedQuery.IQueryContent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryContent message, length delimited. Does not implicitly {@link google.cloud.asset.v1.SavedQuery.QueryContent.verify|verify} messages. + * @param message QueryContent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.SavedQuery.IQueryContent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryContent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryContent + * @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.SavedQuery.QueryContent; + + /** + * Decodes a QueryContent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryContent + * @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.SavedQuery.QueryContent; + + /** + * Verifies a QueryContent 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 QueryContent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryContent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.SavedQuery.QueryContent; + + /** + * Creates a plain object from a QueryContent message. Also converts values to other types if specified. + * @param message QueryContent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.SavedQuery.QueryContent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryContent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; } } - /** Properties of an AnalyzeMoveResponse. */ - interface IAnalyzeMoveResponse { + /** Properties of a CreateSavedQueryRequest. */ + interface ICreateSavedQueryRequest { - /** AnalyzeMoveResponse moveAnalysis */ - moveAnalysis?: (google.cloud.asset.v1.IMoveAnalysis[]|null); + /** CreateSavedQueryRequest parent */ + parent?: (string|null); + + /** CreateSavedQueryRequest savedQuery */ + savedQuery?: (google.cloud.asset.v1.ISavedQuery|null); + + /** CreateSavedQueryRequest savedQueryId */ + savedQueryId?: (string|null); } - /** Represents an AnalyzeMoveResponse. */ - class AnalyzeMoveResponse implements IAnalyzeMoveResponse { + /** Represents a CreateSavedQueryRequest. */ + class CreateSavedQueryRequest implements ICreateSavedQueryRequest { /** - * Constructs a new AnalyzeMoveResponse. + * Constructs a new CreateSavedQueryRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IAnalyzeMoveResponse); + constructor(properties?: google.cloud.asset.v1.ICreateSavedQueryRequest); - /** AnalyzeMoveResponse moveAnalysis. */ - public moveAnalysis: google.cloud.asset.v1.IMoveAnalysis[]; + /** CreateSavedQueryRequest parent. */ + public parent: string; + + /** CreateSavedQueryRequest savedQuery. */ + public savedQuery?: (google.cloud.asset.v1.ISavedQuery|null); + + /** CreateSavedQueryRequest savedQueryId. */ + public savedQueryId: string; /** - * Creates a new AnalyzeMoveResponse instance using the specified properties. + * Creates a new CreateSavedQueryRequest instance using the specified properties. * @param [properties] Properties to set - * @returns AnalyzeMoveResponse instance + * @returns CreateSavedQueryRequest instance */ - public static create(properties?: google.cloud.asset.v1.IAnalyzeMoveResponse): google.cloud.asset.v1.AnalyzeMoveResponse; + public static create(properties?: google.cloud.asset.v1.ICreateSavedQueryRequest): google.cloud.asset.v1.CreateSavedQueryRequest; /** - * Encodes the specified AnalyzeMoveResponse message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveResponse.verify|verify} messages. - * @param message AnalyzeMoveResponse message or plain object to encode + * Encodes the specified CreateSavedQueryRequest message. Does not implicitly {@link google.cloud.asset.v1.CreateSavedQueryRequest.verify|verify} messages. + * @param message CreateSavedQueryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IAnalyzeMoveResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.ICreateSavedQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AnalyzeMoveResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveResponse.verify|verify} messages. - * @param message AnalyzeMoveResponse message or plain object to encode + * Encodes the specified CreateSavedQueryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.CreateSavedQueryRequest.verify|verify} messages. + * @param message CreateSavedQueryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IAnalyzeMoveResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.ICreateSavedQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AnalyzeMoveResponse message from the specified reader or buffer. + * Decodes a CreateSavedQueryRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AnalyzeMoveResponse + * @returns CreateSavedQueryRequest * @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.AnalyzeMoveResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.CreateSavedQueryRequest; /** - * Decodes an AnalyzeMoveResponse message from the specified reader or buffer, length delimited. + * Decodes a CreateSavedQueryRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AnalyzeMoveResponse + * @returns CreateSavedQueryRequest * @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.AnalyzeMoveResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.CreateSavedQueryRequest; /** - * Verifies an AnalyzeMoveResponse message. + * Verifies a CreateSavedQueryRequest 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 AnalyzeMoveResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CreateSavedQueryRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AnalyzeMoveResponse + * @returns CreateSavedQueryRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeMoveResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.CreateSavedQueryRequest; /** - * Creates a plain object from an AnalyzeMoveResponse message. Also converts values to other types if specified. - * @param message AnalyzeMoveResponse + * Creates a plain object from a CreateSavedQueryRequest message. Also converts values to other types if specified. + * @param message CreateSavedQueryRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.AnalyzeMoveResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.CreateSavedQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AnalyzeMoveResponse to JSON. + * Converts this CreateSavedQueryRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a MoveAnalysis. */ - interface IMoveAnalysis { - - /** MoveAnalysis displayName */ - displayName?: (string|null); - - /** MoveAnalysis analysis */ - analysis?: (google.cloud.asset.v1.IMoveAnalysisResult|null); + /** Properties of a GetSavedQueryRequest. */ + interface IGetSavedQueryRequest { - /** MoveAnalysis error */ - error?: (google.rpc.IStatus|null); + /** GetSavedQueryRequest name */ + name?: (string|null); } - /** Represents a MoveAnalysis. */ - class MoveAnalysis implements IMoveAnalysis { + /** Represents a GetSavedQueryRequest. */ + class GetSavedQueryRequest implements IGetSavedQueryRequest { /** - * Constructs a new MoveAnalysis. + * Constructs a new GetSavedQueryRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IMoveAnalysis); + constructor(properties?: google.cloud.asset.v1.IGetSavedQueryRequest); - /** MoveAnalysis displayName. */ - public displayName: string; + /** GetSavedQueryRequest name. */ + public name: string; - /** MoveAnalysis analysis. */ - public analysis?: (google.cloud.asset.v1.IMoveAnalysisResult|null); - - /** MoveAnalysis error. */ - public error?: (google.rpc.IStatus|null); - - /** MoveAnalysis result. */ - public result?: ("analysis"|"error"); - - /** - * Creates a new MoveAnalysis instance using the specified properties. - * @param [properties] Properties to set - * @returns MoveAnalysis instance - */ - public static create(properties?: google.cloud.asset.v1.IMoveAnalysis): google.cloud.asset.v1.MoveAnalysis; + /** + * Creates a new GetSavedQueryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSavedQueryRequest instance + */ + public static create(properties?: google.cloud.asset.v1.IGetSavedQueryRequest): google.cloud.asset.v1.GetSavedQueryRequest; /** - * Encodes the specified MoveAnalysis message. Does not implicitly {@link google.cloud.asset.v1.MoveAnalysis.verify|verify} messages. - * @param message MoveAnalysis message or plain object to encode + * Encodes the specified GetSavedQueryRequest message. Does not implicitly {@link google.cloud.asset.v1.GetSavedQueryRequest.verify|verify} messages. + * @param message GetSavedQueryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IMoveAnalysis, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IGetSavedQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified MoveAnalysis message, length delimited. Does not implicitly {@link google.cloud.asset.v1.MoveAnalysis.verify|verify} messages. - * @param message MoveAnalysis message or plain object to encode + * Encodes the specified GetSavedQueryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GetSavedQueryRequest.verify|verify} messages. + * @param message GetSavedQueryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IMoveAnalysis, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IGetSavedQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MoveAnalysis message from the specified reader or buffer. + * Decodes a GetSavedQueryRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns MoveAnalysis + * @returns GetSavedQueryRequest * @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.MoveAnalysis; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.GetSavedQueryRequest; /** - * Decodes a MoveAnalysis message from the specified reader or buffer, length delimited. + * Decodes a GetSavedQueryRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MoveAnalysis + * @returns GetSavedQueryRequest * @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.MoveAnalysis; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.GetSavedQueryRequest; /** - * Verifies a MoveAnalysis message. + * Verifies a GetSavedQueryRequest 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 MoveAnalysis message from a plain object. Also converts values to their respective internal types. + * Creates a GetSavedQueryRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MoveAnalysis + * @returns GetSavedQueryRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.MoveAnalysis; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.GetSavedQueryRequest; /** - * Creates a plain object from a MoveAnalysis message. Also converts values to other types if specified. - * @param message MoveAnalysis + * Creates a plain object from a GetSavedQueryRequest message. Also converts values to other types if specified. + * @param message GetSavedQueryRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.MoveAnalysis, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.GetSavedQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MoveAnalysis to JSON. + * Converts this GetSavedQueryRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a MoveAnalysisResult. */ - interface IMoveAnalysisResult { + /** Properties of a ListSavedQueriesRequest. */ + interface IListSavedQueriesRequest { - /** MoveAnalysisResult blockers */ - blockers?: (google.cloud.asset.v1.IMoveImpact[]|null); + /** ListSavedQueriesRequest parent */ + parent?: (string|null); - /** MoveAnalysisResult warnings */ - warnings?: (google.cloud.asset.v1.IMoveImpact[]|null); + /** ListSavedQueriesRequest filter */ + filter?: (string|null); + + /** ListSavedQueriesRequest pageSize */ + pageSize?: (number|null); + + /** ListSavedQueriesRequest pageToken */ + pageToken?: (string|null); } - /** Represents a MoveAnalysisResult. */ - class MoveAnalysisResult implements IMoveAnalysisResult { + /** Represents a ListSavedQueriesRequest. */ + class ListSavedQueriesRequest implements IListSavedQueriesRequest { /** - * Constructs a new MoveAnalysisResult. + * Constructs a new ListSavedQueriesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IMoveAnalysisResult); + constructor(properties?: google.cloud.asset.v1.IListSavedQueriesRequest); - /** MoveAnalysisResult blockers. */ - public blockers: google.cloud.asset.v1.IMoveImpact[]; + /** ListSavedQueriesRequest parent. */ + public parent: string; - /** MoveAnalysisResult warnings. */ - public warnings: google.cloud.asset.v1.IMoveImpact[]; + /** ListSavedQueriesRequest filter. */ + public filter: string; + + /** ListSavedQueriesRequest pageSize. */ + public pageSize: number; + + /** ListSavedQueriesRequest pageToken. */ + public pageToken: string; /** - * Creates a new MoveAnalysisResult instance using the specified properties. + * Creates a new ListSavedQueriesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns MoveAnalysisResult instance + * @returns ListSavedQueriesRequest instance */ - public static create(properties?: google.cloud.asset.v1.IMoveAnalysisResult): google.cloud.asset.v1.MoveAnalysisResult; + public static create(properties?: google.cloud.asset.v1.IListSavedQueriesRequest): google.cloud.asset.v1.ListSavedQueriesRequest; /** - * Encodes the specified MoveAnalysisResult message. Does not implicitly {@link google.cloud.asset.v1.MoveAnalysisResult.verify|verify} messages. - * @param message MoveAnalysisResult message or plain object to encode + * Encodes the specified ListSavedQueriesRequest message. Does not implicitly {@link google.cloud.asset.v1.ListSavedQueriesRequest.verify|verify} messages. + * @param message ListSavedQueriesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IMoveAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IListSavedQueriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified MoveAnalysisResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.MoveAnalysisResult.verify|verify} messages. - * @param message MoveAnalysisResult message or plain object to encode + * Encodes the specified ListSavedQueriesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListSavedQueriesRequest.verify|verify} messages. + * @param message ListSavedQueriesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IMoveAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IListSavedQueriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MoveAnalysisResult message from the specified reader or buffer. + * Decodes a ListSavedQueriesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns MoveAnalysisResult + * @returns ListSavedQueriesRequest * @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.MoveAnalysisResult; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.ListSavedQueriesRequest; /** - * Decodes a MoveAnalysisResult message from the specified reader or buffer, length delimited. + * Decodes a ListSavedQueriesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MoveAnalysisResult + * @returns ListSavedQueriesRequest * @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.MoveAnalysisResult; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.ListSavedQueriesRequest; /** - * Verifies a MoveAnalysisResult message. + * Verifies a ListSavedQueriesRequest 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 MoveAnalysisResult message from a plain object. Also converts values to their respective internal types. + * Creates a ListSavedQueriesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MoveAnalysisResult + * @returns ListSavedQueriesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.MoveAnalysisResult; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ListSavedQueriesRequest; /** - * Creates a plain object from a MoveAnalysisResult message. Also converts values to other types if specified. - * @param message MoveAnalysisResult + * Creates a plain object from a ListSavedQueriesRequest message. Also converts values to other types if specified. + * @param message ListSavedQueriesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.MoveAnalysisResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.ListSavedQueriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MoveAnalysisResult to JSON. + * Converts this ListSavedQueriesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a MoveImpact. */ - interface IMoveImpact { + /** Properties of a ListSavedQueriesResponse. */ + interface IListSavedQueriesResponse { - /** MoveImpact detail */ - detail?: (string|null); + /** ListSavedQueriesResponse savedQueries */ + savedQueries?: (google.cloud.asset.v1.ISavedQuery[]|null); + + /** ListSavedQueriesResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a MoveImpact. */ - class MoveImpact implements IMoveImpact { + /** Represents a ListSavedQueriesResponse. */ + class ListSavedQueriesResponse implements IListSavedQueriesResponse { /** - * Constructs a new MoveImpact. + * Constructs a new ListSavedQueriesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IMoveImpact); + constructor(properties?: google.cloud.asset.v1.IListSavedQueriesResponse); - /** MoveImpact detail. */ - public detail: string; + /** ListSavedQueriesResponse savedQueries. */ + public savedQueries: google.cloud.asset.v1.ISavedQuery[]; + + /** ListSavedQueriesResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new MoveImpact instance using the specified properties. + * Creates a new ListSavedQueriesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns MoveImpact instance + * @returns ListSavedQueriesResponse instance */ - public static create(properties?: google.cloud.asset.v1.IMoveImpact): google.cloud.asset.v1.MoveImpact; + public static create(properties?: google.cloud.asset.v1.IListSavedQueriesResponse): google.cloud.asset.v1.ListSavedQueriesResponse; /** - * Encodes the specified MoveImpact message. Does not implicitly {@link google.cloud.asset.v1.MoveImpact.verify|verify} messages. - * @param message MoveImpact message or plain object to encode + * Encodes the specified ListSavedQueriesResponse message. Does not implicitly {@link google.cloud.asset.v1.ListSavedQueriesResponse.verify|verify} messages. + * @param message ListSavedQueriesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IMoveImpact, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IListSavedQueriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified MoveImpact message, length delimited. Does not implicitly {@link google.cloud.asset.v1.MoveImpact.verify|verify} messages. - * @param message MoveImpact message or plain object to encode + * Encodes the specified ListSavedQueriesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListSavedQueriesResponse.verify|verify} messages. + * @param message ListSavedQueriesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IMoveImpact, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IListSavedQueriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MoveImpact message from the specified reader or buffer. + * Decodes a ListSavedQueriesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns MoveImpact + * @returns ListSavedQueriesResponse * @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.MoveImpact; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.ListSavedQueriesResponse; /** - * Decodes a MoveImpact message from the specified reader or buffer, length delimited. + * Decodes a ListSavedQueriesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MoveImpact + * @returns ListSavedQueriesResponse * @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.MoveImpact; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.ListSavedQueriesResponse; /** - * Verifies a MoveImpact message. + * Verifies a ListSavedQueriesResponse 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 MoveImpact message from a plain object. Also converts values to their respective internal types. + * Creates a ListSavedQueriesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MoveImpact + * @returns ListSavedQueriesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.MoveImpact; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ListSavedQueriesResponse; /** - * Creates a plain object from a MoveImpact message. Also converts values to other types if specified. - * @param message MoveImpact + * Creates a plain object from a ListSavedQueriesResponse message. Also converts values to other types if specified. + * @param message ListSavedQueriesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.MoveImpact, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.ListSavedQueriesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MoveImpact to JSON. + * Converts this ListSavedQueriesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** ContentType enum. */ - enum ContentType { - CONTENT_TYPE_UNSPECIFIED = 0, - RESOURCE = 1, - IAM_POLICY = 2, - ORG_POLICY = 4, - ACCESS_POLICY = 5, - OS_INVENTORY = 6, - RELATIONSHIP = 7 - } - - /** Properties of a TemporalAsset. */ - interface ITemporalAsset { - - /** TemporalAsset window */ - window?: (google.cloud.asset.v1.ITimeWindow|null); - - /** TemporalAsset deleted */ - deleted?: (boolean|null); - - /** TemporalAsset asset */ - asset?: (google.cloud.asset.v1.IAsset|null); + /** Properties of an UpdateSavedQueryRequest. */ + interface IUpdateSavedQueryRequest { - /** TemporalAsset priorAssetState */ - priorAssetState?: (google.cloud.asset.v1.TemporalAsset.PriorAssetState|keyof typeof google.cloud.asset.v1.TemporalAsset.PriorAssetState|null); + /** UpdateSavedQueryRequest savedQuery */ + savedQuery?: (google.cloud.asset.v1.ISavedQuery|null); - /** TemporalAsset priorAsset */ - priorAsset?: (google.cloud.asset.v1.IAsset|null); + /** UpdateSavedQueryRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents a TemporalAsset. */ - class TemporalAsset implements ITemporalAsset { + /** Represents an UpdateSavedQueryRequest. */ + class UpdateSavedQueryRequest implements IUpdateSavedQueryRequest { /** - * Constructs a new TemporalAsset. + * Constructs a new UpdateSavedQueryRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.ITemporalAsset); - - /** TemporalAsset window. */ - public window?: (google.cloud.asset.v1.ITimeWindow|null); + constructor(properties?: google.cloud.asset.v1.IUpdateSavedQueryRequest); - /** TemporalAsset deleted. */ - public deleted: boolean; - - /** TemporalAsset asset. */ - public asset?: (google.cloud.asset.v1.IAsset|null); - - /** TemporalAsset priorAssetState. */ - public priorAssetState: (google.cloud.asset.v1.TemporalAsset.PriorAssetState|keyof typeof google.cloud.asset.v1.TemporalAsset.PriorAssetState); + /** UpdateSavedQueryRequest savedQuery. */ + public savedQuery?: (google.cloud.asset.v1.ISavedQuery|null); - /** TemporalAsset priorAsset. */ - public priorAsset?: (google.cloud.asset.v1.IAsset|null); + /** UpdateSavedQueryRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new TemporalAsset instance using the specified properties. + * Creates a new UpdateSavedQueryRequest instance using the specified properties. * @param [properties] Properties to set - * @returns TemporalAsset instance + * @returns UpdateSavedQueryRequest instance */ - public static create(properties?: google.cloud.asset.v1.ITemporalAsset): google.cloud.asset.v1.TemporalAsset; + public static create(properties?: google.cloud.asset.v1.IUpdateSavedQueryRequest): google.cloud.asset.v1.UpdateSavedQueryRequest; /** - * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. - * @param message TemporalAsset message or plain object to encode + * Encodes the specified UpdateSavedQueryRequest message. Does not implicitly {@link google.cloud.asset.v1.UpdateSavedQueryRequest.verify|verify} messages. + * @param message UpdateSavedQueryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IUpdateSavedQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. - * @param message TemporalAsset message or plain object to encode + * Encodes the specified UpdateSavedQueryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.UpdateSavedQueryRequest.verify|verify} messages. + * @param message UpdateSavedQueryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IUpdateSavedQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TemporalAsset message from the specified reader or buffer. + * Decodes an UpdateSavedQueryRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TemporalAsset + * @returns UpdateSavedQueryRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.TemporalAsset; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.UpdateSavedQueryRequest; /** - * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * Decodes an UpdateSavedQueryRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TemporalAsset + * @returns UpdateSavedQueryRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.TemporalAsset; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.UpdateSavedQueryRequest; /** - * Verifies a TemporalAsset message. + * Verifies an UpdateSavedQueryRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateSavedQueryRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TemporalAsset + * @returns UpdateSavedQueryRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.TemporalAsset; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.UpdateSavedQueryRequest; /** - * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. - * @param message TemporalAsset + * Creates a plain object from an UpdateSavedQueryRequest message. Also converts values to other types if specified. + * @param message UpdateSavedQueryRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.TemporalAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.UpdateSavedQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TemporalAsset to JSON. + * Converts this UpdateSavedQueryRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace TemporalAsset { - - /** PriorAssetState enum. */ - enum PriorAssetState { - PRIOR_ASSET_STATE_UNSPECIFIED = 0, - PRESENT = 1, - INVALID = 2, - DOES_NOT_EXIST = 3, - DELETED = 4 - } - } - - /** Properties of a TimeWindow. */ - interface ITimeWindow { - - /** TimeWindow startTime */ - startTime?: (google.protobuf.ITimestamp|null); + /** Properties of a DeleteSavedQueryRequest. */ + interface IDeleteSavedQueryRequest { - /** TimeWindow endTime */ - endTime?: (google.protobuf.ITimestamp|null); + /** DeleteSavedQueryRequest name */ + name?: (string|null); } - /** Represents a TimeWindow. */ - class TimeWindow implements ITimeWindow { + /** Represents a DeleteSavedQueryRequest. */ + class DeleteSavedQueryRequest implements IDeleteSavedQueryRequest { /** - * Constructs a new TimeWindow. + * Constructs a new DeleteSavedQueryRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.ITimeWindow); - - /** TimeWindow startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); + constructor(properties?: google.cloud.asset.v1.IDeleteSavedQueryRequest); - /** TimeWindow endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); + /** DeleteSavedQueryRequest name. */ + public name: string; /** - * Creates a new TimeWindow instance using the specified properties. + * Creates a new DeleteSavedQueryRequest instance using the specified properties. * @param [properties] Properties to set - * @returns TimeWindow instance + * @returns DeleteSavedQueryRequest instance */ - public static create(properties?: google.cloud.asset.v1.ITimeWindow): google.cloud.asset.v1.TimeWindow; + public static create(properties?: google.cloud.asset.v1.IDeleteSavedQueryRequest): google.cloud.asset.v1.DeleteSavedQueryRequest; /** - * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. - * @param message TimeWindow message or plain object to encode + * Encodes the specified DeleteSavedQueryRequest message. Does not implicitly {@link google.cloud.asset.v1.DeleteSavedQueryRequest.verify|verify} messages. + * @param message DeleteSavedQueryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IDeleteSavedQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. - * @param message TimeWindow message or plain object to encode + * Encodes the specified DeleteSavedQueryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.DeleteSavedQueryRequest.verify|verify} messages. + * @param message DeleteSavedQueryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IDeleteSavedQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TimeWindow message from the specified reader or buffer. + * Decodes a DeleteSavedQueryRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TimeWindow + * @returns DeleteSavedQueryRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.TimeWindow; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.DeleteSavedQueryRequest; /** - * Decodes a TimeWindow message from the specified reader or buffer, length delimited. + * Decodes a DeleteSavedQueryRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TimeWindow + * @returns DeleteSavedQueryRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.TimeWindow; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.DeleteSavedQueryRequest; /** - * Verifies a TimeWindow message. + * Verifies a DeleteSavedQueryRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteSavedQueryRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TimeWindow + * @returns DeleteSavedQueryRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.TimeWindow; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.DeleteSavedQueryRequest; /** - * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. - * @param message TimeWindow + * Creates a plain object from a DeleteSavedQueryRequest message. Also converts values to other types if specified. + * @param message DeleteSavedQueryRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.DeleteSavedQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TimeWindow to JSON. + * Converts this DeleteSavedQueryRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an Asset. */ - interface IAsset { + /** Properties of an AnalyzeMoveRequest. */ + interface IAnalyzeMoveRequest { - /** Asset updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); + /** AnalyzeMoveRequest resource */ + resource?: (string|null); - /** Asset name */ - name?: (string|null); + /** AnalyzeMoveRequest destinationParent */ + destinationParent?: (string|null); - /** Asset assetType */ - assetType?: (string|null); + /** AnalyzeMoveRequest view */ + view?: (google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView|keyof typeof google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView|null); + } - /** Asset resource */ - resource?: (google.cloud.asset.v1.IResource|null); - - /** Asset iamPolicy */ - iamPolicy?: (google.iam.v1.IPolicy|null); - - /** Asset orgPolicy */ - orgPolicy?: (google.cloud.orgpolicy.v1.IPolicy[]|null); - - /** Asset accessPolicy */ - accessPolicy?: (google.identity.accesscontextmanager.v1.IAccessPolicy|null); - - /** Asset accessLevel */ - accessLevel?: (google.identity.accesscontextmanager.v1.IAccessLevel|null); - - /** Asset servicePerimeter */ - servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); - - /** Asset osInventory */ - osInventory?: (google.cloud.osconfig.v1.IInventory|null); - - /** Asset relatedAssets */ - relatedAssets?: (google.cloud.asset.v1.IRelatedAssets|null); - - /** Asset ancestors */ - ancestors?: (string[]|null); - } - - /** Represents an Asset. */ - class Asset implements IAsset { + /** Represents an AnalyzeMoveRequest. */ + class AnalyzeMoveRequest implements IAnalyzeMoveRequest { /** - * Constructs a new Asset. + * Constructs a new AnalyzeMoveRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IAsset); - - /** Asset updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Asset name. */ - public name: string; - - /** Asset assetType. */ - public assetType: string; - - /** Asset resource. */ - public resource?: (google.cloud.asset.v1.IResource|null); - - /** Asset iamPolicy. */ - public iamPolicy?: (google.iam.v1.IPolicy|null); - - /** Asset orgPolicy. */ - public orgPolicy: google.cloud.orgpolicy.v1.IPolicy[]; - - /** Asset accessPolicy. */ - public accessPolicy?: (google.identity.accesscontextmanager.v1.IAccessPolicy|null); - - /** Asset accessLevel. */ - public accessLevel?: (google.identity.accesscontextmanager.v1.IAccessLevel|null); - - /** Asset servicePerimeter. */ - public servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); - - /** Asset osInventory. */ - public osInventory?: (google.cloud.osconfig.v1.IInventory|null); + constructor(properties?: google.cloud.asset.v1.IAnalyzeMoveRequest); - /** Asset relatedAssets. */ - public relatedAssets?: (google.cloud.asset.v1.IRelatedAssets|null); + /** AnalyzeMoveRequest resource. */ + public resource: string; - /** Asset ancestors. */ - public ancestors: string[]; + /** AnalyzeMoveRequest destinationParent. */ + public destinationParent: string; - /** Asset accessContextPolicy. */ - public accessContextPolicy?: ("accessPolicy"|"accessLevel"|"servicePerimeter"); + /** AnalyzeMoveRequest view. */ + public view: (google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView|keyof typeof google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView); /** - * Creates a new Asset instance using the specified properties. + * Creates a new AnalyzeMoveRequest instance using the specified properties. * @param [properties] Properties to set - * @returns Asset instance + * @returns AnalyzeMoveRequest instance */ - public static create(properties?: google.cloud.asset.v1.IAsset): google.cloud.asset.v1.Asset; + public static create(properties?: google.cloud.asset.v1.IAnalyzeMoveRequest): google.cloud.asset.v1.AnalyzeMoveRequest; /** - * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode + * Encodes the specified AnalyzeMoveRequest message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveRequest.verify|verify} messages. + * @param message AnalyzeMoveRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IAnalyzeMoveRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode + * Encodes the specified AnalyzeMoveRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveRequest.verify|verify} messages. + * @param message AnalyzeMoveRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IAnalyzeMoveRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Asset message from the specified reader or buffer. + * Decodes an AnalyzeMoveRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Asset + * @returns AnalyzeMoveRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.Asset; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.AnalyzeMoveRequest; /** - * Decodes an Asset message from the specified reader or buffer, length delimited. + * Decodes an AnalyzeMoveRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Asset + * @returns AnalyzeMoveRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.Asset; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.AnalyzeMoveRequest; /** - * Verifies an Asset message. + * Verifies an AnalyzeMoveRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * Creates an AnalyzeMoveRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Asset + * @returns AnalyzeMoveRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Asset; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeMoveRequest; /** - * Creates a plain object from an Asset message. Also converts values to other types if specified. - * @param message Asset + * Creates a plain object from an AnalyzeMoveRequest message. Also converts values to other types if specified. + * @param message AnalyzeMoveRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.AnalyzeMoveRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Asset to JSON. + * Converts this AnalyzeMoveRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Resource. */ - interface IResource { - - /** Resource version */ - version?: (string|null); - - /** Resource discoveryDocumentUri */ - discoveryDocumentUri?: (string|null); - - /** Resource discoveryName */ - discoveryName?: (string|null); - - /** Resource resourceUrl */ - resourceUrl?: (string|null); + namespace AnalyzeMoveRequest { - /** Resource parent */ - parent?: (string|null); + /** AnalysisView enum. */ + enum AnalysisView { + ANALYSIS_VIEW_UNSPECIFIED = 0, + FULL = 1, + BASIC = 2 + } + } - /** Resource data */ - data?: (google.protobuf.IStruct|null); + /** Properties of an AnalyzeMoveResponse. */ + interface IAnalyzeMoveResponse { - /** Resource location */ - location?: (string|null); + /** AnalyzeMoveResponse moveAnalysis */ + moveAnalysis?: (google.cloud.asset.v1.IMoveAnalysis[]|null); } - /** Represents a Resource. */ - class Resource implements IResource { + /** Represents an AnalyzeMoveResponse. */ + class AnalyzeMoveResponse implements IAnalyzeMoveResponse { /** - * Constructs a new Resource. + * Constructs a new AnalyzeMoveResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IResource); - - /** Resource version. */ - public version: string; - - /** Resource discoveryDocumentUri. */ - public discoveryDocumentUri: string; - - /** Resource discoveryName. */ - public discoveryName: string; - - /** Resource resourceUrl. */ - public resourceUrl: string; - - /** Resource parent. */ - public parent: string; - - /** Resource data. */ - public data?: (google.protobuf.IStruct|null); + constructor(properties?: google.cloud.asset.v1.IAnalyzeMoveResponse); - /** Resource location. */ - public location: string; + /** AnalyzeMoveResponse moveAnalysis. */ + public moveAnalysis: google.cloud.asset.v1.IMoveAnalysis[]; /** - * Creates a new Resource instance using the specified properties. + * Creates a new AnalyzeMoveResponse instance using the specified properties. * @param [properties] Properties to set - * @returns Resource instance + * @returns AnalyzeMoveResponse instance */ - public static create(properties?: google.cloud.asset.v1.IResource): google.cloud.asset.v1.Resource; + public static create(properties?: google.cloud.asset.v1.IAnalyzeMoveResponse): google.cloud.asset.v1.AnalyzeMoveResponse; /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. - * @param message Resource message or plain object to encode + * Encodes the specified AnalyzeMoveResponse message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveResponse.verify|verify} messages. + * @param message AnalyzeMoveResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IAnalyzeMoveResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. - * @param message Resource message or plain object to encode + * Encodes the specified AnalyzeMoveResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveResponse.verify|verify} messages. + * @param message AnalyzeMoveResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IAnalyzeMoveResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Resource message from the specified reader or buffer. + * Decodes an AnalyzeMoveResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Resource + * @returns AnalyzeMoveResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.Resource; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.AnalyzeMoveResponse; /** - * Decodes a Resource message from the specified reader or buffer, length delimited. + * Decodes an AnalyzeMoveResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Resource + * @returns AnalyzeMoveResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.Resource; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.AnalyzeMoveResponse; /** - * Verifies a Resource message. + * Verifies an AnalyzeMoveResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * Creates an AnalyzeMoveResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Resource + * @returns AnalyzeMoveResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Resource; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeMoveResponse; /** - * Creates a plain object from a Resource message. Also converts values to other types if specified. - * @param message Resource + * Creates a plain object from an AnalyzeMoveResponse message. Also converts values to other types if specified. + * @param message AnalyzeMoveResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.AnalyzeMoveResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Resource to JSON. + * Converts this AnalyzeMoveResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a RelatedAssets. */ - interface IRelatedAssets { + /** Properties of a MoveAnalysis. */ + interface IMoveAnalysis { - /** RelatedAssets relationshipAttributes */ - relationshipAttributes?: (google.cloud.asset.v1.IRelationshipAttributes|null); + /** MoveAnalysis displayName */ + displayName?: (string|null); - /** RelatedAssets assets */ - assets?: (google.cloud.asset.v1.IRelatedAsset[]|null); + /** MoveAnalysis analysis */ + analysis?: (google.cloud.asset.v1.IMoveAnalysisResult|null); + + /** MoveAnalysis error */ + error?: (google.rpc.IStatus|null); } - /** Represents a RelatedAssets. */ - class RelatedAssets implements IRelatedAssets { + /** Represents a MoveAnalysis. */ + class MoveAnalysis implements IMoveAnalysis { /** - * Constructs a new RelatedAssets. + * Constructs a new MoveAnalysis. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IRelatedAssets); + constructor(properties?: google.cloud.asset.v1.IMoveAnalysis); - /** RelatedAssets relationshipAttributes. */ - public relationshipAttributes?: (google.cloud.asset.v1.IRelationshipAttributes|null); + /** MoveAnalysis displayName. */ + public displayName: string; - /** RelatedAssets assets. */ - public assets: google.cloud.asset.v1.IRelatedAsset[]; + /** MoveAnalysis analysis. */ + public analysis?: (google.cloud.asset.v1.IMoveAnalysisResult|null); + + /** MoveAnalysis error. */ + public error?: (google.rpc.IStatus|null); + + /** MoveAnalysis result. */ + public result?: ("analysis"|"error"); /** - * Creates a new RelatedAssets instance using the specified properties. + * Creates a new MoveAnalysis instance using the specified properties. * @param [properties] Properties to set - * @returns RelatedAssets instance + * @returns MoveAnalysis instance */ - public static create(properties?: google.cloud.asset.v1.IRelatedAssets): google.cloud.asset.v1.RelatedAssets; + public static create(properties?: google.cloud.asset.v1.IMoveAnalysis): google.cloud.asset.v1.MoveAnalysis; /** - * Encodes the specified RelatedAssets message. Does not implicitly {@link google.cloud.asset.v1.RelatedAssets.verify|verify} messages. - * @param message RelatedAssets message or plain object to encode + * Encodes the specified MoveAnalysis message. Does not implicitly {@link google.cloud.asset.v1.MoveAnalysis.verify|verify} messages. + * @param message MoveAnalysis message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IRelatedAssets, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IMoveAnalysis, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RelatedAssets message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelatedAssets.verify|verify} messages. - * @param message RelatedAssets message or plain object to encode + * Encodes the specified MoveAnalysis message, length delimited. Does not implicitly {@link google.cloud.asset.v1.MoveAnalysis.verify|verify} messages. + * @param message MoveAnalysis message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IRelatedAssets, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IMoveAnalysis, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RelatedAssets message from the specified reader or buffer. + * Decodes a MoveAnalysis message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RelatedAssets + * @returns MoveAnalysis * @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.RelatedAssets; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.MoveAnalysis; /** - * Decodes a RelatedAssets message from the specified reader or buffer, length delimited. + * Decodes a MoveAnalysis message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RelatedAssets + * @returns MoveAnalysis * @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.RelatedAssets; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.MoveAnalysis; /** - * Verifies a RelatedAssets message. + * Verifies a MoveAnalysis 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 RelatedAssets message from a plain object. Also converts values to their respective internal types. + * Creates a MoveAnalysis message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RelatedAssets + * @returns MoveAnalysis */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.RelatedAssets; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.MoveAnalysis; /** - * Creates a plain object from a RelatedAssets message. Also converts values to other types if specified. - * @param message RelatedAssets + * Creates a plain object from a MoveAnalysis message. Also converts values to other types if specified. + * @param message MoveAnalysis * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.RelatedAssets, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.MoveAnalysis, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RelatedAssets to JSON. + * Converts this MoveAnalysis to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a RelationshipAttributes. */ - interface IRelationshipAttributes { - - /** RelationshipAttributes type */ - type?: (string|null); - - /** RelationshipAttributes sourceResourceType */ - sourceResourceType?: (string|null); + /** Properties of a MoveAnalysisResult. */ + interface IMoveAnalysisResult { - /** RelationshipAttributes targetResourceType */ - targetResourceType?: (string|null); + /** MoveAnalysisResult blockers */ + blockers?: (google.cloud.asset.v1.IMoveImpact[]|null); - /** RelationshipAttributes action */ - action?: (string|null); + /** MoveAnalysisResult warnings */ + warnings?: (google.cloud.asset.v1.IMoveImpact[]|null); } - /** Represents a RelationshipAttributes. */ - class RelationshipAttributes implements IRelationshipAttributes { + /** Represents a MoveAnalysisResult. */ + class MoveAnalysisResult implements IMoveAnalysisResult { /** - * Constructs a new RelationshipAttributes. + * Constructs a new MoveAnalysisResult. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IRelationshipAttributes); - - /** RelationshipAttributes type. */ - public type: string; - - /** RelationshipAttributes sourceResourceType. */ - public sourceResourceType: string; + constructor(properties?: google.cloud.asset.v1.IMoveAnalysisResult); - /** RelationshipAttributes targetResourceType. */ - public targetResourceType: string; + /** MoveAnalysisResult blockers. */ + public blockers: google.cloud.asset.v1.IMoveImpact[]; - /** RelationshipAttributes action. */ - public action: string; + /** MoveAnalysisResult warnings. */ + public warnings: google.cloud.asset.v1.IMoveImpact[]; /** - * Creates a new RelationshipAttributes instance using the specified properties. + * Creates a new MoveAnalysisResult instance using the specified properties. * @param [properties] Properties to set - * @returns RelationshipAttributes instance + * @returns MoveAnalysisResult instance */ - public static create(properties?: google.cloud.asset.v1.IRelationshipAttributes): google.cloud.asset.v1.RelationshipAttributes; + public static create(properties?: google.cloud.asset.v1.IMoveAnalysisResult): google.cloud.asset.v1.MoveAnalysisResult; /** - * Encodes the specified RelationshipAttributes message. Does not implicitly {@link google.cloud.asset.v1.RelationshipAttributes.verify|verify} messages. - * @param message RelationshipAttributes message or plain object to encode + * Encodes the specified MoveAnalysisResult message. Does not implicitly {@link google.cloud.asset.v1.MoveAnalysisResult.verify|verify} messages. + * @param message MoveAnalysisResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IRelationshipAttributes, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IMoveAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RelationshipAttributes message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelationshipAttributes.verify|verify} messages. - * @param message RelationshipAttributes message or plain object to encode + * Encodes the specified MoveAnalysisResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.MoveAnalysisResult.verify|verify} messages. + * @param message MoveAnalysisResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IRelationshipAttributes, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IMoveAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RelationshipAttributes message from the specified reader or buffer. + * Decodes a MoveAnalysisResult message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RelationshipAttributes + * @returns MoveAnalysisResult * @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.RelationshipAttributes; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.MoveAnalysisResult; /** - * Decodes a RelationshipAttributes message from the specified reader or buffer, length delimited. + * Decodes a MoveAnalysisResult message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RelationshipAttributes + * @returns MoveAnalysisResult * @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.RelationshipAttributes; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.MoveAnalysisResult; /** - * Verifies a RelationshipAttributes message. + * Verifies a MoveAnalysisResult 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 RelationshipAttributes message from a plain object. Also converts values to their respective internal types. + * Creates a MoveAnalysisResult message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RelationshipAttributes + * @returns MoveAnalysisResult */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.RelationshipAttributes; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.MoveAnalysisResult; /** - * Creates a plain object from a RelationshipAttributes message. Also converts values to other types if specified. - * @param message RelationshipAttributes + * Creates a plain object from a MoveAnalysisResult message. Also converts values to other types if specified. + * @param message MoveAnalysisResult * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.RelationshipAttributes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.MoveAnalysisResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RelationshipAttributes to JSON. + * Converts this MoveAnalysisResult to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a RelatedAsset. */ - interface IRelatedAsset { - - /** RelatedAsset asset */ - asset?: (string|null); - - /** RelatedAsset assetType */ - assetType?: (string|null); + /** Properties of a MoveImpact. */ + interface IMoveImpact { - /** RelatedAsset ancestors */ - ancestors?: (string[]|null); + /** MoveImpact detail */ + detail?: (string|null); } - /** Represents a RelatedAsset. */ - class RelatedAsset implements IRelatedAsset { + /** Represents a MoveImpact. */ + class MoveImpact implements IMoveImpact { /** - * Constructs a new RelatedAsset. + * Constructs a new MoveImpact. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IRelatedAsset); - - /** RelatedAsset asset. */ - public asset: string; - - /** RelatedAsset assetType. */ - public assetType: string; + constructor(properties?: google.cloud.asset.v1.IMoveImpact); - /** RelatedAsset ancestors. */ - public ancestors: string[]; + /** MoveImpact detail. */ + public detail: string; /** - * Creates a new RelatedAsset instance using the specified properties. + * Creates a new MoveImpact instance using the specified properties. * @param [properties] Properties to set - * @returns RelatedAsset instance + * @returns MoveImpact instance */ - public static create(properties?: google.cloud.asset.v1.IRelatedAsset): google.cloud.asset.v1.RelatedAsset; + public static create(properties?: google.cloud.asset.v1.IMoveImpact): google.cloud.asset.v1.MoveImpact; /** - * Encodes the specified RelatedAsset message. Does not implicitly {@link google.cloud.asset.v1.RelatedAsset.verify|verify} messages. - * @param message RelatedAsset message or plain object to encode + * Encodes the specified MoveImpact message. Does not implicitly {@link google.cloud.asset.v1.MoveImpact.verify|verify} messages. + * @param message MoveImpact message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IRelatedAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IMoveImpact, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RelatedAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelatedAsset.verify|verify} messages. - * @param message RelatedAsset message or plain object to encode + * Encodes the specified MoveImpact message, length delimited. Does not implicitly {@link google.cloud.asset.v1.MoveImpact.verify|verify} messages. + * @param message MoveImpact message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IRelatedAsset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IMoveImpact, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RelatedAsset message from the specified reader or buffer. + * Decodes a MoveImpact message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RelatedAsset + * @returns MoveImpact * @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.RelatedAsset; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.MoveImpact; /** - * Decodes a RelatedAsset message from the specified reader or buffer, length delimited. + * Decodes a MoveImpact message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RelatedAsset + * @returns MoveImpact * @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.RelatedAsset; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.MoveImpact; /** - * Verifies a RelatedAsset message. + * Verifies a MoveImpact 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 RelatedAsset message from a plain object. Also converts values to their respective internal types. + * Creates a MoveImpact message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RelatedAsset + * @returns MoveImpact */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.RelatedAsset; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.MoveImpact; /** - * Creates a plain object from a RelatedAsset message. Also converts values to other types if specified. - * @param message RelatedAsset + * Creates a plain object from a MoveImpact message. Also converts values to other types if specified. + * @param message MoveImpact * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.RelatedAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.MoveImpact, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RelatedAsset to JSON. + * Converts this MoveImpact to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ResourceSearchResult. */ - interface IResourceSearchResult { + /** ContentType enum. */ + enum ContentType { + CONTENT_TYPE_UNSPECIFIED = 0, + RESOURCE = 1, + IAM_POLICY = 2, + ORG_POLICY = 4, + ACCESS_POLICY = 5, + OS_INVENTORY = 6, + RELATIONSHIP = 7 + } - /** ResourceSearchResult name */ - name?: (string|null); + /** Properties of a BatchGetEffectiveIamPoliciesRequest. */ + interface IBatchGetEffectiveIamPoliciesRequest { - /** ResourceSearchResult assetType */ - assetType?: (string|null); + /** BatchGetEffectiveIamPoliciesRequest scope */ + scope?: (string|null); - /** ResourceSearchResult project */ - project?: (string|null); + /** BatchGetEffectiveIamPoliciesRequest names */ + names?: (string[]|null); + } - /** ResourceSearchResult folders */ - folders?: (string[]|null); + /** Represents a BatchGetEffectiveIamPoliciesRequest. */ + class BatchGetEffectiveIamPoliciesRequest implements IBatchGetEffectiveIamPoliciesRequest { - /** ResourceSearchResult organization */ - organization?: (string|null); + /** + * Constructs a new BatchGetEffectiveIamPoliciesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest); - /** ResourceSearchResult displayName */ - displayName?: (string|null); + /** BatchGetEffectiveIamPoliciesRequest scope. */ + public scope: string; - /** ResourceSearchResult description */ - description?: (string|null); - - /** ResourceSearchResult location */ - location?: (string|null); - - /** ResourceSearchResult labels */ - labels?: ({ [k: string]: string }|null); - - /** ResourceSearchResult networkTags */ - networkTags?: (string[]|null); - - /** ResourceSearchResult kmsKey */ - kmsKey?: (string|null); - - /** ResourceSearchResult createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** ResourceSearchResult updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** ResourceSearchResult state */ - state?: (string|null); - - /** ResourceSearchResult additionalAttributes */ - additionalAttributes?: (google.protobuf.IStruct|null); - - /** ResourceSearchResult parentFullResourceName */ - parentFullResourceName?: (string|null); - - /** ResourceSearchResult versionedResources */ - versionedResources?: (google.cloud.asset.v1.IVersionedResource[]|null); - - /** ResourceSearchResult attachedResources */ - attachedResources?: (google.cloud.asset.v1.IAttachedResource[]|null); - - /** ResourceSearchResult relationships */ - relationships?: ({ [k: string]: google.cloud.asset.v1.IRelatedResources }|null); - - /** ResourceSearchResult parentAssetType */ - parentAssetType?: (string|null); - } - - /** Represents a ResourceSearchResult. */ - class ResourceSearchResult implements IResourceSearchResult { - - /** - * Constructs a new ResourceSearchResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IResourceSearchResult); - - /** ResourceSearchResult name. */ - public name: string; - - /** ResourceSearchResult assetType. */ - public assetType: string; - - /** ResourceSearchResult project. */ - public project: string; - - /** ResourceSearchResult folders. */ - public folders: string[]; - - /** ResourceSearchResult organization. */ - public organization: string; - - /** ResourceSearchResult displayName. */ - public displayName: string; - - /** ResourceSearchResult description. */ - public description: string; - - /** ResourceSearchResult location. */ - public location: string; - - /** ResourceSearchResult labels. */ - public labels: { [k: string]: string }; - - /** ResourceSearchResult networkTags. */ - public networkTags: string[]; - - /** ResourceSearchResult kmsKey. */ - public kmsKey: string; - - /** ResourceSearchResult createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** ResourceSearchResult updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** ResourceSearchResult state. */ - public state: string; - - /** ResourceSearchResult additionalAttributes. */ - public additionalAttributes?: (google.protobuf.IStruct|null); - - /** ResourceSearchResult parentFullResourceName. */ - public parentFullResourceName: string; - - /** ResourceSearchResult versionedResources. */ - public versionedResources: google.cloud.asset.v1.IVersionedResource[]; - - /** ResourceSearchResult attachedResources. */ - public attachedResources: google.cloud.asset.v1.IAttachedResource[]; - - /** ResourceSearchResult relationships. */ - public relationships: { [k: string]: google.cloud.asset.v1.IRelatedResources }; - - /** ResourceSearchResult parentAssetType. */ - public parentAssetType: string; + /** BatchGetEffectiveIamPoliciesRequest names. */ + public names: string[]; /** - * Creates a new ResourceSearchResult instance using the specified properties. + * Creates a new BatchGetEffectiveIamPoliciesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ResourceSearchResult instance + * @returns BatchGetEffectiveIamPoliciesRequest instance */ - public static create(properties?: google.cloud.asset.v1.IResourceSearchResult): google.cloud.asset.v1.ResourceSearchResult; + public static create(properties?: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest; /** - * Encodes the specified ResourceSearchResult message. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. - * @param message ResourceSearchResult message or plain object to encode + * Encodes the specified BatchGetEffectiveIamPoliciesRequest message. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.verify|verify} messages. + * @param message BatchGetEffectiveIamPoliciesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IResourceSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ResourceSearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. - * @param message ResourceSearchResult message or plain object to encode + * Encodes the specified BatchGetEffectiveIamPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.verify|verify} messages. + * @param message BatchGetEffectiveIamPoliciesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IResourceSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ResourceSearchResult message from the specified reader or buffer. + * Decodes a BatchGetEffectiveIamPoliciesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ResourceSearchResult + * @returns BatchGetEffectiveIamPoliciesRequest * @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.ResourceSearchResult; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest; /** - * Decodes a ResourceSearchResult message from the specified reader or buffer, length delimited. + * Decodes a BatchGetEffectiveIamPoliciesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ResourceSearchResult + * @returns BatchGetEffectiveIamPoliciesRequest * @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.ResourceSearchResult; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest; /** - * Verifies a ResourceSearchResult message. + * Verifies a BatchGetEffectiveIamPoliciesRequest 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 ResourceSearchResult message from a plain object. Also converts values to their respective internal types. + * Creates a BatchGetEffectiveIamPoliciesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ResourceSearchResult + * @returns BatchGetEffectiveIamPoliciesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ResourceSearchResult; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest; /** - * Creates a plain object from a ResourceSearchResult message. Also converts values to other types if specified. - * @param message ResourceSearchResult + * Creates a plain object from a BatchGetEffectiveIamPoliciesRequest message. Also converts values to other types if specified. + * @param message BatchGetEffectiveIamPoliciesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.ResourceSearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ResourceSearchResult to JSON. + * Converts this BatchGetEffectiveIamPoliciesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a VersionedResource. */ - interface IVersionedResource { - - /** VersionedResource version */ - version?: (string|null); + /** Properties of a BatchGetEffectiveIamPoliciesResponse. */ + interface IBatchGetEffectiveIamPoliciesResponse { - /** VersionedResource resource */ - resource?: (google.protobuf.IStruct|null); + /** BatchGetEffectiveIamPoliciesResponse policyResults */ + policyResults?: (google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy[]|null); } - /** Represents a VersionedResource. */ - class VersionedResource implements IVersionedResource { + /** Represents a BatchGetEffectiveIamPoliciesResponse. */ + class BatchGetEffectiveIamPoliciesResponse implements IBatchGetEffectiveIamPoliciesResponse { /** - * Constructs a new VersionedResource. + * Constructs a new BatchGetEffectiveIamPoliciesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IVersionedResource); - - /** VersionedResource version. */ - public version: string; + constructor(properties?: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse); - /** VersionedResource resource. */ - public resource?: (google.protobuf.IStruct|null); + /** BatchGetEffectiveIamPoliciesResponse policyResults. */ + public policyResults: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy[]; /** - * Creates a new VersionedResource instance using the specified properties. + * Creates a new BatchGetEffectiveIamPoliciesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns VersionedResource instance + * @returns BatchGetEffectiveIamPoliciesResponse instance */ - public static create(properties?: google.cloud.asset.v1.IVersionedResource): google.cloud.asset.v1.VersionedResource; + public static create(properties?: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse; /** - * Encodes the specified VersionedResource message. Does not implicitly {@link google.cloud.asset.v1.VersionedResource.verify|verify} messages. - * @param message VersionedResource message or plain object to encode + * Encodes the specified BatchGetEffectiveIamPoliciesResponse message. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.verify|verify} messages. + * @param message BatchGetEffectiveIamPoliciesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IVersionedResource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified VersionedResource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.VersionedResource.verify|verify} messages. - * @param message VersionedResource message or plain object to encode + * Encodes the specified BatchGetEffectiveIamPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.verify|verify} messages. + * @param message BatchGetEffectiveIamPoliciesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IVersionedResource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a VersionedResource message from the specified reader or buffer. + * Decodes a BatchGetEffectiveIamPoliciesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns VersionedResource + * @returns BatchGetEffectiveIamPoliciesResponse * @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.VersionedResource; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse; /** - * Decodes a VersionedResource message from the specified reader or buffer, length delimited. + * Decodes a BatchGetEffectiveIamPoliciesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns VersionedResource + * @returns BatchGetEffectiveIamPoliciesResponse * @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.VersionedResource; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse; /** - * Verifies a VersionedResource message. + * Verifies a BatchGetEffectiveIamPoliciesResponse 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 VersionedResource message from a plain object. Also converts values to their respective internal types. + * Creates a BatchGetEffectiveIamPoliciesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns VersionedResource + * @returns BatchGetEffectiveIamPoliciesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.VersionedResource; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse; /** - * Creates a plain object from a VersionedResource message. Also converts values to other types if specified. - * @param message VersionedResource + * Creates a plain object from a BatchGetEffectiveIamPoliciesResponse message. Also converts values to other types if specified. + * @param message BatchGetEffectiveIamPoliciesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.VersionedResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this VersionedResource to JSON. + * Converts this BatchGetEffectiveIamPoliciesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an AttachedResource. */ - interface IAttachedResource { - - /** AttachedResource assetType */ - assetType?: (string|null); + namespace BatchGetEffectiveIamPoliciesResponse { - /** AttachedResource versionedResources */ - versionedResources?: (google.cloud.asset.v1.IVersionedResource[]|null); - } + /** Properties of an EffectiveIamPolicy. */ + interface IEffectiveIamPolicy { - /** Represents an AttachedResource. */ - class AttachedResource implements IAttachedResource { + /** EffectiveIamPolicy fullResourceName */ + fullResourceName?: (string|null); - /** - * Constructs a new AttachedResource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IAttachedResource); + /** EffectiveIamPolicy policies */ + policies?: (google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo[]|null); + } - /** AttachedResource assetType. */ - public assetType: string; + /** Represents an EffectiveIamPolicy. */ + class EffectiveIamPolicy implements IEffectiveIamPolicy { - /** AttachedResource versionedResources. */ - public versionedResources: google.cloud.asset.v1.IVersionedResource[]; + /** + * Constructs a new EffectiveIamPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy); - /** - * Creates a new AttachedResource instance using the specified properties. - * @param [properties] Properties to set - * @returns AttachedResource instance - */ - public static create(properties?: google.cloud.asset.v1.IAttachedResource): google.cloud.asset.v1.AttachedResource; + /** EffectiveIamPolicy fullResourceName. */ + public fullResourceName: string; - /** - * Encodes the specified AttachedResource message. Does not implicitly {@link google.cloud.asset.v1.AttachedResource.verify|verify} messages. - * @param message AttachedResource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.IAttachedResource, writer?: $protobuf.Writer): $protobuf.Writer; + /** EffectiveIamPolicy policies. */ + public policies: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo[]; - /** - * Encodes the specified AttachedResource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AttachedResource.verify|verify} messages. - * @param message AttachedResource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1.IAttachedResource, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new EffectiveIamPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns EffectiveIamPolicy instance + */ + public static create(properties?: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy; - /** - * Decodes an AttachedResource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AttachedResource - * @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.AttachedResource; + /** + * Encodes the specified EffectiveIamPolicy message. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.verify|verify} messages. + * @param message EffectiveIamPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes an AttachedResource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AttachedResource - * @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.AttachedResource; + /** + * Encodes the specified EffectiveIamPolicy message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.verify|verify} messages. + * @param message EffectiveIamPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies an AttachedResource 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); + /** + * Decodes an EffectiveIamPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EffectiveIamPolicy + * @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.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy; - /** - * Creates an AttachedResource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AttachedResource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AttachedResource; + /** + * Decodes an EffectiveIamPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EffectiveIamPolicy + * @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.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy; - /** - * Creates a plain object from an AttachedResource message. Also converts values to other types if specified. - * @param message AttachedResource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.AttachedResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Verifies an EffectiveIamPolicy 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); - /** - * Converts this AttachedResource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Creates an EffectiveIamPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EffectiveIamPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy; + + /** + * Creates a plain object from an EffectiveIamPolicy message. Also converts values to other types if specified. + * @param message EffectiveIamPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EffectiveIamPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace EffectiveIamPolicy { + + /** Properties of a PolicyInfo. */ + interface IPolicyInfo { + + /** PolicyInfo attachedResource */ + attachedResource?: (string|null); + + /** PolicyInfo policy */ + policy?: (google.iam.v1.IPolicy|null); + } + + /** Represents a PolicyInfo. */ + class PolicyInfo implements IPolicyInfo { + + /** + * Constructs a new PolicyInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo); + + /** PolicyInfo attachedResource. */ + public attachedResource: string; + + /** PolicyInfo policy. */ + public policy?: (google.iam.v1.IPolicy|null); + + /** + * Creates a new PolicyInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns PolicyInfo instance + */ + public static create(properties?: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo; + + /** + * Encodes the specified PolicyInfo message. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.verify|verify} messages. + * @param message PolicyInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PolicyInfo message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.verify|verify} messages. + * @param message PolicyInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PolicyInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PolicyInfo + * @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.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo; + + /** + * Decodes a PolicyInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PolicyInfo + * @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.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo; + + /** + * Verifies a PolicyInfo 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 PolicyInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PolicyInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo; + + /** + * Creates a plain object from a PolicyInfo message. Also converts values to other types if specified. + * @param message PolicyInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PolicyInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } } - /** Properties of a RelatedResources. */ - interface IRelatedResources { + /** Properties of a TemporalAsset. */ + interface ITemporalAsset { - /** RelatedResources relatedResources */ - relatedResources?: (google.cloud.asset.v1.IRelatedResource[]|null); + /** TemporalAsset window */ + window?: (google.cloud.asset.v1.ITimeWindow|null); + + /** TemporalAsset deleted */ + deleted?: (boolean|null); + + /** TemporalAsset asset */ + asset?: (google.cloud.asset.v1.IAsset|null); + + /** TemporalAsset priorAssetState */ + priorAssetState?: (google.cloud.asset.v1.TemporalAsset.PriorAssetState|keyof typeof google.cloud.asset.v1.TemporalAsset.PriorAssetState|null); + + /** TemporalAsset priorAsset */ + priorAsset?: (google.cloud.asset.v1.IAsset|null); } - /** Represents a RelatedResources. */ - class RelatedResources implements IRelatedResources { + /** Represents a TemporalAsset. */ + class TemporalAsset implements ITemporalAsset { /** - * Constructs a new RelatedResources. + * Constructs a new TemporalAsset. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IRelatedResources); + constructor(properties?: google.cloud.asset.v1.ITemporalAsset); - /** RelatedResources relatedResources. */ - public relatedResources: google.cloud.asset.v1.IRelatedResource[]; + /** TemporalAsset window. */ + public window?: (google.cloud.asset.v1.ITimeWindow|null); + + /** TemporalAsset deleted. */ + public deleted: boolean; + + /** TemporalAsset asset. */ + public asset?: (google.cloud.asset.v1.IAsset|null); + + /** TemporalAsset priorAssetState. */ + public priorAssetState: (google.cloud.asset.v1.TemporalAsset.PriorAssetState|keyof typeof google.cloud.asset.v1.TemporalAsset.PriorAssetState); + + /** TemporalAsset priorAsset. */ + public priorAsset?: (google.cloud.asset.v1.IAsset|null); /** - * Creates a new RelatedResources instance using the specified properties. + * Creates a new TemporalAsset instance using the specified properties. * @param [properties] Properties to set - * @returns RelatedResources instance + * @returns TemporalAsset instance */ - public static create(properties?: google.cloud.asset.v1.IRelatedResources): google.cloud.asset.v1.RelatedResources; + public static create(properties?: google.cloud.asset.v1.ITemporalAsset): google.cloud.asset.v1.TemporalAsset; /** - * Encodes the specified RelatedResources message. Does not implicitly {@link google.cloud.asset.v1.RelatedResources.verify|verify} messages. - * @param message RelatedResources message or plain object to encode + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IRelatedResources, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RelatedResources message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelatedResources.verify|verify} messages. - * @param message RelatedResources message or plain object to encode + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IRelatedResources, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RelatedResources message from the specified reader or buffer. + * Decodes a TemporalAsset message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RelatedResources + * @returns TemporalAsset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.RelatedResources; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.TemporalAsset; /** - * Decodes a RelatedResources message from the specified reader or buffer, length delimited. + * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RelatedResources + * @returns TemporalAsset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.RelatedResources; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.TemporalAsset; /** - * Verifies a RelatedResources message. + * Verifies a TemporalAsset message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a RelatedResources message from a plain object. Also converts values to their respective internal types. + * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RelatedResources + * @returns TemporalAsset */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.RelatedResources; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.TemporalAsset; /** - * Creates a plain object from a RelatedResources message. Also converts values to other types if specified. - * @param message RelatedResources + * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * @param message TemporalAsset * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.RelatedResources, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.TemporalAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RelatedResources to JSON. + * Converts this TemporalAsset to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a RelatedResource. */ - interface IRelatedResource { + namespace TemporalAsset { - /** RelatedResource assetType */ - assetType?: (string|null); + /** PriorAssetState enum. */ + enum PriorAssetState { + PRIOR_ASSET_STATE_UNSPECIFIED = 0, + PRESENT = 1, + INVALID = 2, + DOES_NOT_EXIST = 3, + DELETED = 4 + } + } - /** RelatedResource fullResourceName */ - fullResourceName?: (string|null); + /** Properties of a TimeWindow. */ + interface ITimeWindow { + + /** TimeWindow startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** TimeWindow endTime */ + endTime?: (google.protobuf.ITimestamp|null); } - /** Represents a RelatedResource. */ - class RelatedResource implements IRelatedResource { + /** Represents a TimeWindow. */ + class TimeWindow implements ITimeWindow { /** - * Constructs a new RelatedResource. + * Constructs a new TimeWindow. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IRelatedResource); + constructor(properties?: google.cloud.asset.v1.ITimeWindow); - /** RelatedResource assetType. */ - public assetType: string; + /** TimeWindow startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); - /** RelatedResource fullResourceName. */ - public fullResourceName: string; + /** TimeWindow endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); /** - * Creates a new RelatedResource instance using the specified properties. + * Creates a new TimeWindow instance using the specified properties. * @param [properties] Properties to set - * @returns RelatedResource instance + * @returns TimeWindow instance */ - public static create(properties?: google.cloud.asset.v1.IRelatedResource): google.cloud.asset.v1.RelatedResource; + public static create(properties?: google.cloud.asset.v1.ITimeWindow): google.cloud.asset.v1.TimeWindow; /** - * Encodes the specified RelatedResource message. Does not implicitly {@link google.cloud.asset.v1.RelatedResource.verify|verify} messages. - * @param message RelatedResource message or plain object to encode + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. + * @param message TimeWindow message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IRelatedResource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RelatedResource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelatedResource.verify|verify} messages. - * @param message RelatedResource message or plain object to encode + * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. + * @param message TimeWindow message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IRelatedResource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RelatedResource message from the specified reader or buffer. + * Decodes a TimeWindow message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RelatedResource + * @returns TimeWindow * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.RelatedResource; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.TimeWindow; /** - * Decodes a RelatedResource message from the specified reader or buffer, length delimited. + * Decodes a TimeWindow message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RelatedResource + * @returns TimeWindow * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.RelatedResource; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.TimeWindow; /** - * Verifies a RelatedResource message. + * Verifies a TimeWindow message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a RelatedResource message from a plain object. Also converts values to their respective internal types. + * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RelatedResource + * @returns TimeWindow */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.RelatedResource; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.TimeWindow; /** - * Creates a plain object from a RelatedResource message. Also converts values to other types if specified. - * @param message RelatedResource + * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. + * @param message TimeWindow * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.RelatedResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RelatedResource to JSON. + * Converts this TimeWindow to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an IamPolicySearchResult. */ - interface IIamPolicySearchResult { + /** Properties of an Asset. */ + interface IAsset { - /** IamPolicySearchResult resource */ - resource?: (string|null); + /** Asset updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); - /** IamPolicySearchResult assetType */ + /** Asset name */ + name?: (string|null); + + /** Asset assetType */ assetType?: (string|null); - /** IamPolicySearchResult project */ - project?: (string|null); + /** Asset resource */ + resource?: (google.cloud.asset.v1.IResource|null); - /** IamPolicySearchResult folders */ - folders?: (string[]|null); + /** Asset iamPolicy */ + iamPolicy?: (google.iam.v1.IPolicy|null); - /** IamPolicySearchResult organization */ - organization?: (string|null); + /** Asset orgPolicy */ + orgPolicy?: (google.cloud.orgpolicy.v1.IPolicy[]|null); - /** IamPolicySearchResult policy */ - policy?: (google.iam.v1.IPolicy|null); + /** Asset accessPolicy */ + accessPolicy?: (google.identity.accesscontextmanager.v1.IAccessPolicy|null); - /** IamPolicySearchResult explanation */ - explanation?: (google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null); + /** Asset accessLevel */ + accessLevel?: (google.identity.accesscontextmanager.v1.IAccessLevel|null); + + /** Asset servicePerimeter */ + servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); + + /** Asset osInventory */ + osInventory?: (google.cloud.osconfig.v1.IInventory|null); + + /** Asset relatedAssets */ + relatedAssets?: (google.cloud.asset.v1.IRelatedAssets|null); + + /** Asset relatedAsset */ + relatedAsset?: (google.cloud.asset.v1.IRelatedAsset|null); + + /** Asset ancestors */ + ancestors?: (string[]|null); } - /** Represents an IamPolicySearchResult. */ - class IamPolicySearchResult implements IIamPolicySearchResult { + /** Represents an Asset. */ + class Asset implements IAsset { /** - * Constructs a new IamPolicySearchResult. + * Constructs a new Asset. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IIamPolicySearchResult); + constructor(properties?: google.cloud.asset.v1.IAsset); - /** IamPolicySearchResult resource. */ - public resource: string; + /** Asset updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); - /** IamPolicySearchResult assetType. */ + /** Asset name. */ + public name: string; + + /** Asset assetType. */ public assetType: string; - /** IamPolicySearchResult project. */ - public project: string; + /** Asset resource. */ + public resource?: (google.cloud.asset.v1.IResource|null); - /** IamPolicySearchResult folders. */ - public folders: string[]; + /** Asset iamPolicy. */ + public iamPolicy?: (google.iam.v1.IPolicy|null); - /** IamPolicySearchResult organization. */ - public organization: string; + /** Asset orgPolicy. */ + public orgPolicy: google.cloud.orgpolicy.v1.IPolicy[]; - /** IamPolicySearchResult policy. */ - public policy?: (google.iam.v1.IPolicy|null); + /** Asset accessPolicy. */ + public accessPolicy?: (google.identity.accesscontextmanager.v1.IAccessPolicy|null); - /** IamPolicySearchResult explanation. */ - public explanation?: (google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null); + /** Asset accessLevel. */ + public accessLevel?: (google.identity.accesscontextmanager.v1.IAccessLevel|null); + + /** Asset servicePerimeter. */ + public servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); + + /** Asset osInventory. */ + public osInventory?: (google.cloud.osconfig.v1.IInventory|null); + + /** Asset relatedAssets. */ + public relatedAssets?: (google.cloud.asset.v1.IRelatedAssets|null); + + /** Asset relatedAsset. */ + public relatedAsset?: (google.cloud.asset.v1.IRelatedAsset|null); + + /** Asset ancestors. */ + public ancestors: string[]; + + /** Asset accessContextPolicy. */ + public accessContextPolicy?: ("accessPolicy"|"accessLevel"|"servicePerimeter"); /** - * Creates a new IamPolicySearchResult instance using the specified properties. + * Creates a new Asset instance using the specified properties. * @param [properties] Properties to set - * @returns IamPolicySearchResult instance + * @returns Asset instance */ - public static create(properties?: google.cloud.asset.v1.IIamPolicySearchResult): google.cloud.asset.v1.IamPolicySearchResult; + public static create(properties?: google.cloud.asset.v1.IAsset): google.cloud.asset.v1.Asset; /** - * Encodes the specified IamPolicySearchResult message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. - * @param message IamPolicySearchResult message or plain object to encode + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IIamPolicySearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified IamPolicySearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. - * @param message IamPolicySearchResult message or plain object to encode + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IIamPolicySearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an IamPolicySearchResult message from the specified reader or buffer. + * Decodes an Asset message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns IamPolicySearchResult + * @returns Asset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.IamPolicySearchResult; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.Asset; /** - * Decodes an IamPolicySearchResult message from the specified reader or buffer, length delimited. + * Decodes an Asset message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns IamPolicySearchResult + * @returns Asset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.IamPolicySearchResult; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.Asset; /** - * Verifies an IamPolicySearchResult message. + * Verifies an Asset message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an IamPolicySearchResult message from a plain object. Also converts values to their respective internal types. + * Creates an Asset message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns IamPolicySearchResult + * @returns Asset */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicySearchResult; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Asset; /** - * Creates a plain object from an IamPolicySearchResult message. Also converts values to other types if specified. - * @param message IamPolicySearchResult + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @param message Asset * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.IamPolicySearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this IamPolicySearchResult to JSON. + * Converts this Asset to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace IamPolicySearchResult { + /** Properties of a Resource. */ + interface IResource { - /** Properties of an Explanation. */ - interface IExplanation { + /** Resource version */ + version?: (string|null); - /** Explanation matchedPermissions */ - matchedPermissions?: ({ [k: string]: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions }|null); - } + /** Resource discoveryDocumentUri */ + discoveryDocumentUri?: (string|null); - /** Represents an Explanation. */ - class Explanation implements IExplanation { + /** Resource discoveryName */ + discoveryName?: (string|null); - /** - * Constructs a new Explanation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IamPolicySearchResult.IExplanation); + /** Resource resourceUrl */ + resourceUrl?: (string|null); - /** Explanation matchedPermissions. */ - public matchedPermissions: { [k: string]: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions }; + /** Resource parent */ + parent?: (string|null); - /** - * Creates a new Explanation instance using the specified properties. - * @param [properties] Properties to set - * @returns Explanation instance - */ - public static create(properties?: google.cloud.asset.v1.IamPolicySearchResult.IExplanation): google.cloud.asset.v1.IamPolicySearchResult.Explanation; + /** Resource data */ + data?: (google.protobuf.IStruct|null); - /** - * Encodes the specified Explanation message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. - * @param message Explanation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.IamPolicySearchResult.IExplanation, writer?: $protobuf.Writer): $protobuf.Writer; + /** Resource location */ + location?: (string|null); + } - /** - * Encodes the specified Explanation message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. - * @param message Explanation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1.IamPolicySearchResult.IExplanation, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a Resource. */ + class Resource implements IResource { - /** - * Decodes an Explanation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Explanation - * @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.IamPolicySearchResult.Explanation; + /** + * Constructs a new Resource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IResource); - /** - * Decodes an Explanation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Explanation - * @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.IamPolicySearchResult.Explanation; + /** Resource version. */ + public version: string; - /** - * Verifies an Explanation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Resource discoveryDocumentUri. */ + public discoveryDocumentUri: string; - /** - * Creates an Explanation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Explanation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicySearchResult.Explanation; - - /** - * Creates a plain object from an Explanation message. Also converts values to other types if specified. - * @param message Explanation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Explanation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace Explanation { - - /** Properties of a Permissions. */ - interface IPermissions { - - /** Permissions permissions */ - permissions?: (string[]|null); - } - - /** Represents a Permissions. */ - class Permissions implements IPermissions { - - /** - * Constructs a new Permissions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions); - - /** Permissions permissions. */ - public permissions: string[]; - - /** - * Creates a new Permissions instance using the specified properties. - * @param [properties] Properties to set - * @returns Permissions instance - */ - public static create(properties?: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions): google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions; - - /** - * Encodes the specified Permissions message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. - * @param message Permissions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Permissions message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. - * @param message Permissions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Permissions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Permissions - * @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.IamPolicySearchResult.Explanation.Permissions; - - /** - * Decodes a Permissions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Permissions - * @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.IamPolicySearchResult.Explanation.Permissions; - - /** - * Verifies a Permissions 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 Permissions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Permissions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions; - - /** - * Creates a plain object from a Permissions message. Also converts values to other types if specified. - * @param message Permissions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Permissions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } - - /** Properties of an IamPolicyAnalysisState. */ - interface IIamPolicyAnalysisState { - - /** IamPolicyAnalysisState code */ - code?: (google.rpc.Code|keyof typeof google.rpc.Code|null); - - /** IamPolicyAnalysisState cause */ - cause?: (string|null); - } + /** Resource discoveryName. */ + public discoveryName: string; - /** Represents an IamPolicyAnalysisState. */ - class IamPolicyAnalysisState implements IIamPolicyAnalysisState { + /** Resource resourceUrl. */ + public resourceUrl: string; - /** - * Constructs a new IamPolicyAnalysisState. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IIamPolicyAnalysisState); + /** Resource parent. */ + public parent: string; - /** IamPolicyAnalysisState code. */ - public code: (google.rpc.Code|keyof typeof google.rpc.Code); + /** Resource data. */ + public data?: (google.protobuf.IStruct|null); - /** IamPolicyAnalysisState cause. */ - public cause: string; + /** Resource location. */ + public location: string; /** - * Creates a new IamPolicyAnalysisState instance using the specified properties. + * Creates a new Resource instance using the specified properties. * @param [properties] Properties to set - * @returns IamPolicyAnalysisState instance + * @returns Resource instance */ - public static create(properties?: google.cloud.asset.v1.IIamPolicyAnalysisState): google.cloud.asset.v1.IamPolicyAnalysisState; + public static create(properties?: google.cloud.asset.v1.IResource): google.cloud.asset.v1.Resource; /** - * Encodes the specified IamPolicyAnalysisState message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisState.verify|verify} messages. - * @param message IamPolicyAnalysisState message or plain object to encode + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IIamPolicyAnalysisState, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified IamPolicyAnalysisState message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisState.verify|verify} messages. - * @param message IamPolicyAnalysisState message or plain object to encode + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IIamPolicyAnalysisState, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an IamPolicyAnalysisState message from the specified reader or buffer. + * Decodes a Resource message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns IamPolicyAnalysisState + * @returns Resource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.IamPolicyAnalysisState; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.Resource; /** - * Decodes an IamPolicyAnalysisState message from the specified reader or buffer, length delimited. + * Decodes a Resource message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns IamPolicyAnalysisState + * @returns Resource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.IamPolicyAnalysisState; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.Resource; /** - * Verifies an IamPolicyAnalysisState message. + * Verifies a Resource message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an IamPolicyAnalysisState message from a plain object. Also converts values to their respective internal types. + * Creates a Resource message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns IamPolicyAnalysisState + * @returns Resource */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisState; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Resource; /** - * Creates a plain object from an IamPolicyAnalysisState message. Also converts values to other types if specified. - * @param message IamPolicyAnalysisState + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @param message Resource * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisState, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this IamPolicyAnalysisState to JSON. + * Converts this Resource to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ConditionEvaluation. */ - interface IConditionEvaluation { + /** Properties of a RelatedAssets. */ + interface IRelatedAssets { - /** ConditionEvaluation evaluationValue */ - evaluationValue?: (google.cloud.asset.v1.ConditionEvaluation.EvaluationValue|keyof typeof google.cloud.asset.v1.ConditionEvaluation.EvaluationValue|null); + /** RelatedAssets relationshipAttributes */ + relationshipAttributes?: (google.cloud.asset.v1.IRelationshipAttributes|null); + + /** RelatedAssets assets */ + assets?: (google.cloud.asset.v1.IRelatedAsset[]|null); } - /** Represents a ConditionEvaluation. */ - class ConditionEvaluation implements IConditionEvaluation { + /** Represents a RelatedAssets. */ + class RelatedAssets implements IRelatedAssets { /** - * Constructs a new ConditionEvaluation. + * Constructs a new RelatedAssets. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IConditionEvaluation); + constructor(properties?: google.cloud.asset.v1.IRelatedAssets); - /** ConditionEvaluation evaluationValue. */ - public evaluationValue: (google.cloud.asset.v1.ConditionEvaluation.EvaluationValue|keyof typeof google.cloud.asset.v1.ConditionEvaluation.EvaluationValue); + /** RelatedAssets relationshipAttributes. */ + public relationshipAttributes?: (google.cloud.asset.v1.IRelationshipAttributes|null); + + /** RelatedAssets assets. */ + public assets: google.cloud.asset.v1.IRelatedAsset[]; /** - * Creates a new ConditionEvaluation instance using the specified properties. + * Creates a new RelatedAssets instance using the specified properties. * @param [properties] Properties to set - * @returns ConditionEvaluation instance + * @returns RelatedAssets instance */ - public static create(properties?: google.cloud.asset.v1.IConditionEvaluation): google.cloud.asset.v1.ConditionEvaluation; + public static create(properties?: google.cloud.asset.v1.IRelatedAssets): google.cloud.asset.v1.RelatedAssets; /** - * Encodes the specified ConditionEvaluation message. Does not implicitly {@link google.cloud.asset.v1.ConditionEvaluation.verify|verify} messages. - * @param message ConditionEvaluation message or plain object to encode + * Encodes the specified RelatedAssets message. Does not implicitly {@link google.cloud.asset.v1.RelatedAssets.verify|verify} messages. + * @param message RelatedAssets message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IConditionEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IRelatedAssets, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ConditionEvaluation message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ConditionEvaluation.verify|verify} messages. - * @param message ConditionEvaluation message or plain object to encode + * Encodes the specified RelatedAssets message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelatedAssets.verify|verify} messages. + * @param message RelatedAssets message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IConditionEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IRelatedAssets, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ConditionEvaluation message from the specified reader or buffer. + * Decodes a RelatedAssets message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ConditionEvaluation + * @returns RelatedAssets * @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.ConditionEvaluation; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.RelatedAssets; /** - * Decodes a ConditionEvaluation message from the specified reader or buffer, length delimited. + * Decodes a RelatedAssets message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ConditionEvaluation + * @returns RelatedAssets * @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.ConditionEvaluation; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.RelatedAssets; /** - * Verifies a ConditionEvaluation message. + * Verifies a RelatedAssets 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 ConditionEvaluation message from a plain object. Also converts values to their respective internal types. + * Creates a RelatedAssets message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ConditionEvaluation + * @returns RelatedAssets */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ConditionEvaluation; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.RelatedAssets; /** - * Creates a plain object from a ConditionEvaluation message. Also converts values to other types if specified. - * @param message ConditionEvaluation - * @param [options] Conversion options + * Creates a plain object from a RelatedAssets message. Also converts values to other types if specified. + * @param message RelatedAssets + * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.ConditionEvaluation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.RelatedAssets, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ConditionEvaluation to JSON. + * Converts this RelatedAssets to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace ConditionEvaluation { - - /** EvaluationValue enum. */ - enum EvaluationValue { - EVALUATION_VALUE_UNSPECIFIED = 0, - TRUE = 1, - FALSE = 2, - CONDITIONAL = 3 - } - } - - /** Properties of an IamPolicyAnalysisResult. */ - interface IIamPolicyAnalysisResult { - - /** IamPolicyAnalysisResult attachedResourceFullName */ - attachedResourceFullName?: (string|null); + /** Properties of a RelationshipAttributes. */ + interface IRelationshipAttributes { - /** IamPolicyAnalysisResult iamBinding */ - iamBinding?: (google.iam.v1.IBinding|null); + /** RelationshipAttributes type */ + type?: (string|null); - /** IamPolicyAnalysisResult accessControlLists */ - accessControlLists?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList[]|null); + /** RelationshipAttributes sourceResourceType */ + sourceResourceType?: (string|null); - /** IamPolicyAnalysisResult identityList */ - identityList?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList|null); + /** RelationshipAttributes targetResourceType */ + targetResourceType?: (string|null); - /** IamPolicyAnalysisResult fullyExplored */ - fullyExplored?: (boolean|null); + /** RelationshipAttributes action */ + action?: (string|null); } - /** Represents an IamPolicyAnalysisResult. */ - class IamPolicyAnalysisResult implements IIamPolicyAnalysisResult { + /** Represents a RelationshipAttributes. */ + class RelationshipAttributes implements IRelationshipAttributes { /** - * Constructs a new IamPolicyAnalysisResult. + * Constructs a new RelationshipAttributes. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.asset.v1.IIamPolicyAnalysisResult); - - /** IamPolicyAnalysisResult attachedResourceFullName. */ - public attachedResourceFullName: string; + constructor(properties?: google.cloud.asset.v1.IRelationshipAttributes); - /** IamPolicyAnalysisResult iamBinding. */ - public iamBinding?: (google.iam.v1.IBinding|null); + /** RelationshipAttributes type. */ + public type: string; - /** IamPolicyAnalysisResult accessControlLists. */ - public accessControlLists: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList[]; + /** RelationshipAttributes sourceResourceType. */ + public sourceResourceType: string; - /** IamPolicyAnalysisResult identityList. */ - public identityList?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList|null); + /** RelationshipAttributes targetResourceType. */ + public targetResourceType: string; - /** IamPolicyAnalysisResult fullyExplored. */ - public fullyExplored: boolean; + /** RelationshipAttributes action. */ + public action: string; /** - * Creates a new IamPolicyAnalysisResult instance using the specified properties. + * Creates a new RelationshipAttributes instance using the specified properties. * @param [properties] Properties to set - * @returns IamPolicyAnalysisResult instance + * @returns RelationshipAttributes instance */ - public static create(properties?: google.cloud.asset.v1.IIamPolicyAnalysisResult): google.cloud.asset.v1.IamPolicyAnalysisResult; + public static create(properties?: google.cloud.asset.v1.IRelationshipAttributes): google.cloud.asset.v1.RelationshipAttributes; /** - * Encodes the specified IamPolicyAnalysisResult message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.verify|verify} messages. - * @param message IamPolicyAnalysisResult message or plain object to encode + * Encodes the specified RelationshipAttributes message. Does not implicitly {@link google.cloud.asset.v1.RelationshipAttributes.verify|verify} messages. + * @param message RelationshipAttributes message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.asset.v1.IIamPolicyAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.asset.v1.IRelationshipAttributes, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified IamPolicyAnalysisResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.verify|verify} messages. - * @param message IamPolicyAnalysisResult message or plain object to encode + * Encodes the specified RelationshipAttributes message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelationshipAttributes.verify|verify} messages. + * @param message RelationshipAttributes message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.asset.v1.IIamPolicyAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.asset.v1.IRelationshipAttributes, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an IamPolicyAnalysisResult message from the specified reader or buffer. + * Decodes a RelationshipAttributes message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns IamPolicyAnalysisResult + * @returns RelationshipAttributes * @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.IamPolicyAnalysisResult; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.RelationshipAttributes; /** - * Decodes an IamPolicyAnalysisResult message from the specified reader or buffer, length delimited. + * Decodes a RelationshipAttributes message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns IamPolicyAnalysisResult + * @returns RelationshipAttributes * @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.IamPolicyAnalysisResult; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.RelationshipAttributes; /** - * Verifies an IamPolicyAnalysisResult message. + * Verifies a RelationshipAttributes 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 IamPolicyAnalysisResult message from a plain object. Also converts values to their respective internal types. + * Creates a RelationshipAttributes message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns IamPolicyAnalysisResult + * @returns RelationshipAttributes */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisResult; + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.RelationshipAttributes; /** - * Creates a plain object from an IamPolicyAnalysisResult message. Also converts values to other types if specified. - * @param message IamPolicyAnalysisResult + * Creates a plain object from a RelationshipAttributes message. Also converts values to other types if specified. + * @param message RelationshipAttributes * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.asset.v1.RelationshipAttributes, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this IamPolicyAnalysisResult to JSON. + * Converts this RelationshipAttributes to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace IamPolicyAnalysisResult { - - /** Properties of a Resource. */ - interface IResource { + /** Properties of a RelatedAsset. */ + interface IRelatedAsset { - /** Resource fullResourceName */ - fullResourceName?: (string|null); + /** RelatedAsset asset */ + asset?: (string|null); - /** Resource analysisState */ - analysisState?: (google.cloud.asset.v1.IIamPolicyAnalysisState|null); - } + /** RelatedAsset assetType */ + assetType?: (string|null); - /** Represents a Resource. */ - class Resource implements IResource { + /** RelatedAsset ancestors */ + ancestors?: (string[]|null); - /** - * Constructs a new Resource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IResource); + /** RelatedAsset relationshipType */ + relationshipType?: (string|null); + } - /** Resource fullResourceName. */ - public fullResourceName: string; + /** Represents a RelatedAsset. */ + class RelatedAsset implements IRelatedAsset { - /** Resource analysisState. */ - public analysisState?: (google.cloud.asset.v1.IIamPolicyAnalysisState|null); + /** + * Constructs a new RelatedAsset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IRelatedAsset); - /** - * Creates a new Resource instance using the specified properties. - * @param [properties] Properties to set - * @returns Resource instance - */ - public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IResource): google.cloud.asset.v1.IamPolicyAnalysisResult.Resource; + /** RelatedAsset asset. */ + public asset: string; - /** - * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.verify|verify} messages. - * @param message Resource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + /** RelatedAsset assetType. */ + public assetType: string; - /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.verify|verify} messages. - * @param message Resource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + /** RelatedAsset ancestors. */ + public ancestors: string[]; - /** - * Decodes a Resource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Resource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.IamPolicyAnalysisResult.Resource; + /** RelatedAsset relationshipType. */ + public relationshipType: string; - /** - * Decodes a Resource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Resource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.IamPolicyAnalysisResult.Resource; + /** + * Creates a new RelatedAsset instance using the specified properties. + * @param [properties] Properties to set + * @returns RelatedAsset instance + */ + public static create(properties?: google.cloud.asset.v1.IRelatedAsset): google.cloud.asset.v1.RelatedAsset; - /** - * Verifies a Resource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Encodes the specified RelatedAsset message. Does not implicitly {@link google.cloud.asset.v1.RelatedAsset.verify|verify} messages. + * @param message RelatedAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IRelatedAsset, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a Resource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Resource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisResult.Resource; + /** + * Encodes the specified RelatedAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelatedAsset.verify|verify} messages. + * @param message RelatedAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IRelatedAsset, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from a Resource message. Also converts values to other types if specified. - * @param message Resource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisResult.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a RelatedAsset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RelatedAsset + * @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.RelatedAsset; - /** - * Converts this Resource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a RelatedAsset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RelatedAsset + * @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.RelatedAsset; - /** Properties of an Access. */ + /** + * Verifies a RelatedAsset 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 RelatedAsset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RelatedAsset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.RelatedAsset; + + /** + * Creates a plain object from a RelatedAsset message. Also converts values to other types if specified. + * @param message RelatedAsset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.RelatedAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RelatedAsset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ResourceSearchResult. */ + interface IResourceSearchResult { + + /** ResourceSearchResult name */ + name?: (string|null); + + /** ResourceSearchResult assetType */ + assetType?: (string|null); + + /** ResourceSearchResult project */ + project?: (string|null); + + /** ResourceSearchResult folders */ + folders?: (string[]|null); + + /** ResourceSearchResult organization */ + organization?: (string|null); + + /** ResourceSearchResult displayName */ + displayName?: (string|null); + + /** ResourceSearchResult description */ + description?: (string|null); + + /** ResourceSearchResult location */ + location?: (string|null); + + /** ResourceSearchResult labels */ + labels?: ({ [k: string]: string }|null); + + /** ResourceSearchResult networkTags */ + networkTags?: (string[]|null); + + /** ResourceSearchResult kmsKey */ + kmsKey?: (string|null); + + /** ResourceSearchResult createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ResourceSearchResult updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ResourceSearchResult state */ + state?: (string|null); + + /** ResourceSearchResult additionalAttributes */ + additionalAttributes?: (google.protobuf.IStruct|null); + + /** ResourceSearchResult parentFullResourceName */ + parentFullResourceName?: (string|null); + + /** ResourceSearchResult versionedResources */ + versionedResources?: (google.cloud.asset.v1.IVersionedResource[]|null); + + /** ResourceSearchResult attachedResources */ + attachedResources?: (google.cloud.asset.v1.IAttachedResource[]|null); + + /** ResourceSearchResult relationships */ + relationships?: ({ [k: string]: google.cloud.asset.v1.IRelatedResources }|null); + + /** ResourceSearchResult tagKeys */ + tagKeys?: (string[]|null); + + /** ResourceSearchResult tagValues */ + tagValues?: (string[]|null); + + /** ResourceSearchResult tagValueIds */ + tagValueIds?: (string[]|null); + + /** ResourceSearchResult parentAssetType */ + parentAssetType?: (string|null); + } + + /** Represents a ResourceSearchResult. */ + class ResourceSearchResult implements IResourceSearchResult { + + /** + * Constructs a new ResourceSearchResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IResourceSearchResult); + + /** ResourceSearchResult name. */ + public name: string; + + /** ResourceSearchResult assetType. */ + public assetType: string; + + /** ResourceSearchResult project. */ + public project: string; + + /** ResourceSearchResult folders. */ + public folders: string[]; + + /** ResourceSearchResult organization. */ + public organization: string; + + /** ResourceSearchResult displayName. */ + public displayName: string; + + /** ResourceSearchResult description. */ + public description: string; + + /** ResourceSearchResult location. */ + public location: string; + + /** ResourceSearchResult labels. */ + public labels: { [k: string]: string }; + + /** ResourceSearchResult networkTags. */ + public networkTags: string[]; + + /** ResourceSearchResult kmsKey. */ + public kmsKey: string; + + /** ResourceSearchResult createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ResourceSearchResult updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ResourceSearchResult state. */ + public state: string; + + /** ResourceSearchResult additionalAttributes. */ + public additionalAttributes?: (google.protobuf.IStruct|null); + + /** ResourceSearchResult parentFullResourceName. */ + public parentFullResourceName: string; + + /** ResourceSearchResult versionedResources. */ + public versionedResources: google.cloud.asset.v1.IVersionedResource[]; + + /** ResourceSearchResult attachedResources. */ + public attachedResources: google.cloud.asset.v1.IAttachedResource[]; + + /** ResourceSearchResult relationships. */ + public relationships: { [k: string]: google.cloud.asset.v1.IRelatedResources }; + + /** ResourceSearchResult tagKeys. */ + public tagKeys: string[]; + + /** ResourceSearchResult tagValues. */ + public tagValues: string[]; + + /** ResourceSearchResult tagValueIds. */ + public tagValueIds: string[]; + + /** ResourceSearchResult parentAssetType. */ + public parentAssetType: string; + + /** + * Creates a new ResourceSearchResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceSearchResult instance + */ + public static create(properties?: google.cloud.asset.v1.IResourceSearchResult): google.cloud.asset.v1.ResourceSearchResult; + + /** + * Encodes the specified ResourceSearchResult message. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. + * @param message ResourceSearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IResourceSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceSearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. + * @param message ResourceSearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IResourceSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceSearchResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceSearchResult + * @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.ResourceSearchResult; + + /** + * Decodes a ResourceSearchResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceSearchResult + * @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.ResourceSearchResult; + + /** + * Verifies a ResourceSearchResult 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 ResourceSearchResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceSearchResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ResourceSearchResult; + + /** + * Creates a plain object from a ResourceSearchResult message. Also converts values to other types if specified. + * @param message ResourceSearchResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.ResourceSearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceSearchResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a VersionedResource. */ + interface IVersionedResource { + + /** VersionedResource version */ + version?: (string|null); + + /** VersionedResource resource */ + resource?: (google.protobuf.IStruct|null); + } + + /** Represents a VersionedResource. */ + class VersionedResource implements IVersionedResource { + + /** + * Constructs a new VersionedResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IVersionedResource); + + /** VersionedResource version. */ + public version: string; + + /** VersionedResource resource. */ + public resource?: (google.protobuf.IStruct|null); + + /** + * Creates a new VersionedResource instance using the specified properties. + * @param [properties] Properties to set + * @returns VersionedResource instance + */ + public static create(properties?: google.cloud.asset.v1.IVersionedResource): google.cloud.asset.v1.VersionedResource; + + /** + * Encodes the specified VersionedResource message. Does not implicitly {@link google.cloud.asset.v1.VersionedResource.verify|verify} messages. + * @param message VersionedResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IVersionedResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VersionedResource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.VersionedResource.verify|verify} messages. + * @param message VersionedResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IVersionedResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VersionedResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VersionedResource + * @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.VersionedResource; + + /** + * Decodes a VersionedResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VersionedResource + * @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.VersionedResource; + + /** + * Verifies a VersionedResource 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 VersionedResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VersionedResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.VersionedResource; + + /** + * Creates a plain object from a VersionedResource message. Also converts values to other types if specified. + * @param message VersionedResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.VersionedResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VersionedResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AttachedResource. */ + interface IAttachedResource { + + /** AttachedResource assetType */ + assetType?: (string|null); + + /** AttachedResource versionedResources */ + versionedResources?: (google.cloud.asset.v1.IVersionedResource[]|null); + } + + /** Represents an AttachedResource. */ + class AttachedResource implements IAttachedResource { + + /** + * Constructs a new AttachedResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IAttachedResource); + + /** AttachedResource assetType. */ + public assetType: string; + + /** AttachedResource versionedResources. */ + public versionedResources: google.cloud.asset.v1.IVersionedResource[]; + + /** + * Creates a new AttachedResource instance using the specified properties. + * @param [properties] Properties to set + * @returns AttachedResource instance + */ + public static create(properties?: google.cloud.asset.v1.IAttachedResource): google.cloud.asset.v1.AttachedResource; + + /** + * Encodes the specified AttachedResource message. Does not implicitly {@link google.cloud.asset.v1.AttachedResource.verify|verify} messages. + * @param message AttachedResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IAttachedResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AttachedResource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AttachedResource.verify|verify} messages. + * @param message AttachedResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IAttachedResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AttachedResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AttachedResource + * @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.AttachedResource; + + /** + * Decodes an AttachedResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AttachedResource + * @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.AttachedResource; + + /** + * Verifies an AttachedResource 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 AttachedResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AttachedResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AttachedResource; + + /** + * Creates a plain object from an AttachedResource message. Also converts values to other types if specified. + * @param message AttachedResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.AttachedResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AttachedResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RelatedResources. */ + interface IRelatedResources { + + /** RelatedResources relatedResources */ + relatedResources?: (google.cloud.asset.v1.IRelatedResource[]|null); + } + + /** Represents a RelatedResources. */ + class RelatedResources implements IRelatedResources { + + /** + * Constructs a new RelatedResources. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IRelatedResources); + + /** RelatedResources relatedResources. */ + public relatedResources: google.cloud.asset.v1.IRelatedResource[]; + + /** + * Creates a new RelatedResources instance using the specified properties. + * @param [properties] Properties to set + * @returns RelatedResources instance + */ + public static create(properties?: google.cloud.asset.v1.IRelatedResources): google.cloud.asset.v1.RelatedResources; + + /** + * Encodes the specified RelatedResources message. Does not implicitly {@link google.cloud.asset.v1.RelatedResources.verify|verify} messages. + * @param message RelatedResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IRelatedResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RelatedResources message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelatedResources.verify|verify} messages. + * @param message RelatedResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IRelatedResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RelatedResources message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RelatedResources + * @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.RelatedResources; + + /** + * Decodes a RelatedResources message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RelatedResources + * @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.RelatedResources; + + /** + * Verifies a RelatedResources 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 RelatedResources message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RelatedResources + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.RelatedResources; + + /** + * Creates a plain object from a RelatedResources message. Also converts values to other types if specified. + * @param message RelatedResources + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.RelatedResources, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RelatedResources to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RelatedResource. */ + interface IRelatedResource { + + /** RelatedResource assetType */ + assetType?: (string|null); + + /** RelatedResource fullResourceName */ + fullResourceName?: (string|null); + } + + /** Represents a RelatedResource. */ + class RelatedResource implements IRelatedResource { + + /** + * Constructs a new RelatedResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IRelatedResource); + + /** RelatedResource assetType. */ + public assetType: string; + + /** RelatedResource fullResourceName. */ + public fullResourceName: string; + + /** + * Creates a new RelatedResource instance using the specified properties. + * @param [properties] Properties to set + * @returns RelatedResource instance + */ + public static create(properties?: google.cloud.asset.v1.IRelatedResource): google.cloud.asset.v1.RelatedResource; + + /** + * Encodes the specified RelatedResource message. Does not implicitly {@link google.cloud.asset.v1.RelatedResource.verify|verify} messages. + * @param message RelatedResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IRelatedResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RelatedResource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelatedResource.verify|verify} messages. + * @param message RelatedResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IRelatedResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RelatedResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RelatedResource + * @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.RelatedResource; + + /** + * Decodes a RelatedResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RelatedResource + * @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.RelatedResource; + + /** + * Verifies a RelatedResource 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 RelatedResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RelatedResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.RelatedResource; + + /** + * Creates a plain object from a RelatedResource message. Also converts values to other types if specified. + * @param message RelatedResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.RelatedResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RelatedResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an IamPolicySearchResult. */ + interface IIamPolicySearchResult { + + /** IamPolicySearchResult resource */ + resource?: (string|null); + + /** IamPolicySearchResult assetType */ + assetType?: (string|null); + + /** IamPolicySearchResult project */ + project?: (string|null); + + /** IamPolicySearchResult folders */ + folders?: (string[]|null); + + /** IamPolicySearchResult organization */ + organization?: (string|null); + + /** IamPolicySearchResult policy */ + policy?: (google.iam.v1.IPolicy|null); + + /** IamPolicySearchResult explanation */ + explanation?: (google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null); + } + + /** Represents an IamPolicySearchResult. */ + class IamPolicySearchResult implements IIamPolicySearchResult { + + /** + * Constructs a new IamPolicySearchResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IIamPolicySearchResult); + + /** IamPolicySearchResult resource. */ + public resource: string; + + /** IamPolicySearchResult assetType. */ + public assetType: string; + + /** IamPolicySearchResult project. */ + public project: string; + + /** IamPolicySearchResult folders. */ + public folders: string[]; + + /** IamPolicySearchResult organization. */ + public organization: string; + + /** IamPolicySearchResult policy. */ + public policy?: (google.iam.v1.IPolicy|null); + + /** IamPolicySearchResult explanation. */ + public explanation?: (google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null); + + /** + * Creates a new IamPolicySearchResult instance using the specified properties. + * @param [properties] Properties to set + * @returns IamPolicySearchResult instance + */ + public static create(properties?: google.cloud.asset.v1.IIamPolicySearchResult): google.cloud.asset.v1.IamPolicySearchResult; + + /** + * Encodes the specified IamPolicySearchResult message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. + * @param message IamPolicySearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IIamPolicySearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamPolicySearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. + * @param message IamPolicySearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IIamPolicySearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IamPolicySearchResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IamPolicySearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.IamPolicySearchResult; + + /** + * Decodes an IamPolicySearchResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IamPolicySearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.IamPolicySearchResult; + + /** + * Verifies an IamPolicySearchResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IamPolicySearchResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IamPolicySearchResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicySearchResult; + + /** + * Creates a plain object from an IamPolicySearchResult message. Also converts values to other types if specified. + * @param message IamPolicySearchResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicySearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamPolicySearchResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace IamPolicySearchResult { + + /** Properties of an Explanation. */ + interface IExplanation { + + /** Explanation matchedPermissions */ + matchedPermissions?: ({ [k: string]: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions }|null); + } + + /** Represents an Explanation. */ + class Explanation implements IExplanation { + + /** + * Constructs a new Explanation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicySearchResult.IExplanation); + + /** Explanation matchedPermissions. */ + public matchedPermissions: { [k: string]: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions }; + + /** + * Creates a new Explanation instance using the specified properties. + * @param [properties] Properties to set + * @returns Explanation instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicySearchResult.IExplanation): google.cloud.asset.v1.IamPolicySearchResult.Explanation; + + /** + * Encodes the specified Explanation message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. + * @param message Explanation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicySearchResult.IExplanation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Explanation message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. + * @param message Explanation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicySearchResult.IExplanation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Explanation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Explanation + * @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.IamPolicySearchResult.Explanation; + + /** + * Decodes an Explanation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Explanation + * @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.IamPolicySearchResult.Explanation; + + /** + * Verifies an Explanation 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 Explanation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Explanation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicySearchResult.Explanation; + + /** + * Creates a plain object from an Explanation message. Also converts values to other types if specified. + * @param message Explanation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Explanation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Explanation { + + /** Properties of a Permissions. */ + interface IPermissions { + + /** Permissions permissions */ + permissions?: (string[]|null); + } + + /** Represents a Permissions. */ + class Permissions implements IPermissions { + + /** + * Constructs a new Permissions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions); + + /** Permissions permissions. */ + public permissions: string[]; + + /** + * Creates a new Permissions instance using the specified properties. + * @param [properties] Properties to set + * @returns Permissions instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions): google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions; + + /** + * Encodes the specified Permissions message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. + * @param message Permissions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Permissions message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. + * @param message Permissions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Permissions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Permissions + * @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.IamPolicySearchResult.Explanation.Permissions; + + /** + * Decodes a Permissions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Permissions + * @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.IamPolicySearchResult.Explanation.Permissions; + + /** + * Verifies a Permissions 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 Permissions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Permissions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions; + + /** + * Creates a plain object from a Permissions message. Also converts values to other types if specified. + * @param message Permissions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Permissions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + } + + /** Properties of an IamPolicyAnalysisState. */ + interface IIamPolicyAnalysisState { + + /** IamPolicyAnalysisState code */ + code?: (google.rpc.Code|keyof typeof google.rpc.Code|null); + + /** IamPolicyAnalysisState cause */ + cause?: (string|null); + } + + /** Represents an IamPolicyAnalysisState. */ + class IamPolicyAnalysisState implements IIamPolicyAnalysisState { + + /** + * Constructs a new IamPolicyAnalysisState. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IIamPolicyAnalysisState); + + /** IamPolicyAnalysisState code. */ + public code: (google.rpc.Code|keyof typeof google.rpc.Code); + + /** IamPolicyAnalysisState cause. */ + public cause: string; + + /** + * Creates a new IamPolicyAnalysisState instance using the specified properties. + * @param [properties] Properties to set + * @returns IamPolicyAnalysisState instance + */ + public static create(properties?: google.cloud.asset.v1.IIamPolicyAnalysisState): google.cloud.asset.v1.IamPolicyAnalysisState; + + /** + * Encodes the specified IamPolicyAnalysisState message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisState.verify|verify} messages. + * @param message IamPolicyAnalysisState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IIamPolicyAnalysisState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamPolicyAnalysisState message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisState.verify|verify} messages. + * @param message IamPolicyAnalysisState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IIamPolicyAnalysisState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IamPolicyAnalysisState message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IamPolicyAnalysisState + * @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.IamPolicyAnalysisState; + + /** + * Decodes an IamPolicyAnalysisState message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IamPolicyAnalysisState + * @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.IamPolicyAnalysisState; + + /** + * Verifies an IamPolicyAnalysisState 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 IamPolicyAnalysisState message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IamPolicyAnalysisState + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisState; + + /** + * Creates a plain object from an IamPolicyAnalysisState message. Also converts values to other types if specified. + * @param message IamPolicyAnalysisState + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisState, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamPolicyAnalysisState to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ConditionEvaluation. */ + interface IConditionEvaluation { + + /** ConditionEvaluation evaluationValue */ + evaluationValue?: (google.cloud.asset.v1.ConditionEvaluation.EvaluationValue|keyof typeof google.cloud.asset.v1.ConditionEvaluation.EvaluationValue|null); + } + + /** Represents a ConditionEvaluation. */ + class ConditionEvaluation implements IConditionEvaluation { + + /** + * Constructs a new ConditionEvaluation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IConditionEvaluation); + + /** ConditionEvaluation evaluationValue. */ + public evaluationValue: (google.cloud.asset.v1.ConditionEvaluation.EvaluationValue|keyof typeof google.cloud.asset.v1.ConditionEvaluation.EvaluationValue); + + /** + * Creates a new ConditionEvaluation instance using the specified properties. + * @param [properties] Properties to set + * @returns ConditionEvaluation instance + */ + public static create(properties?: google.cloud.asset.v1.IConditionEvaluation): google.cloud.asset.v1.ConditionEvaluation; + + /** + * Encodes the specified ConditionEvaluation message. Does not implicitly {@link google.cloud.asset.v1.ConditionEvaluation.verify|verify} messages. + * @param message ConditionEvaluation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IConditionEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConditionEvaluation message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ConditionEvaluation.verify|verify} messages. + * @param message ConditionEvaluation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IConditionEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConditionEvaluation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConditionEvaluation + * @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.ConditionEvaluation; + + /** + * Decodes a ConditionEvaluation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConditionEvaluation + * @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.ConditionEvaluation; + + /** + * Verifies a ConditionEvaluation 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 ConditionEvaluation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConditionEvaluation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ConditionEvaluation; + + /** + * Creates a plain object from a ConditionEvaluation message. Also converts values to other types if specified. + * @param message ConditionEvaluation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.ConditionEvaluation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConditionEvaluation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ConditionEvaluation { + + /** EvaluationValue enum. */ + enum EvaluationValue { + EVALUATION_VALUE_UNSPECIFIED = 0, + TRUE = 1, + FALSE = 2, + CONDITIONAL = 3 + } + } + + /** Properties of an IamPolicyAnalysisResult. */ + interface IIamPolicyAnalysisResult { + + /** IamPolicyAnalysisResult attachedResourceFullName */ + attachedResourceFullName?: (string|null); + + /** IamPolicyAnalysisResult iamBinding */ + iamBinding?: (google.iam.v1.IBinding|null); + + /** IamPolicyAnalysisResult accessControlLists */ + accessControlLists?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList[]|null); + + /** IamPolicyAnalysisResult identityList */ + identityList?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList|null); + + /** IamPolicyAnalysisResult fullyExplored */ + fullyExplored?: (boolean|null); + } + + /** Represents an IamPolicyAnalysisResult. */ + class IamPolicyAnalysisResult implements IIamPolicyAnalysisResult { + + /** + * Constructs a new IamPolicyAnalysisResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IIamPolicyAnalysisResult); + + /** IamPolicyAnalysisResult attachedResourceFullName. */ + public attachedResourceFullName: string; + + /** IamPolicyAnalysisResult iamBinding. */ + public iamBinding?: (google.iam.v1.IBinding|null); + + /** IamPolicyAnalysisResult accessControlLists. */ + public accessControlLists: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList[]; + + /** IamPolicyAnalysisResult identityList. */ + public identityList?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList|null); + + /** IamPolicyAnalysisResult fullyExplored. */ + public fullyExplored: boolean; + + /** + * Creates a new IamPolicyAnalysisResult instance using the specified properties. + * @param [properties] Properties to set + * @returns IamPolicyAnalysisResult instance + */ + public static create(properties?: google.cloud.asset.v1.IIamPolicyAnalysisResult): google.cloud.asset.v1.IamPolicyAnalysisResult; + + /** + * Encodes the specified IamPolicyAnalysisResult message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.verify|verify} messages. + * @param message IamPolicyAnalysisResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IIamPolicyAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamPolicyAnalysisResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.verify|verify} messages. + * @param message IamPolicyAnalysisResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IIamPolicyAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IamPolicyAnalysisResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IamPolicyAnalysisResult + * @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.IamPolicyAnalysisResult; + + /** + * Decodes an IamPolicyAnalysisResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IamPolicyAnalysisResult + * @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.IamPolicyAnalysisResult; + + /** + * Verifies an IamPolicyAnalysisResult 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 IamPolicyAnalysisResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IamPolicyAnalysisResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisResult; + + /** + * Creates a plain object from an IamPolicyAnalysisResult message. Also converts values to other types if specified. + * @param message IamPolicyAnalysisResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamPolicyAnalysisResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace IamPolicyAnalysisResult { + + /** Properties of a Resource. */ + interface IResource { + + /** Resource fullResourceName */ + fullResourceName?: (string|null); + + /** Resource analysisState */ + analysisState?: (google.cloud.asset.v1.IIamPolicyAnalysisState|null); + } + + /** Represents a Resource. */ + class Resource implements IResource { + + /** + * Constructs a new Resource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IResource); + + /** Resource fullResourceName. */ + public fullResourceName: string; + + /** Resource analysisState. */ + public analysisState?: (google.cloud.asset.v1.IIamPolicyAnalysisState|null); + + /** + * Creates a new Resource instance using the specified properties. + * @param [properties] Properties to set + * @returns Resource instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IResource): google.cloud.asset.v1.IamPolicyAnalysisResult.Resource; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.IamPolicyAnalysisResult.Resource; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.IamPolicyAnalysisResult.Resource; + + /** + * Verifies a Resource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Resource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisResult.Resource; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @param message Resource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisResult.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Resource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Access. */ interface IAccess { /** Access role */ @@ -17601,1037 +18963,1345 @@ export namespace google { public toJSON(): { [k: string]: any }; } - /** Properties of a ServiceOptions. */ - interface IServiceOptions { + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @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.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @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.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions 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 ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @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.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @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.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions 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 MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); - /** ServiceOptions deprecated */ - deprecated?: (boolean|null); + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); - /** ServiceOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); - /** ServiceOptions .google.api.defaultHost */ - ".google.api.defaultHost"?: (string|null); + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); - /** ServiceOptions .google.api.oauthScopes */ - ".google.api.oauthScopes"?: (string|null); + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); } - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { /** - * Constructs a new ServiceOptions. + * Constructs a new UninterpretedOption. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IServiceOptions); + constructor(properties?: google.protobuf.IUninterpretedOption); - /** ServiceOptions deprecated. */ - public deprecated: boolean; + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; - /** ServiceOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; /** - * Creates a new ServiceOptions instance using the specified properties. + * Creates a new UninterpretedOption instance using the specified properties. * @param [properties] Properties to set - * @returns ServiceOptions instance + * @returns UninterpretedOption instance */ - public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ServiceOptions message from the specified reader or buffer. + * Decodes an UninterpretedOption message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ServiceOptions + * @returns UninterpretedOption * @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.protobuf.ServiceOptions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ServiceOptions + * @returns UninterpretedOption * @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.protobuf.ServiceOptions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; /** - * Verifies a ServiceOptions message. + * Verifies an UninterpretedOption 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 ServiceOptions message from a plain object. Also converts values to their respective internal types. + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ServiceOptions + * @returns UninterpretedOption */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @param message ServiceOptions + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ServiceOptions to JSON. + * Converts this UninterpretedOption to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a MethodOptions. */ - interface IMethodOptions { + namespace UninterpretedOption { - /** MethodOptions deprecated */ - deprecated?: (boolean|null); + /** Properties of a NamePart. */ + interface INamePart { - /** MethodOptions idempotencyLevel */ - idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + /** NamePart namePart */ + namePart: string; - /** MethodOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** NamePart isExtension */ + isExtension: boolean; + } - /** MethodOptions .google.api.http */ - ".google.api.http"?: (google.api.IHttpRule|null); + /** Represents a NamePart. */ + class NamePart implements INamePart { - /** MethodOptions .google.api.methodSignature */ - ".google.api.methodSignature"?: (string[]|null); + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); - /** MethodOptions .google.longrunning.operationInfo */ - ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @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.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @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.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart 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 NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } } - /** Represents a MethodOptions. */ - class MethodOptions implements IMethodOptions { + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { /** - * Constructs a new MethodOptions. + * Constructs a new SourceCodeInfo. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IMethodOptions); - - /** MethodOptions deprecated. */ - public deprecated: boolean; - - /** MethodOptions idempotencyLevel. */ - public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + constructor(properties?: google.protobuf.ISourceCodeInfo); - /** MethodOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; /** - * Creates a new MethodOptions instance using the specified properties. + * Creates a new SourceCodeInfo instance using the specified properties. * @param [properties] Properties to set - * @returns MethodOptions instance + * @returns SourceCodeInfo instance */ - public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MethodOptions message from the specified reader or buffer. + * Decodes a SourceCodeInfo message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns MethodOptions + * @returns SourceCodeInfo * @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.protobuf.MethodOptions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MethodOptions + * @returns SourceCodeInfo * @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.protobuf.MethodOptions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; /** - * Verifies a MethodOptions message. + * Verifies a SourceCodeInfo 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 MethodOptions message from a plain object. Also converts values to their respective internal types. + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MethodOptions + * @returns SourceCodeInfo */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @param message MethodOptions + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MethodOptions to JSON. + * Converts this SourceCodeInfo to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace MethodOptions { + namespace SourceCodeInfo { - /** IdempotencyLevel enum. */ - enum IdempotencyLevel { - IDEMPOTENCY_UNKNOWN = 0, - NO_SIDE_EFFECTS = 1, - IDEMPOTENT = 2 + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); } - } - /** Properties of an UninterpretedOption. */ - interface IUninterpretedOption { + /** Represents a Location. */ + class Location implements ILocation { - /** UninterpretedOption name */ - name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); - /** UninterpretedOption identifierValue */ - identifierValue?: (string|null); + /** Location path. */ + public path: number[]; - /** UninterpretedOption positiveIntValue */ - positiveIntValue?: (number|Long|string|null); + /** Location span. */ + public span: number[]; - /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|Long|string|null); + /** Location leadingComments. */ + public leadingComments: string; - /** UninterpretedOption doubleValue */ - doubleValue?: (number|null); + /** Location trailingComments. */ + public trailingComments: string; - /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|string|null); + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; - /** UninterpretedOption aggregateValue */ - aggregateValue?: (string|null); - } + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; - /** Represents an UninterpretedOption. */ - class UninterpretedOption implements IUninterpretedOption { + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new UninterpretedOption. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUninterpretedOption); + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - /** UninterpretedOption name. */ - public name: google.protobuf.UninterpretedOption.INamePart[]; + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @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.protobuf.SourceCodeInfo.Location; - /** UninterpretedOption identifierValue. */ - public identifierValue: string; + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @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.protobuf.SourceCodeInfo.Location; - /** UninterpretedOption positiveIntValue. */ - public positiveIntValue: (number|Long|string); + /** + * Verifies a Location 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); - /** UninterpretedOption negativeIntValue. */ - public negativeIntValue: (number|Long|string); + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; - /** UninterpretedOption doubleValue. */ - public doubleValue: number; + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** UninterpretedOption stringValue. */ - public stringValue: (Uint8Array|string); + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** UninterpretedOption aggregateValue. */ - public aggregateValue: string; + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { /** - * Creates a new UninterpretedOption instance using the specified properties. + * Constructs a new GeneratedCodeInfo. * @param [properties] Properties to set - * @returns UninterpretedOption instance */ - public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UninterpretedOption message from the specified reader or buffer. + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UninterpretedOption + * @returns GeneratedCodeInfo * @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.protobuf.UninterpretedOption; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UninterpretedOption + * @returns GeneratedCodeInfo * @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.protobuf.UninterpretedOption; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; /** - * Verifies an UninterpretedOption message. + * Verifies a GeneratedCodeInfo 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 UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UninterpretedOption + * @returns GeneratedCodeInfo */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @param message UninterpretedOption + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UninterpretedOption to JSON. + * Converts this GeneratedCodeInfo to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace UninterpretedOption { + namespace GeneratedCodeInfo { - /** Properties of a NamePart. */ - interface INamePart { + /** Properties of an Annotation. */ + interface IAnnotation { - /** NamePart namePart */ - namePart: string; + /** Annotation path */ + path?: (number[]|null); - /** NamePart isExtension */ - isExtension: boolean; + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); } - /** Represents a NamePart. */ - class NamePart implements INamePart { + /** Represents an Annotation. */ + class Annotation implements IAnnotation { /** - * Constructs a new NamePart. + * Constructs a new Annotation. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; - /** NamePart namePart. */ - public namePart: string; + /** Annotation begin. */ + public begin: number; - /** NamePart isExtension. */ - public isExtension: boolean; + /** Annotation end. */ + public end: number; /** - * Creates a new NamePart instance using the specified properties. + * Creates a new Annotation instance using the specified properties. * @param [properties] Properties to set - * @returns NamePart instance + * @returns Annotation instance */ - public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a NamePart message from the specified reader or buffer. + * Decodes an Annotation message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns NamePart + * @returns Annotation * @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.protobuf.UninterpretedOption.NamePart; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. + * Decodes an Annotation message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns NamePart + * @returns Annotation * @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.protobuf.UninterpretedOption.NamePart; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; /** - * Verifies a NamePart message. + * Verifies an Annotation 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 NamePart message from a plain object. Also converts values to their respective internal types. + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns NamePart + * @returns Annotation */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @param message NamePart + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this NamePart to JSON. + * Converts this Annotation to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } } - /** Properties of a SourceCodeInfo. */ - interface ISourceCodeInfo { - - /** SourceCodeInfo location */ - location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + /** Properties of an Empty. */ + interface IEmpty { } - /** Represents a SourceCodeInfo. */ - class SourceCodeInfo implements ISourceCodeInfo { + /** Represents an Empty. */ + class Empty implements IEmpty { /** - * Constructs a new SourceCodeInfo. + * Constructs a new Empty. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.ISourceCodeInfo); - - /** SourceCodeInfo location. */ - public location: google.protobuf.SourceCodeInfo.ILocation[]; + constructor(properties?: google.protobuf.IEmpty); /** - * Creates a new SourceCodeInfo instance using the specified properties. + * Creates a new Empty instance using the specified properties. * @param [properties] Properties to set - * @returns SourceCodeInfo instance + * @returns Empty instance */ - public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. + * Decodes an Empty message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SourceCodeInfo + * @returns Empty * @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.protobuf.SourceCodeInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * Decodes an Empty message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SourceCodeInfo + * @returns Empty * @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.protobuf.SourceCodeInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; /** - * Verifies a SourceCodeInfo message. + * Verifies an Empty 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 SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * Creates an Empty message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SourceCodeInfo + * @returns Empty */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @param message SourceCodeInfo + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SourceCodeInfo to JSON. + * Converts this Empty to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace SourceCodeInfo { - - /** Properties of a Location. */ - interface ILocation { - - /** Location path */ - path?: (number[]|null); - - /** Location span */ - span?: (number[]|null); - - /** Location leadingComments */ - leadingComments?: (string|null); - - /** Location trailingComments */ - trailingComments?: (string|null); - - /** Location leadingDetachedComments */ - leadingDetachedComments?: (string[]|null); - } - - /** Represents a Location. */ - class Location implements ILocation { + /** Properties of a Timestamp. */ + interface ITimestamp { - /** - * Constructs a new Location. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + /** Timestamp seconds */ + seconds?: (number|Long|string|null); - /** Location path. */ - public path: number[]; + /** Timestamp nanos */ + nanos?: (number|null); + } - /** Location span. */ - public span: number[]; + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { - /** Location leadingComments. */ - public leadingComments: string; + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); - /** Location trailingComments. */ - public trailingComments: string; + /** Timestamp seconds. */ + public seconds: (number|Long|string); - /** Location leadingDetachedComments. */ - public leadingDetachedComments: string[]; + /** Timestamp nanos. */ + public nanos: number; - /** - * Creates a new Location instance using the specified properties. - * @param [properties] Properties to set - * @returns Location instance - */ - public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a Location message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Location - * @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.protobuf.SourceCodeInfo.Location; + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @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.protobuf.Timestamp; - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Location - * @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.protobuf.SourceCodeInfo.Location; + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @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.protobuf.Timestamp; - /** - * Verifies a Location 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); + /** + * Verifies a Timestamp 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 Location message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Location - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @param message Location - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this Location to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; } - /** Properties of a GeneratedCodeInfo. */ - interface IGeneratedCodeInfo { + /** Properties of a Struct. */ + interface IStruct { - /** GeneratedCodeInfo annotation */ - annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + /** Struct fields */ + fields?: ({ [k: string]: google.protobuf.IValue }|null); } - /** Represents a GeneratedCodeInfo. */ - class GeneratedCodeInfo implements IGeneratedCodeInfo { + /** Represents a Struct. */ + class Struct implements IStruct { /** - * Constructs a new GeneratedCodeInfo. + * Constructs a new Struct. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IGeneratedCodeInfo); + constructor(properties?: google.protobuf.IStruct); - /** GeneratedCodeInfo annotation. */ - public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + /** Struct fields. */ + public fields: { [k: string]: google.protobuf.IValue }; /** - * Creates a new GeneratedCodeInfo instance using the specified properties. + * Creates a new Struct instance using the specified properties. * @param [properties] Properties to set - * @returns GeneratedCodeInfo instance + * @returns Struct instance */ - public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * Decodes a Struct message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GeneratedCodeInfo + * @returns Struct * @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.protobuf.GeneratedCodeInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Struct; /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * Decodes a Struct message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GeneratedCodeInfo + * @returns Struct * @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.protobuf.GeneratedCodeInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Struct; /** - * Verifies a GeneratedCodeInfo message. + * Verifies a Struct 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 GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * Creates a Struct message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GeneratedCodeInfo + * @returns Struct */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @param message GeneratedCodeInfo + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @param message Struct * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GeneratedCodeInfo to JSON. + * Converts this Struct to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace GeneratedCodeInfo { - - /** Properties of an Annotation. */ - interface IAnnotation { - - /** Annotation path */ - path?: (number[]|null); - - /** Annotation sourceFile */ - sourceFile?: (string|null); - - /** Annotation begin */ - begin?: (number|null); - - /** Annotation end */ - end?: (number|null); - } - - /** Represents an Annotation. */ - class Annotation implements IAnnotation { - - /** - * Constructs a new Annotation. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); - - /** Annotation path. */ - public path: number[]; + /** Properties of a Value. */ + interface IValue { - /** Annotation sourceFile. */ - public sourceFile: string; + /** Value nullValue */ + nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); - /** Annotation begin. */ - public begin: number; + /** Value numberValue */ + numberValue?: (number|null); - /** Annotation end. */ - public end: number; + /** Value stringValue */ + stringValue?: (string|null); - /** - * Creates a new Annotation instance using the specified properties. - * @param [properties] Properties to set - * @returns Annotation instance - */ - public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + /** Value boolValue */ + boolValue?: (boolean|null); - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + /** Value structValue */ + structValue?: (google.protobuf.IStruct|null); - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + /** Value listValue */ + listValue?: (google.protobuf.IListValue|null); + } - /** - * Decodes an Annotation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Annotation - * @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.protobuf.GeneratedCodeInfo.Annotation; + /** Represents a Value. */ + class Value implements IValue { - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Annotation - * @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.protobuf.GeneratedCodeInfo.Annotation; + /** + * Constructs a new Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IValue); - /** - * Verifies an Annotation 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); + /** Value nullValue. */ + public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Annotation - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + /** Value numberValue. */ + public numberValue?: (number|null); - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @param message Annotation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Value stringValue. */ + public stringValue?: (string|null); - /** - * Converts this Annotation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** Value boolValue. */ + public boolValue?: (boolean|null); - /** Properties of an Empty. */ - interface IEmpty { - } + /** Value structValue. */ + public structValue?: (google.protobuf.IStruct|null); - /** Represents an Empty. */ - class Empty implements IEmpty { + /** Value listValue. */ + public listValue?: (google.protobuf.IListValue|null); - /** - * Constructs a new Empty. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEmpty); + /** Value kind. */ + public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); /** - * Creates a new Empty instance using the specified properties. + * Creates a new Value instance using the specified properties. * @param [properties] Properties to set - * @returns Empty instance + * @returns Value instance */ - public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + public static create(properties?: google.protobuf.IValue): google.protobuf.Value; /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Empty message from the specified reader or buffer. + * Decodes a Value message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Empty + * @returns Value * @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.protobuf.Empty; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Value; /** - * Decodes an Empty message from the specified reader or buffer, length delimited. + * Decodes a Value message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Empty + * @returns Value * @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.protobuf.Empty; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Value; /** - * Verifies an Empty message. + * Verifies a Value 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 Empty message from a plain object. Also converts values to their respective internal types. + * Creates a Value message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Empty + * @returns Value */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + public static fromObject(object: { [k: string]: any }): google.protobuf.Value; /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @param message Empty + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @param message Value * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Empty to JSON. + * Converts this Value to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Timestamp. */ - interface ITimestamp { + /** NullValue enum. */ + enum NullValue { + NULL_VALUE = 0 + } - /** Timestamp seconds */ - seconds?: (number|Long|string|null); + /** Properties of a ListValue. */ + interface IListValue { - /** Timestamp nanos */ - nanos?: (number|null); + /** ListValue values */ + values?: (google.protobuf.IValue[]|null); } - /** Represents a Timestamp. */ - class Timestamp implements ITimestamp { + /** Represents a ListValue. */ + class ListValue implements IListValue { /** - * Constructs a new Timestamp. + * Constructs a new ListValue. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.ITimestamp); - - /** Timestamp seconds. */ - public seconds: (number|Long|string); + constructor(properties?: google.protobuf.IListValue); - /** Timestamp nanos. */ - public nanos: number; + /** ListValue values. */ + public values: google.protobuf.IValue[]; /** - * Creates a new Timestamp instance using the specified properties. + * Creates a new ListValue instance using the specified properties. * @param [properties] Properties to set - * @returns Timestamp instance + * @returns ListValue instance */ - public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Timestamp message from the specified reader or buffer. + * Decodes a ListValue message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Timestamp + * @returns ListValue * @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.protobuf.Timestamp; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ListValue; /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * Decodes a ListValue message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Timestamp + * @returns ListValue * @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.protobuf.Timestamp; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ListValue; /** - * Verifies a Timestamp message. + * Verifies a ListValue 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 Timestamp message from a plain object. Also converts values to their respective internal types. + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Timestamp + * @returns ListValue */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @param message Timestamp + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @param message ListValue * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Timestamp to JSON. + * Converts this ListValue to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; @@ -18733,495 +20403,401 @@ export namespace google { public toJSON(): { [k: string]: any }; } - /** Properties of a Struct. */ - interface IStruct { - - /** Struct fields */ - fields?: ({ [k: string]: google.protobuf.IValue }|null); - } - - /** Represents a Struct. */ - class Struct implements IStruct { - - /** - * Constructs a new Struct. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IStruct); - - /** Struct fields. */ - public fields: { [k: string]: google.protobuf.IValue }; - - /** - * Creates a new Struct instance using the specified properties. - * @param [properties] Properties to set - * @returns Struct instance - */ - public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; - - /** - * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. - * @param message Struct message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. - * @param message Struct message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Struct message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Struct - * @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.protobuf.Struct; - - /** - * Decodes a Struct message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Struct - * @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.protobuf.Struct; - - /** - * Verifies a Struct 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 Struct message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Struct - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; - - /** - * Creates a plain object from a Struct message. Also converts values to other types if specified. - * @param message Struct - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Struct to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Value. */ - interface IValue { - - /** Value nullValue */ - nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); - - /** Value numberValue */ - numberValue?: (number|null); - - /** Value stringValue */ - stringValue?: (string|null); - - /** Value boolValue */ - boolValue?: (boolean|null); + /** Properties of a Duration. */ + interface IDuration { - /** Value structValue */ - structValue?: (google.protobuf.IStruct|null); + /** Duration seconds */ + seconds?: (number|Long|string|null); - /** Value listValue */ - listValue?: (google.protobuf.IListValue|null); + /** Duration nanos */ + nanos?: (number|null); } - /** Represents a Value. */ - class Value implements IValue { - - /** - * Constructs a new Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IValue); - - /** Value nullValue. */ - public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); - - /** Value numberValue. */ - public numberValue?: (number|null); - - /** Value stringValue. */ - public stringValue?: (string|null); - - /** Value boolValue. */ - public boolValue?: (boolean|null); + /** Represents a Duration. */ + class Duration implements IDuration { - /** Value structValue. */ - public structValue?: (google.protobuf.IStruct|null); + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); - /** Value listValue. */ - public listValue?: (google.protobuf.IListValue|null); + /** Duration seconds. */ + public seconds: (number|Long|string); - /** Value kind. */ - public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); + /** Duration nanos. */ + public nanos: number; /** - * Creates a new Value instance using the specified properties. + * Creates a new Duration instance using the specified properties. * @param [properties] Properties to set - * @returns Value instance + * @returns Duration instance */ - public static create(properties?: google.protobuf.IValue): google.protobuf.Value; + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; /** - * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. - * @param message Value message or plain object to encode + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. - * @param message Value message or plain object to encode + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Value message from the specified reader or buffer. + * Decodes a Duration message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Value + * @returns Duration * @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.protobuf.Value; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; /** - * Decodes a Value message from the specified reader or buffer, length delimited. + * Decodes a Duration message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Value + * @returns Duration * @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.protobuf.Value; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; /** - * Verifies a Value message. + * Verifies a Duration 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 Value message from a plain object. Also converts values to their respective internal types. + * Creates a Duration message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Value + * @returns Duration */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Value; + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; /** - * Creates a plain object from a Value message. Also converts values to other types if specified. - * @param message Value + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Value to JSON. + * Converts this Duration to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** NullValue enum. */ - enum NullValue { - NULL_VALUE = 0 - } - - /** Properties of a ListValue. */ - interface IListValue { + /** Properties of a FieldMask. */ + interface IFieldMask { - /** ListValue values */ - values?: (google.protobuf.IValue[]|null); + /** FieldMask paths */ + paths?: (string[]|null); } - /** Represents a ListValue. */ - class ListValue implements IListValue { + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { /** - * Constructs a new ListValue. + * Constructs a new FieldMask. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IListValue); + constructor(properties?: google.protobuf.IFieldMask); - /** ListValue values. */ - public values: google.protobuf.IValue[]; + /** FieldMask paths. */ + public paths: string[]; /** - * Creates a new ListValue instance using the specified properties. + * Creates a new FieldMask instance using the specified properties. * @param [properties] Properties to set - * @returns ListValue instance + * @returns FieldMask instance */ - public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; /** - * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. - * @param message ListValue message or plain object to encode + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. - * @param message ListValue message or plain object to encode + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListValue message from the specified reader or buffer. + * Decodes a FieldMask message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListValue + * @returns FieldMask * @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.protobuf.ListValue; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; /** - * Decodes a ListValue message from the specified reader or buffer, length delimited. + * Decodes a FieldMask message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListValue + * @returns FieldMask * @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.protobuf.ListValue; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; /** - * Verifies a ListValue message. + * Verifies a FieldMask 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 ListValue message from a plain object. Also converts values to their respective internal types. + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListValue + * @returns FieldMask */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; /** - * Creates a plain object from a ListValue message. Also converts values to other types if specified. - * @param message ListValue + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListValue to JSON. + * Converts this FieldMask to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } + } - /** Properties of a Duration. */ - interface IDuration { + /** Namespace type. */ + namespace type { - /** Duration seconds */ - seconds?: (number|Long|string|null); + /** Properties of a Date. */ + interface IDate { - /** Duration nanos */ - nanos?: (number|null); + /** Date year */ + year?: (number|null); + + /** Date month */ + month?: (number|null); + + /** Date day */ + day?: (number|null); } - /** Represents a Duration. */ - class Duration implements IDuration { + /** Represents a Date. */ + class Date implements IDate { /** - * Constructs a new Duration. + * Constructs a new Date. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IDuration); + constructor(properties?: google.type.IDate); - /** Duration seconds. */ - public seconds: (number|Long|string); + /** Date year. */ + public year: number; - /** Duration nanos. */ - public nanos: number; + /** Date month. */ + public month: number; + + /** Date day. */ + public day: number; /** - * Creates a new Duration instance using the specified properties. + * Creates a new Date instance using the specified properties. * @param [properties] Properties to set - * @returns Duration instance + * @returns Date instance */ - public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + public static create(properties?: google.type.IDate): google.type.Date; /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode + * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @param message Date message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @param message Date message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Duration message from the specified reader or buffer. + * Decodes a Date message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Duration + * @returns Date * @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.protobuf.Duration; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Date; /** - * Decodes a Duration message from the specified reader or buffer, length delimited. + * Decodes a Date message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Duration + * @returns Date * @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.protobuf.Duration; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Date; /** - * Verifies a Duration message. + * Verifies a Date 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 Duration message from a plain object. Also converts values to their respective internal types. + * Creates a Date message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Duration + * @returns Date */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + public static fromObject(object: { [k: string]: any }): google.type.Date; /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @param message Duration + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @param message Date * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.type.Date, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Duration to JSON. + * Converts this Date to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a FieldMask. */ - interface IFieldMask { + /** Properties of an Expr. */ + interface IExpr { - /** FieldMask paths */ - paths?: (string[]|null); + /** Expr expression */ + expression?: (string|null); + + /** Expr title */ + title?: (string|null); + + /** Expr description */ + description?: (string|null); + + /** Expr location */ + location?: (string|null); } - /** Represents a FieldMask. */ - class FieldMask implements IFieldMask { + /** Represents an Expr. */ + class Expr implements IExpr { /** - * Constructs a new FieldMask. + * Constructs a new Expr. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IFieldMask); + constructor(properties?: google.type.IExpr); - /** FieldMask paths. */ - public paths: string[]; + /** Expr expression. */ + public expression: string; + + /** Expr title. */ + public title: string; + + /** Expr description. */ + public description: string; + + /** Expr location. */ + public location: string; /** - * Creates a new FieldMask instance using the specified properties. + * Creates a new Expr instance using the specified properties. * @param [properties] Properties to set - * @returns FieldMask instance + * @returns Expr instance */ - public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + public static create(properties?: google.type.IExpr): google.type.Expr; /** - * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @param message FieldMask message or plain object to encode + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @param message FieldMask message or plain object to encode + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FieldMask message from the specified reader or buffer. + * Decodes an Expr message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns FieldMask + * @returns Expr * @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.protobuf.FieldMask; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Expr; /** - * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * Decodes an Expr message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FieldMask + * @returns Expr * @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.protobuf.FieldMask; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Expr; /** - * Verifies a FieldMask message. + * Verifies an Expr 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 FieldMask message from a plain object. Also converts values to their respective internal types. + * Creates an Expr message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FieldMask + * @returns Expr */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + public static fromObject(object: { [k: string]: any }): google.type.Expr; /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. - * @param message FieldMask + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @param message Expr * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.type.Expr, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FieldMask to JSON. + * Converts this Expr to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; @@ -19772,220 +21348,6 @@ export namespace google { } } - /** Namespace type. */ - namespace type { - - /** Properties of an Expr. */ - interface IExpr { - - /** Expr expression */ - expression?: (string|null); - - /** Expr title */ - title?: (string|null); - - /** Expr description */ - description?: (string|null); - - /** Expr location */ - location?: (string|null); - } - - /** Represents an Expr. */ - class Expr implements IExpr { - - /** - * Constructs a new Expr. - * @param [properties] Properties to set - */ - constructor(properties?: google.type.IExpr); - - /** Expr expression. */ - public expression: string; - - /** Expr title. */ - public title: string; - - /** Expr description. */ - public description: string; - - /** Expr location. */ - public location: string; - - /** - * Creates a new Expr instance using the specified properties. - * @param [properties] Properties to set - * @returns Expr instance - */ - public static create(properties?: google.type.IExpr): google.type.Expr; - - /** - * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @param message Expr message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @param message Expr message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Expr message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Expr - * @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.type.Expr; - - /** - * Decodes an Expr message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Expr - * @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.type.Expr; - - /** - * Verifies an Expr 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 Expr message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Expr - */ - public static fromObject(object: { [k: string]: any }): google.type.Expr; - - /** - * Creates a plain object from an Expr message. Also converts values to other types if specified. - * @param message Expr - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.type.Expr, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Expr to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Date. */ - interface IDate { - - /** Date year */ - year?: (number|null); - - /** Date month */ - month?: (number|null); - - /** Date day */ - day?: (number|null); - } - - /** Represents a Date. */ - class Date implements IDate { - - /** - * Constructs a new Date. - * @param [properties] Properties to set - */ - constructor(properties?: google.type.IDate); - - /** Date year. */ - public year: number; - - /** Date month. */ - public month: number; - - /** Date day. */ - public day: number; - - /** - * Creates a new Date instance using the specified properties. - * @param [properties] Properties to set - * @returns Date instance - */ - public static create(properties?: google.type.IDate): google.type.Date; - - /** - * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. - * @param message Date message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. - * @param message Date message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Date message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Date - * @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.type.Date; - - /** - * Decodes a Date message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Date - * @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.type.Date; - - /** - * Verifies a Date 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 Date message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Date - */ - public static fromObject(object: { [k: string]: any }): google.type.Date; - - /** - * Creates a plain object from a Date message. Also converts values to other types if specified. - * @param message Date - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.type.Date, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Date to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - /** Namespace identity. */ namespace identity { diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index e75ccb1fe2c..db3d462a048 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -527,6 +527,204 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#createSavedQuery}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef CreateSavedQueryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.SavedQuery} [response] SavedQuery + */ + + /** + * Calls CreateSavedQuery. + * @function createSavedQuery + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.ICreateSavedQueryRequest} request CreateSavedQueryRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.CreateSavedQueryCallback} callback Node-style callback called with the error, if any, and SavedQuery + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.createSavedQuery = function createSavedQuery(request, callback) { + return this.rpcCall(createSavedQuery, $root.google.cloud.asset.v1.CreateSavedQueryRequest, $root.google.cloud.asset.v1.SavedQuery, request, callback); + }, "name", { value: "CreateSavedQuery" }); + + /** + * Calls CreateSavedQuery. + * @function createSavedQuery + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.ICreateSavedQueryRequest} request CreateSavedQueryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#getSavedQuery}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef GetSavedQueryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.SavedQuery} [response] SavedQuery + */ + + /** + * Calls GetSavedQuery. + * @function getSavedQuery + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IGetSavedQueryRequest} request GetSavedQueryRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.GetSavedQueryCallback} callback Node-style callback called with the error, if any, and SavedQuery + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.getSavedQuery = function getSavedQuery(request, callback) { + return this.rpcCall(getSavedQuery, $root.google.cloud.asset.v1.GetSavedQueryRequest, $root.google.cloud.asset.v1.SavedQuery, request, callback); + }, "name", { value: "GetSavedQuery" }); + + /** + * Calls GetSavedQuery. + * @function getSavedQuery + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IGetSavedQueryRequest} request GetSavedQueryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#listSavedQueries}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef ListSavedQueriesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.ListSavedQueriesResponse} [response] ListSavedQueriesResponse + */ + + /** + * Calls ListSavedQueries. + * @function listSavedQueries + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IListSavedQueriesRequest} request ListSavedQueriesRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.ListSavedQueriesCallback} callback Node-style callback called with the error, if any, and ListSavedQueriesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.listSavedQueries = function listSavedQueries(request, callback) { + return this.rpcCall(listSavedQueries, $root.google.cloud.asset.v1.ListSavedQueriesRequest, $root.google.cloud.asset.v1.ListSavedQueriesResponse, request, callback); + }, "name", { value: "ListSavedQueries" }); + + /** + * Calls ListSavedQueries. + * @function listSavedQueries + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IListSavedQueriesRequest} request ListSavedQueriesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#updateSavedQuery}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef UpdateSavedQueryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.SavedQuery} [response] SavedQuery + */ + + /** + * Calls UpdateSavedQuery. + * @function updateSavedQuery + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IUpdateSavedQueryRequest} request UpdateSavedQueryRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.UpdateSavedQueryCallback} callback Node-style callback called with the error, if any, and SavedQuery + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.updateSavedQuery = function updateSavedQuery(request, callback) { + return this.rpcCall(updateSavedQuery, $root.google.cloud.asset.v1.UpdateSavedQueryRequest, $root.google.cloud.asset.v1.SavedQuery, request, callback); + }, "name", { value: "UpdateSavedQuery" }); + + /** + * Calls UpdateSavedQuery. + * @function updateSavedQuery + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IUpdateSavedQueryRequest} request UpdateSavedQueryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#deleteSavedQuery}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef DeleteSavedQueryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteSavedQuery. + * @function deleteSavedQuery + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IDeleteSavedQueryRequest} request DeleteSavedQueryRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.DeleteSavedQueryCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.deleteSavedQuery = function deleteSavedQuery(request, callback) { + return this.rpcCall(deleteSavedQuery, $root.google.cloud.asset.v1.DeleteSavedQueryRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteSavedQuery" }); + + /** + * Calls DeleteSavedQuery. + * @function deleteSavedQuery + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IDeleteSavedQueryRequest} request DeleteSavedQueryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService#batchGetEffectiveIamPolicies}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef BatchGetEffectiveIamPoliciesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse} [response] BatchGetEffectiveIamPoliciesResponse + */ + + /** + * Calls BatchGetEffectiveIamPolicies. + * @function batchGetEffectiveIamPolicies + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest} request BatchGetEffectiveIamPoliciesRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.BatchGetEffectiveIamPoliciesCallback} callback Node-style callback called with the error, if any, and BatchGetEffectiveIamPoliciesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.batchGetEffectiveIamPolicies = function batchGetEffectiveIamPolicies(request, callback) { + return this.rpcCall(batchGetEffectiveIamPolicies, $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest, $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse, request, callback); + }, "name", { value: "BatchGetEffectiveIamPolicies" }); + + /** + * Calls BatchGetEffectiveIamPolicies. + * @function batchGetEffectiveIamPolicies + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest} request BatchGetEffectiveIamPoliciesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return AssetService; })(); @@ -8576,6 +8774,7 @@ * @memberof google.cloud.asset.v1 * @interface IAnalyzeIamPolicyRequest * @property {google.cloud.asset.v1.IIamPolicyAnalysisQuery|null} [analysisQuery] AnalyzeIamPolicyRequest analysisQuery + * @property {string|null} [savedAnalysisQuery] AnalyzeIamPolicyRequest savedAnalysisQuery * @property {google.protobuf.IDuration|null} [executionTimeout] AnalyzeIamPolicyRequest executionTimeout */ @@ -8602,6 +8801,14 @@ */ AnalyzeIamPolicyRequest.prototype.analysisQuery = null; + /** + * AnalyzeIamPolicyRequest savedAnalysisQuery. + * @member {string} savedAnalysisQuery + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest + * @instance + */ + AnalyzeIamPolicyRequest.prototype.savedAnalysisQuery = ""; + /** * AnalyzeIamPolicyRequest executionTimeout. * @member {google.protobuf.IDuration|null|undefined} executionTimeout @@ -8638,6 +8845,8 @@ $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.encode(message.analysisQuery, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.executionTimeout != null && Object.hasOwnProperty.call(message, "executionTimeout")) $root.google.protobuf.Duration.encode(message.executionTimeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.savedAnalysisQuery != null && Object.hasOwnProperty.call(message, "savedAnalysisQuery")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.savedAnalysisQuery); return writer; }; @@ -8675,6 +8884,9 @@ case 1: message.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.decode(reader, reader.uint32()); break; + case 3: + message.savedAnalysisQuery = reader.string(); + break; case 2: message.executionTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; @@ -8718,6 +8930,9 @@ if (error) return "analysisQuery." + error; } + if (message.savedAnalysisQuery != null && message.hasOwnProperty("savedAnalysisQuery")) + if (!$util.isString(message.savedAnalysisQuery)) + return "savedAnalysisQuery: string expected"; if (message.executionTimeout != null && message.hasOwnProperty("executionTimeout")) { var error = $root.google.protobuf.Duration.verify(message.executionTimeout); if (error) @@ -8743,6 +8958,8 @@ throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyRequest.analysisQuery: object expected"); message.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.fromObject(object.analysisQuery); } + if (object.savedAnalysisQuery != null) + message.savedAnalysisQuery = String(object.savedAnalysisQuery); if (object.executionTimeout != null) { if (typeof object.executionTimeout !== "object") throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyRequest.executionTimeout: object expected"); @@ -8767,11 +8984,14 @@ if (options.defaults) { object.analysisQuery = null; object.executionTimeout = null; + object.savedAnalysisQuery = ""; } if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) object.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.toObject(message.analysisQuery, options); if (message.executionTimeout != null && message.hasOwnProperty("executionTimeout")) object.executionTimeout = $root.google.protobuf.Duration.toObject(message.executionTimeout, options); + if (message.savedAnalysisQuery != null && message.hasOwnProperty("savedAnalysisQuery")) + object.savedAnalysisQuery = message.savedAnalysisQuery; return object; }; @@ -10071,6 +10291,7 @@ * @memberof google.cloud.asset.v1 * @interface IAnalyzeIamPolicyLongrunningRequest * @property {google.cloud.asset.v1.IIamPolicyAnalysisQuery|null} [analysisQuery] AnalyzeIamPolicyLongrunningRequest analysisQuery + * @property {string|null} [savedAnalysisQuery] AnalyzeIamPolicyLongrunningRequest savedAnalysisQuery * @property {google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig|null} [outputConfig] AnalyzeIamPolicyLongrunningRequest outputConfig */ @@ -10097,6 +10318,14 @@ */ AnalyzeIamPolicyLongrunningRequest.prototype.analysisQuery = null; + /** + * AnalyzeIamPolicyLongrunningRequest savedAnalysisQuery. + * @member {string} savedAnalysisQuery + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest + * @instance + */ + AnalyzeIamPolicyLongrunningRequest.prototype.savedAnalysisQuery = ""; + /** * AnalyzeIamPolicyLongrunningRequest outputConfig. * @member {google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig|null|undefined} outputConfig @@ -10133,6 +10362,8 @@ $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.encode(message.analysisQuery, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.encode(message.outputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.savedAnalysisQuery != null && Object.hasOwnProperty.call(message, "savedAnalysisQuery")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.savedAnalysisQuery); return writer; }; @@ -10170,6 +10401,9 @@ case 1: message.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.decode(reader, reader.uint32()); break; + case 3: + message.savedAnalysisQuery = reader.string(); + break; case 2: message.outputConfig = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.decode(reader, reader.uint32()); break; @@ -10213,6 +10447,9 @@ if (error) return "analysisQuery." + error; } + if (message.savedAnalysisQuery != null && message.hasOwnProperty("savedAnalysisQuery")) + if (!$util.isString(message.savedAnalysisQuery)) + return "savedAnalysisQuery: string expected"; if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { var error = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.verify(message.outputConfig); if (error) @@ -10238,6 +10475,8 @@ throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest.analysisQuery: object expected"); message.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.fromObject(object.analysisQuery); } + if (object.savedAnalysisQuery != null) + message.savedAnalysisQuery = String(object.savedAnalysisQuery); if (object.outputConfig != null) { if (typeof object.outputConfig !== "object") throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest.outputConfig: object expected"); @@ -10262,11 +10501,14 @@ if (options.defaults) { object.analysisQuery = null; object.outputConfig = null; + object.savedAnalysisQuery = ""; } if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) object.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.toObject(message.analysisQuery, options); if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) object.outputConfig = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.toObject(message.outputConfig, options); + if (message.savedAnalysisQuery != null && message.hasOwnProperty("savedAnalysisQuery")) + object.savedAnalysisQuery = message.savedAnalysisQuery; return object; }; @@ -10444,26 +10686,32 @@ return AnalyzeIamPolicyLongrunningResponse; })(); - v1.AnalyzeMoveRequest = (function() { + v1.SavedQuery = (function() { /** - * Properties of an AnalyzeMoveRequest. + * Properties of a SavedQuery. * @memberof google.cloud.asset.v1 - * @interface IAnalyzeMoveRequest - * @property {string|null} [resource] AnalyzeMoveRequest resource - * @property {string|null} [destinationParent] AnalyzeMoveRequest destinationParent - * @property {google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView|null} [view] AnalyzeMoveRequest view + * @interface ISavedQuery + * @property {string|null} [name] SavedQuery name + * @property {string|null} [description] SavedQuery description + * @property {google.protobuf.ITimestamp|null} [createTime] SavedQuery createTime + * @property {string|null} [creator] SavedQuery creator + * @property {google.protobuf.ITimestamp|null} [lastUpdateTime] SavedQuery lastUpdateTime + * @property {string|null} [lastUpdater] SavedQuery lastUpdater + * @property {Object.|null} [labels] SavedQuery labels + * @property {google.cloud.asset.v1.SavedQuery.IQueryContent|null} [content] SavedQuery content */ /** - * Constructs a new AnalyzeMoveRequest. + * Constructs a new SavedQuery. * @memberof google.cloud.asset.v1 - * @classdesc Represents an AnalyzeMoveRequest. - * @implements IAnalyzeMoveRequest + * @classdesc Represents a SavedQuery. + * @implements ISavedQuery * @constructor - * @param {google.cloud.asset.v1.IAnalyzeMoveRequest=} [properties] Properties to set + * @param {google.cloud.asset.v1.ISavedQuery=} [properties] Properties to set */ - function AnalyzeMoveRequest(properties) { + function SavedQuery(properties) { + this.labels = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10471,101 +10719,186 @@ } /** - * AnalyzeMoveRequest resource. - * @member {string} resource - * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * SavedQuery name. + * @member {string} name + * @memberof google.cloud.asset.v1.SavedQuery * @instance */ - AnalyzeMoveRequest.prototype.resource = ""; + SavedQuery.prototype.name = ""; /** - * AnalyzeMoveRequest destinationParent. - * @member {string} destinationParent - * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * SavedQuery description. + * @member {string} description + * @memberof google.cloud.asset.v1.SavedQuery * @instance */ - AnalyzeMoveRequest.prototype.destinationParent = ""; + SavedQuery.prototype.description = ""; /** - * AnalyzeMoveRequest view. - * @member {google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView} view - * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * SavedQuery createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.asset.v1.SavedQuery * @instance */ - AnalyzeMoveRequest.prototype.view = 0; + SavedQuery.prototype.createTime = null; /** - * Creates a new AnalyzeMoveRequest instance using the specified properties. + * SavedQuery creator. + * @member {string} creator + * @memberof google.cloud.asset.v1.SavedQuery + * @instance + */ + SavedQuery.prototype.creator = ""; + + /** + * SavedQuery lastUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastUpdateTime + * @memberof google.cloud.asset.v1.SavedQuery + * @instance + */ + SavedQuery.prototype.lastUpdateTime = null; + + /** + * SavedQuery lastUpdater. + * @member {string} lastUpdater + * @memberof google.cloud.asset.v1.SavedQuery + * @instance + */ + SavedQuery.prototype.lastUpdater = ""; + + /** + * SavedQuery labels. + * @member {Object.} labels + * @memberof google.cloud.asset.v1.SavedQuery + * @instance + */ + SavedQuery.prototype.labels = $util.emptyObject; + + /** + * SavedQuery content. + * @member {google.cloud.asset.v1.SavedQuery.IQueryContent|null|undefined} content + * @memberof google.cloud.asset.v1.SavedQuery + * @instance + */ + SavedQuery.prototype.content = null; + + /** + * Creates a new SavedQuery instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @memberof google.cloud.asset.v1.SavedQuery * @static - * @param {google.cloud.asset.v1.IAnalyzeMoveRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1.AnalyzeMoveRequest} AnalyzeMoveRequest instance + * @param {google.cloud.asset.v1.ISavedQuery=} [properties] Properties to set + * @returns {google.cloud.asset.v1.SavedQuery} SavedQuery instance */ - AnalyzeMoveRequest.create = function create(properties) { - return new AnalyzeMoveRequest(properties); + SavedQuery.create = function create(properties) { + return new SavedQuery(properties); }; /** - * Encodes the specified AnalyzeMoveRequest message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveRequest.verify|verify} messages. + * Encodes the specified SavedQuery message. Does not implicitly {@link google.cloud.asset.v1.SavedQuery.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @memberof google.cloud.asset.v1.SavedQuery * @static - * @param {google.cloud.asset.v1.IAnalyzeMoveRequest} message AnalyzeMoveRequest message or plain object to encode + * @param {google.cloud.asset.v1.ISavedQuery} message SavedQuery message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AnalyzeMoveRequest.encode = function encode(message, writer) { + SavedQuery.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); - if (message.destinationParent != null && Object.hasOwnProperty.call(message, "destinationParent")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.destinationParent); - if (message.view != null && Object.hasOwnProperty.call(message, "view")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.view); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.creator); + if (message.lastUpdateTime != null && Object.hasOwnProperty.call(message, "lastUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.lastUpdateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.lastUpdater != null && Object.hasOwnProperty.call(message, "lastUpdater")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.lastUpdater); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + $root.google.cloud.asset.v1.SavedQuery.QueryContent.encode(message.content, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; /** - * Encodes the specified AnalyzeMoveRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveRequest.verify|verify} messages. + * Encodes the specified SavedQuery message, length delimited. Does not implicitly {@link google.cloud.asset.v1.SavedQuery.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @memberof google.cloud.asset.v1.SavedQuery * @static - * @param {google.cloud.asset.v1.IAnalyzeMoveRequest} message AnalyzeMoveRequest message or plain object to encode + * @param {google.cloud.asset.v1.ISavedQuery} message SavedQuery message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AnalyzeMoveRequest.encodeDelimited = function encodeDelimited(message, writer) { + SavedQuery.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AnalyzeMoveRequest message from the specified reader or buffer. + * Decodes a SavedQuery message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @memberof google.cloud.asset.v1.SavedQuery * @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.AnalyzeMoveRequest} AnalyzeMoveRequest + * @returns {google.cloud.asset.v1.SavedQuery} SavedQuery * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AnalyzeMoveRequest.decode = function decode(reader, length) { + SavedQuery.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.AnalyzeMoveRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.SavedQuery(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.resource = reader.string(); + message.name = reader.string(); break; case 2: - message.destinationParent = reader.string(); + message.description = reader.string(); break; case 3: - message.view = reader.int32(); + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 4: + message.creator = reader.string(); + break; + case 5: + message.lastUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: + message.lastUpdater = reader.string(); + break; + case 7: + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + case 8: + message.content = $root.google.cloud.asset.v1.SavedQuery.QueryContent.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -10576,237 +10909,2066 @@ }; /** - * Decodes an AnalyzeMoveRequest message from the specified reader or buffer, length delimited. + * Decodes a SavedQuery message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @memberof google.cloud.asset.v1.SavedQuery * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.AnalyzeMoveRequest} AnalyzeMoveRequest + * @returns {google.cloud.asset.v1.SavedQuery} SavedQuery * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AnalyzeMoveRequest.decodeDelimited = function decodeDelimited(reader) { + SavedQuery.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AnalyzeMoveRequest message. + * Verifies a SavedQuery message. * @function verify - * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @memberof google.cloud.asset.v1.SavedQuery * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AnalyzeMoveRequest.verify = function verify(message) { + SavedQuery.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.destinationParent != null && message.hasOwnProperty("destinationParent")) - if (!$util.isString(message.destinationParent)) - return "destinationParent: string expected"; - if (message.view != null && message.hasOwnProperty("view")) - switch (message.view) { - default: - return "view: enum value expected"; - case 0: - case 1: - case 2: - break; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.creator != null && message.hasOwnProperty("creator")) + if (!$util.isString(message.creator)) + return "creator: string expected"; + if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastUpdateTime); + if (error) + return "lastUpdateTime." + error; + } + if (message.lastUpdater != null && message.hasOwnProperty("lastUpdater")) + if (!$util.isString(message.lastUpdater)) + return "lastUpdater: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.content != null && message.hasOwnProperty("content")) { + var error = $root.google.cloud.asset.v1.SavedQuery.QueryContent.verify(message.content); + if (error) + return "content." + error; + } return null; }; /** - * Creates an AnalyzeMoveRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SavedQuery message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @memberof google.cloud.asset.v1.SavedQuery * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.AnalyzeMoveRequest} AnalyzeMoveRequest + * @returns {google.cloud.asset.v1.SavedQuery} SavedQuery */ - AnalyzeMoveRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.AnalyzeMoveRequest) + SavedQuery.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.SavedQuery) return object; - var message = new $root.google.cloud.asset.v1.AnalyzeMoveRequest(); - if (object.resource != null) - message.resource = String(object.resource); - if (object.destinationParent != null) - message.destinationParent = String(object.destinationParent); - switch (object.view) { - case "ANALYSIS_VIEW_UNSPECIFIED": - case 0: - message.view = 0; - break; - case "FULL": - case 1: - message.view = 1; - break; - case "BASIC": - case 2: - message.view = 2; - break; + var message = new $root.google.cloud.asset.v1.SavedQuery(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.asset.v1.SavedQuery.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.creator != null) + message.creator = String(object.creator); + if (object.lastUpdateTime != null) { + if (typeof object.lastUpdateTime !== "object") + throw TypeError(".google.cloud.asset.v1.SavedQuery.lastUpdateTime: object expected"); + message.lastUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.lastUpdateTime); + } + if (object.lastUpdater != null) + message.lastUpdater = String(object.lastUpdater); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.asset.v1.SavedQuery.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.content != null) { + if (typeof object.content !== "object") + throw TypeError(".google.cloud.asset.v1.SavedQuery.content: object expected"); + message.content = $root.google.cloud.asset.v1.SavedQuery.QueryContent.fromObject(object.content); } return message; }; /** - * Creates a plain object from an AnalyzeMoveRequest message. Also converts values to other types if specified. + * Creates a plain object from a SavedQuery message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @memberof google.cloud.asset.v1.SavedQuery * @static - * @param {google.cloud.asset.v1.AnalyzeMoveRequest} message AnalyzeMoveRequest + * @param {google.cloud.asset.v1.SavedQuery} message SavedQuery * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AnalyzeMoveRequest.toObject = function toObject(message, options) { + SavedQuery.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.objects || options.defaults) + object.labels = {}; if (options.defaults) { - object.resource = ""; - object.destinationParent = ""; - object.view = options.enums === String ? "ANALYSIS_VIEW_UNSPECIFIED" : 0; + object.name = ""; + object.description = ""; + object.createTime = null; + object.creator = ""; + object.lastUpdateTime = null; + object.lastUpdater = ""; + object.content = null; } - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.destinationParent != null && message.hasOwnProperty("destinationParent")) - object.destinationParent = message.destinationParent; - if (message.view != null && message.hasOwnProperty("view")) - object.view = options.enums === String ? $root.google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView[message.view] : message.view; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.creator != null && message.hasOwnProperty("creator")) + object.creator = message.creator; + if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) + object.lastUpdateTime = $root.google.protobuf.Timestamp.toObject(message.lastUpdateTime, options); + if (message.lastUpdater != null && message.hasOwnProperty("lastUpdater")) + object.lastUpdater = message.lastUpdater; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = $root.google.cloud.asset.v1.SavedQuery.QueryContent.toObject(message.content, options); return object; }; /** - * Converts this AnalyzeMoveRequest to JSON. + * Converts this SavedQuery to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @memberof google.cloud.asset.v1.SavedQuery * @instance * @returns {Object.} JSON object */ - AnalyzeMoveRequest.prototype.toJSON = function toJSON() { + SavedQuery.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * AnalysisView enum. - * @name google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView - * @enum {number} - * @property {number} ANALYSIS_VIEW_UNSPECIFIED=0 ANALYSIS_VIEW_UNSPECIFIED value - * @property {number} FULL=1 FULL value - * @property {number} BASIC=2 BASIC value - */ - AnalyzeMoveRequest.AnalysisView = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ANALYSIS_VIEW_UNSPECIFIED"] = 0; - values[valuesById[1] = "FULL"] = 1; - values[valuesById[2] = "BASIC"] = 2; - return values; - })(); + SavedQuery.QueryContent = (function() { - return AnalyzeMoveRequest; - })(); + /** + * Properties of a QueryContent. + * @memberof google.cloud.asset.v1.SavedQuery + * @interface IQueryContent + * @property {google.cloud.asset.v1.IIamPolicyAnalysisQuery|null} [iamPolicyAnalysisQuery] QueryContent iamPolicyAnalysisQuery + */ - v1.AnalyzeMoveResponse = (function() { + /** + * Constructs a new QueryContent. + * @memberof google.cloud.asset.v1.SavedQuery + * @classdesc Represents a QueryContent. + * @implements IQueryContent + * @constructor + * @param {google.cloud.asset.v1.SavedQuery.IQueryContent=} [properties] Properties to set + */ + function QueryContent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Properties of an AnalyzeMoveResponse. - * @memberof google.cloud.asset.v1 - * @interface IAnalyzeMoveResponse - * @property {Array.|null} [moveAnalysis] AnalyzeMoveResponse moveAnalysis - */ + /** + * QueryContent iamPolicyAnalysisQuery. + * @member {google.cloud.asset.v1.IIamPolicyAnalysisQuery|null|undefined} iamPolicyAnalysisQuery + * @memberof google.cloud.asset.v1.SavedQuery.QueryContent + * @instance + */ + QueryContent.prototype.iamPolicyAnalysisQuery = null; - /** - * Constructs a new AnalyzeMoveResponse. - * @memberof google.cloud.asset.v1 - * @classdesc Represents an AnalyzeMoveResponse. - * @implements IAnalyzeMoveResponse - * @constructor - * @param {google.cloud.asset.v1.IAnalyzeMoveResponse=} [properties] Properties to set - */ - function AnalyzeMoveResponse(properties) { - this.moveAnalysis = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * AnalyzeMoveResponse moveAnalysis. - * @member {Array.} moveAnalysis - * @memberof google.cloud.asset.v1.AnalyzeMoveResponse - * @instance - */ - AnalyzeMoveResponse.prototype.moveAnalysis = $util.emptyArray; + /** + * QueryContent queryContent. + * @member {"iamPolicyAnalysisQuery"|undefined} queryContent + * @memberof google.cloud.asset.v1.SavedQuery.QueryContent + * @instance + */ + Object.defineProperty(QueryContent.prototype, "queryContent", { + get: $util.oneOfGetter($oneOfFields = ["iamPolicyAnalysisQuery"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Creates a new AnalyzeMoveResponse instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1.AnalyzeMoveResponse - * @static - * @param {google.cloud.asset.v1.IAnalyzeMoveResponse=} [properties] Properties to set - * @returns {google.cloud.asset.v1.AnalyzeMoveResponse} AnalyzeMoveResponse instance - */ - AnalyzeMoveResponse.create = function create(properties) { - return new AnalyzeMoveResponse(properties); - }; + /** + * Creates a new QueryContent instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.SavedQuery.QueryContent + * @static + * @param {google.cloud.asset.v1.SavedQuery.IQueryContent=} [properties] Properties to set + * @returns {google.cloud.asset.v1.SavedQuery.QueryContent} QueryContent instance + */ + QueryContent.create = function create(properties) { + return new QueryContent(properties); + }; - /** - * Encodes the specified AnalyzeMoveResponse message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1.AnalyzeMoveResponse - * @static - * @param {google.cloud.asset.v1.IAnalyzeMoveResponse} message AnalyzeMoveResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AnalyzeMoveResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.moveAnalysis != null && message.moveAnalysis.length) - for (var i = 0; i < message.moveAnalysis.length; ++i) - $root.google.cloud.asset.v1.MoveAnalysis.encode(message.moveAnalysis[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified QueryContent message. Does not implicitly {@link google.cloud.asset.v1.SavedQuery.QueryContent.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.SavedQuery.QueryContent + * @static + * @param {google.cloud.asset.v1.SavedQuery.IQueryContent} message QueryContent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryContent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.iamPolicyAnalysisQuery != null && Object.hasOwnProperty.call(message, "iamPolicyAnalysisQuery")) + $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.encode(message.iamPolicyAnalysisQuery, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; - /** - * Encodes the specified AnalyzeMoveResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1.AnalyzeMoveResponse - * @static - * @param {google.cloud.asset.v1.IAnalyzeMoveResponse} message AnalyzeMoveResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AnalyzeMoveResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified QueryContent message, length delimited. Does not implicitly {@link google.cloud.asset.v1.SavedQuery.QueryContent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.SavedQuery.QueryContent + * @static + * @param {google.cloud.asset.v1.SavedQuery.IQueryContent} message QueryContent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryContent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes an AnalyzeMoveResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1.AnalyzeMoveResponse - * @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.AnalyzeMoveResponse} AnalyzeMoveResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AnalyzeMoveResponse.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.AnalyzeMoveResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.moveAnalysis && message.moveAnalysis.length)) - message.moveAnalysis = []; + /** + * Decodes a QueryContent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.SavedQuery.QueryContent + * @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.SavedQuery.QueryContent} QueryContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryContent.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.SavedQuery.QueryContent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.iamPolicyAnalysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryContent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.SavedQuery.QueryContent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.SavedQuery.QueryContent} QueryContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryContent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryContent message. + * @function verify + * @memberof google.cloud.asset.v1.SavedQuery.QueryContent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryContent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.iamPolicyAnalysisQuery != null && message.hasOwnProperty("iamPolicyAnalysisQuery")) { + properties.queryContent = 1; + { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.verify(message.iamPolicyAnalysisQuery); + if (error) + return "iamPolicyAnalysisQuery." + error; + } + } + return null; + }; + + /** + * Creates a QueryContent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.SavedQuery.QueryContent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.SavedQuery.QueryContent} QueryContent + */ + QueryContent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.SavedQuery.QueryContent) + return object; + var message = new $root.google.cloud.asset.v1.SavedQuery.QueryContent(); + if (object.iamPolicyAnalysisQuery != null) { + if (typeof object.iamPolicyAnalysisQuery !== "object") + throw TypeError(".google.cloud.asset.v1.SavedQuery.QueryContent.iamPolicyAnalysisQuery: object expected"); + message.iamPolicyAnalysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.fromObject(object.iamPolicyAnalysisQuery); + } + return message; + }; + + /** + * Creates a plain object from a QueryContent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.SavedQuery.QueryContent + * @static + * @param {google.cloud.asset.v1.SavedQuery.QueryContent} message QueryContent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryContent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.iamPolicyAnalysisQuery != null && message.hasOwnProperty("iamPolicyAnalysisQuery")) { + object.iamPolicyAnalysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.toObject(message.iamPolicyAnalysisQuery, options); + if (options.oneofs) + object.queryContent = "iamPolicyAnalysisQuery"; + } + return object; + }; + + /** + * Converts this QueryContent to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.SavedQuery.QueryContent + * @instance + * @returns {Object.} JSON object + */ + QueryContent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryContent; + })(); + + return SavedQuery; + })(); + + v1.CreateSavedQueryRequest = (function() { + + /** + * Properties of a CreateSavedQueryRequest. + * @memberof google.cloud.asset.v1 + * @interface ICreateSavedQueryRequest + * @property {string|null} [parent] CreateSavedQueryRequest parent + * @property {google.cloud.asset.v1.ISavedQuery|null} [savedQuery] CreateSavedQueryRequest savedQuery + * @property {string|null} [savedQueryId] CreateSavedQueryRequest savedQueryId + */ + + /** + * Constructs a new CreateSavedQueryRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a CreateSavedQueryRequest. + * @implements ICreateSavedQueryRequest + * @constructor + * @param {google.cloud.asset.v1.ICreateSavedQueryRequest=} [properties] Properties to set + */ + function CreateSavedQueryRequest(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]]; + } + + /** + * CreateSavedQueryRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1.CreateSavedQueryRequest + * @instance + */ + CreateSavedQueryRequest.prototype.parent = ""; + + /** + * CreateSavedQueryRequest savedQuery. + * @member {google.cloud.asset.v1.ISavedQuery|null|undefined} savedQuery + * @memberof google.cloud.asset.v1.CreateSavedQueryRequest + * @instance + */ + CreateSavedQueryRequest.prototype.savedQuery = null; + + /** + * CreateSavedQueryRequest savedQueryId. + * @member {string} savedQueryId + * @memberof google.cloud.asset.v1.CreateSavedQueryRequest + * @instance + */ + CreateSavedQueryRequest.prototype.savedQueryId = ""; + + /** + * Creates a new CreateSavedQueryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.CreateSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.ICreateSavedQueryRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.CreateSavedQueryRequest} CreateSavedQueryRequest instance + */ + CreateSavedQueryRequest.create = function create(properties) { + return new CreateSavedQueryRequest(properties); + }; + + /** + * Encodes the specified CreateSavedQueryRequest message. Does not implicitly {@link google.cloud.asset.v1.CreateSavedQueryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.CreateSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.ICreateSavedQueryRequest} message CreateSavedQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSavedQueryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.savedQuery != null && Object.hasOwnProperty.call(message, "savedQuery")) + $root.google.cloud.asset.v1.SavedQuery.encode(message.savedQuery, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.savedQueryId != null && Object.hasOwnProperty.call(message, "savedQueryId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.savedQueryId); + return writer; + }; + + /** + * Encodes the specified CreateSavedQueryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.CreateSavedQueryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.CreateSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.ICreateSavedQueryRequest} message CreateSavedQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSavedQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSavedQueryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.CreateSavedQueryRequest + * @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.CreateSavedQueryRequest} CreateSavedQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSavedQueryRequest.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.CreateSavedQueryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.savedQuery = $root.google.cloud.asset.v1.SavedQuery.decode(reader, reader.uint32()); + break; + case 3: + message.savedQueryId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSavedQueryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.CreateSavedQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.CreateSavedQueryRequest} CreateSavedQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSavedQueryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSavedQueryRequest message. + * @function verify + * @memberof google.cloud.asset.v1.CreateSavedQueryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSavedQueryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.savedQuery != null && message.hasOwnProperty("savedQuery")) { + var error = $root.google.cloud.asset.v1.SavedQuery.verify(message.savedQuery); + if (error) + return "savedQuery." + error; + } + if (message.savedQueryId != null && message.hasOwnProperty("savedQueryId")) + if (!$util.isString(message.savedQueryId)) + return "savedQueryId: string expected"; + return null; + }; + + /** + * Creates a CreateSavedQueryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.CreateSavedQueryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.CreateSavedQueryRequest} CreateSavedQueryRequest + */ + CreateSavedQueryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.CreateSavedQueryRequest) + return object; + var message = new $root.google.cloud.asset.v1.CreateSavedQueryRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.savedQuery != null) { + if (typeof object.savedQuery !== "object") + throw TypeError(".google.cloud.asset.v1.CreateSavedQueryRequest.savedQuery: object expected"); + message.savedQuery = $root.google.cloud.asset.v1.SavedQuery.fromObject(object.savedQuery); + } + if (object.savedQueryId != null) + message.savedQueryId = String(object.savedQueryId); + return message; + }; + + /** + * Creates a plain object from a CreateSavedQueryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.CreateSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.CreateSavedQueryRequest} message CreateSavedQueryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSavedQueryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.savedQuery = null; + object.savedQueryId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.savedQuery != null && message.hasOwnProperty("savedQuery")) + object.savedQuery = $root.google.cloud.asset.v1.SavedQuery.toObject(message.savedQuery, options); + if (message.savedQueryId != null && message.hasOwnProperty("savedQueryId")) + object.savedQueryId = message.savedQueryId; + return object; + }; + + /** + * Converts this CreateSavedQueryRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.CreateSavedQueryRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSavedQueryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateSavedQueryRequest; + })(); + + v1.GetSavedQueryRequest = (function() { + + /** + * Properties of a GetSavedQueryRequest. + * @memberof google.cloud.asset.v1 + * @interface IGetSavedQueryRequest + * @property {string|null} [name] GetSavedQueryRequest name + */ + + /** + * Constructs a new GetSavedQueryRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a GetSavedQueryRequest. + * @implements IGetSavedQueryRequest + * @constructor + * @param {google.cloud.asset.v1.IGetSavedQueryRequest=} [properties] Properties to set + */ + function GetSavedQueryRequest(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]]; + } + + /** + * GetSavedQueryRequest name. + * @member {string} name + * @memberof google.cloud.asset.v1.GetSavedQueryRequest + * @instance + */ + GetSavedQueryRequest.prototype.name = ""; + + /** + * Creates a new GetSavedQueryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.GetSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.IGetSavedQueryRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.GetSavedQueryRequest} GetSavedQueryRequest instance + */ + GetSavedQueryRequest.create = function create(properties) { + return new GetSavedQueryRequest(properties); + }; + + /** + * Encodes the specified GetSavedQueryRequest message. Does not implicitly {@link google.cloud.asset.v1.GetSavedQueryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.GetSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.IGetSavedQueryRequest} message GetSavedQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSavedQueryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetSavedQueryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GetSavedQueryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.GetSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.IGetSavedQueryRequest} message GetSavedQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSavedQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSavedQueryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.GetSavedQueryRequest + * @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.GetSavedQueryRequest} GetSavedQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSavedQueryRequest.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.GetSavedQueryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetSavedQueryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.GetSavedQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.GetSavedQueryRequest} GetSavedQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSavedQueryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSavedQueryRequest message. + * @function verify + * @memberof google.cloud.asset.v1.GetSavedQueryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSavedQueryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetSavedQueryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.GetSavedQueryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.GetSavedQueryRequest} GetSavedQueryRequest + */ + GetSavedQueryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.GetSavedQueryRequest) + return object; + var message = new $root.google.cloud.asset.v1.GetSavedQueryRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSavedQueryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.GetSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.GetSavedQueryRequest} message GetSavedQueryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSavedQueryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetSavedQueryRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.GetSavedQueryRequest + * @instance + * @returns {Object.} JSON object + */ + GetSavedQueryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetSavedQueryRequest; + })(); + + v1.ListSavedQueriesRequest = (function() { + + /** + * Properties of a ListSavedQueriesRequest. + * @memberof google.cloud.asset.v1 + * @interface IListSavedQueriesRequest + * @property {string|null} [parent] ListSavedQueriesRequest parent + * @property {string|null} [filter] ListSavedQueriesRequest filter + * @property {number|null} [pageSize] ListSavedQueriesRequest pageSize + * @property {string|null} [pageToken] ListSavedQueriesRequest pageToken + */ + + /** + * Constructs a new ListSavedQueriesRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a ListSavedQueriesRequest. + * @implements IListSavedQueriesRequest + * @constructor + * @param {google.cloud.asset.v1.IListSavedQueriesRequest=} [properties] Properties to set + */ + function ListSavedQueriesRequest(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]]; + } + + /** + * ListSavedQueriesRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @instance + */ + ListSavedQueriesRequest.prototype.parent = ""; + + /** + * ListSavedQueriesRequest filter. + * @member {string} filter + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @instance + */ + ListSavedQueriesRequest.prototype.filter = ""; + + /** + * ListSavedQueriesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @instance + */ + ListSavedQueriesRequest.prototype.pageSize = 0; + + /** + * ListSavedQueriesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @instance + */ + ListSavedQueriesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListSavedQueriesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @static + * @param {google.cloud.asset.v1.IListSavedQueriesRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.ListSavedQueriesRequest} ListSavedQueriesRequest instance + */ + ListSavedQueriesRequest.create = function create(properties) { + return new ListSavedQueriesRequest(properties); + }; + + /** + * Encodes the specified ListSavedQueriesRequest message. Does not implicitly {@link google.cloud.asset.v1.ListSavedQueriesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @static + * @param {google.cloud.asset.v1.IListSavedQueriesRequest} message ListSavedQueriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSavedQueriesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListSavedQueriesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListSavedQueriesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @static + * @param {google.cloud.asset.v1.IListSavedQueriesRequest} message ListSavedQueriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSavedQueriesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSavedQueriesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @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.ListSavedQueriesRequest} ListSavedQueriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSavedQueriesRequest.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.ListSavedQueriesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 4: + message.filter = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSavedQueriesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.ListSavedQueriesRequest} ListSavedQueriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSavedQueriesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSavedQueriesRequest message. + * @function verify + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSavedQueriesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListSavedQueriesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.ListSavedQueriesRequest} ListSavedQueriesRequest + */ + ListSavedQueriesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.ListSavedQueriesRequest) + return object; + var message = new $root.google.cloud.asset.v1.ListSavedQueriesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListSavedQueriesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @static + * @param {google.cloud.asset.v1.ListSavedQueriesRequest} message ListSavedQueriesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSavedQueriesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListSavedQueriesRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @instance + * @returns {Object.} JSON object + */ + ListSavedQueriesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListSavedQueriesRequest; + })(); + + v1.ListSavedQueriesResponse = (function() { + + /** + * Properties of a ListSavedQueriesResponse. + * @memberof google.cloud.asset.v1 + * @interface IListSavedQueriesResponse + * @property {Array.|null} [savedQueries] ListSavedQueriesResponse savedQueries + * @property {string|null} [nextPageToken] ListSavedQueriesResponse nextPageToken + */ + + /** + * Constructs a new ListSavedQueriesResponse. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a ListSavedQueriesResponse. + * @implements IListSavedQueriesResponse + * @constructor + * @param {google.cloud.asset.v1.IListSavedQueriesResponse=} [properties] Properties to set + */ + function ListSavedQueriesResponse(properties) { + this.savedQueries = []; + 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]]; + } + + /** + * ListSavedQueriesResponse savedQueries. + * @member {Array.} savedQueries + * @memberof google.cloud.asset.v1.ListSavedQueriesResponse + * @instance + */ + ListSavedQueriesResponse.prototype.savedQueries = $util.emptyArray; + + /** + * ListSavedQueriesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.asset.v1.ListSavedQueriesResponse + * @instance + */ + ListSavedQueriesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSavedQueriesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.ListSavedQueriesResponse + * @static + * @param {google.cloud.asset.v1.IListSavedQueriesResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1.ListSavedQueriesResponse} ListSavedQueriesResponse instance + */ + ListSavedQueriesResponse.create = function create(properties) { + return new ListSavedQueriesResponse(properties); + }; + + /** + * Encodes the specified ListSavedQueriesResponse message. Does not implicitly {@link google.cloud.asset.v1.ListSavedQueriesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.ListSavedQueriesResponse + * @static + * @param {google.cloud.asset.v1.IListSavedQueriesResponse} message ListSavedQueriesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSavedQueriesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.savedQueries != null && message.savedQueries.length) + for (var i = 0; i < message.savedQueries.length; ++i) + $root.google.cloud.asset.v1.SavedQuery.encode(message.savedQueries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListSavedQueriesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListSavedQueriesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.ListSavedQueriesResponse + * @static + * @param {google.cloud.asset.v1.IListSavedQueriesResponse} message ListSavedQueriesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSavedQueriesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSavedQueriesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.ListSavedQueriesResponse + * @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.ListSavedQueriesResponse} ListSavedQueriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSavedQueriesResponse.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.ListSavedQueriesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.savedQueries && message.savedQueries.length)) + message.savedQueries = []; + message.savedQueries.push($root.google.cloud.asset.v1.SavedQuery.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSavedQueriesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.ListSavedQueriesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.ListSavedQueriesResponse} ListSavedQueriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSavedQueriesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSavedQueriesResponse message. + * @function verify + * @memberof google.cloud.asset.v1.ListSavedQueriesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSavedQueriesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.savedQueries != null && message.hasOwnProperty("savedQueries")) { + if (!Array.isArray(message.savedQueries)) + return "savedQueries: array expected"; + for (var i = 0; i < message.savedQueries.length; ++i) { + var error = $root.google.cloud.asset.v1.SavedQuery.verify(message.savedQueries[i]); + if (error) + return "savedQueries." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSavedQueriesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.ListSavedQueriesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.ListSavedQueriesResponse} ListSavedQueriesResponse + */ + ListSavedQueriesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.ListSavedQueriesResponse) + return object; + var message = new $root.google.cloud.asset.v1.ListSavedQueriesResponse(); + if (object.savedQueries) { + if (!Array.isArray(object.savedQueries)) + throw TypeError(".google.cloud.asset.v1.ListSavedQueriesResponse.savedQueries: array expected"); + message.savedQueries = []; + for (var i = 0; i < object.savedQueries.length; ++i) { + if (typeof object.savedQueries[i] !== "object") + throw TypeError(".google.cloud.asset.v1.ListSavedQueriesResponse.savedQueries: object expected"); + message.savedQueries[i] = $root.google.cloud.asset.v1.SavedQuery.fromObject(object.savedQueries[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSavedQueriesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.ListSavedQueriesResponse + * @static + * @param {google.cloud.asset.v1.ListSavedQueriesResponse} message ListSavedQueriesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSavedQueriesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.savedQueries = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.savedQueries && message.savedQueries.length) { + object.savedQueries = []; + for (var j = 0; j < message.savedQueries.length; ++j) + object.savedQueries[j] = $root.google.cloud.asset.v1.SavedQuery.toObject(message.savedQueries[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSavedQueriesResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.ListSavedQueriesResponse + * @instance + * @returns {Object.} JSON object + */ + ListSavedQueriesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListSavedQueriesResponse; + })(); + + v1.UpdateSavedQueryRequest = (function() { + + /** + * Properties of an UpdateSavedQueryRequest. + * @memberof google.cloud.asset.v1 + * @interface IUpdateSavedQueryRequest + * @property {google.cloud.asset.v1.ISavedQuery|null} [savedQuery] UpdateSavedQueryRequest savedQuery + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSavedQueryRequest updateMask + */ + + /** + * Constructs a new UpdateSavedQueryRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an UpdateSavedQueryRequest. + * @implements IUpdateSavedQueryRequest + * @constructor + * @param {google.cloud.asset.v1.IUpdateSavedQueryRequest=} [properties] Properties to set + */ + function UpdateSavedQueryRequest(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]]; + } + + /** + * UpdateSavedQueryRequest savedQuery. + * @member {google.cloud.asset.v1.ISavedQuery|null|undefined} savedQuery + * @memberof google.cloud.asset.v1.UpdateSavedQueryRequest + * @instance + */ + UpdateSavedQueryRequest.prototype.savedQuery = null; + + /** + * UpdateSavedQueryRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.asset.v1.UpdateSavedQueryRequest + * @instance + */ + UpdateSavedQueryRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateSavedQueryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.UpdateSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.IUpdateSavedQueryRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.UpdateSavedQueryRequest} UpdateSavedQueryRequest instance + */ + UpdateSavedQueryRequest.create = function create(properties) { + return new UpdateSavedQueryRequest(properties); + }; + + /** + * Encodes the specified UpdateSavedQueryRequest message. Does not implicitly {@link google.cloud.asset.v1.UpdateSavedQueryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.UpdateSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.IUpdateSavedQueryRequest} message UpdateSavedQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSavedQueryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.savedQuery != null && Object.hasOwnProperty.call(message, "savedQuery")) + $root.google.cloud.asset.v1.SavedQuery.encode(message.savedQuery, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateSavedQueryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.UpdateSavedQueryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.UpdateSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.IUpdateSavedQueryRequest} message UpdateSavedQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSavedQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSavedQueryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.UpdateSavedQueryRequest + * @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.UpdateSavedQueryRequest} UpdateSavedQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSavedQueryRequest.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.UpdateSavedQueryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.savedQuery = $root.google.cloud.asset.v1.SavedQuery.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateSavedQueryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.UpdateSavedQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.UpdateSavedQueryRequest} UpdateSavedQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSavedQueryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSavedQueryRequest message. + * @function verify + * @memberof google.cloud.asset.v1.UpdateSavedQueryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSavedQueryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.savedQuery != null && message.hasOwnProperty("savedQuery")) { + var error = $root.google.cloud.asset.v1.SavedQuery.verify(message.savedQuery); + if (error) + return "savedQuery." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateSavedQueryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.UpdateSavedQueryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.UpdateSavedQueryRequest} UpdateSavedQueryRequest + */ + UpdateSavedQueryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.UpdateSavedQueryRequest) + return object; + var message = new $root.google.cloud.asset.v1.UpdateSavedQueryRequest(); + if (object.savedQuery != null) { + if (typeof object.savedQuery !== "object") + throw TypeError(".google.cloud.asset.v1.UpdateSavedQueryRequest.savedQuery: object expected"); + message.savedQuery = $root.google.cloud.asset.v1.SavedQuery.fromObject(object.savedQuery); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.asset.v1.UpdateSavedQueryRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSavedQueryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.UpdateSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.UpdateSavedQueryRequest} message UpdateSavedQueryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSavedQueryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.savedQuery = null; + object.updateMask = null; + } + if (message.savedQuery != null && message.hasOwnProperty("savedQuery")) + object.savedQuery = $root.google.cloud.asset.v1.SavedQuery.toObject(message.savedQuery, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateSavedQueryRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.UpdateSavedQueryRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSavedQueryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateSavedQueryRequest; + })(); + + v1.DeleteSavedQueryRequest = (function() { + + /** + * Properties of a DeleteSavedQueryRequest. + * @memberof google.cloud.asset.v1 + * @interface IDeleteSavedQueryRequest + * @property {string|null} [name] DeleteSavedQueryRequest name + */ + + /** + * Constructs a new DeleteSavedQueryRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a DeleteSavedQueryRequest. + * @implements IDeleteSavedQueryRequest + * @constructor + * @param {google.cloud.asset.v1.IDeleteSavedQueryRequest=} [properties] Properties to set + */ + function DeleteSavedQueryRequest(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]]; + } + + /** + * DeleteSavedQueryRequest name. + * @member {string} name + * @memberof google.cloud.asset.v1.DeleteSavedQueryRequest + * @instance + */ + DeleteSavedQueryRequest.prototype.name = ""; + + /** + * Creates a new DeleteSavedQueryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.DeleteSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.IDeleteSavedQueryRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.DeleteSavedQueryRequest} DeleteSavedQueryRequest instance + */ + DeleteSavedQueryRequest.create = function create(properties) { + return new DeleteSavedQueryRequest(properties); + }; + + /** + * Encodes the specified DeleteSavedQueryRequest message. Does not implicitly {@link google.cloud.asset.v1.DeleteSavedQueryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.DeleteSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.IDeleteSavedQueryRequest} message DeleteSavedQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSavedQueryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteSavedQueryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.DeleteSavedQueryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.DeleteSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.IDeleteSavedQueryRequest} message DeleteSavedQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSavedQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSavedQueryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.DeleteSavedQueryRequest + * @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.DeleteSavedQueryRequest} DeleteSavedQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSavedQueryRequest.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.DeleteSavedQueryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSavedQueryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.DeleteSavedQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.DeleteSavedQueryRequest} DeleteSavedQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSavedQueryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSavedQueryRequest message. + * @function verify + * @memberof google.cloud.asset.v1.DeleteSavedQueryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSavedQueryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteSavedQueryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.DeleteSavedQueryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.DeleteSavedQueryRequest} DeleteSavedQueryRequest + */ + DeleteSavedQueryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.DeleteSavedQueryRequest) + return object; + var message = new $root.google.cloud.asset.v1.DeleteSavedQueryRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteSavedQueryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.DeleteSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.DeleteSavedQueryRequest} message DeleteSavedQueryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSavedQueryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteSavedQueryRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.DeleteSavedQueryRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSavedQueryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteSavedQueryRequest; + })(); + + v1.AnalyzeMoveRequest = (function() { + + /** + * Properties of an AnalyzeMoveRequest. + * @memberof google.cloud.asset.v1 + * @interface IAnalyzeMoveRequest + * @property {string|null} [resource] AnalyzeMoveRequest resource + * @property {string|null} [destinationParent] AnalyzeMoveRequest destinationParent + * @property {google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView|null} [view] AnalyzeMoveRequest view + */ + + /** + * Constructs a new AnalyzeMoveRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an AnalyzeMoveRequest. + * @implements IAnalyzeMoveRequest + * @constructor + * @param {google.cloud.asset.v1.IAnalyzeMoveRequest=} [properties] Properties to set + */ + function AnalyzeMoveRequest(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]]; + } + + /** + * AnalyzeMoveRequest resource. + * @member {string} resource + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @instance + */ + AnalyzeMoveRequest.prototype.resource = ""; + + /** + * AnalyzeMoveRequest destinationParent. + * @member {string} destinationParent + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @instance + */ + AnalyzeMoveRequest.prototype.destinationParent = ""; + + /** + * AnalyzeMoveRequest view. + * @member {google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView} view + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @instance + */ + AnalyzeMoveRequest.prototype.view = 0; + + /** + * Creates a new AnalyzeMoveRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @static + * @param {google.cloud.asset.v1.IAnalyzeMoveRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzeMoveRequest} AnalyzeMoveRequest instance + */ + AnalyzeMoveRequest.create = function create(properties) { + return new AnalyzeMoveRequest(properties); + }; + + /** + * Encodes the specified AnalyzeMoveRequest message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @static + * @param {google.cloud.asset.v1.IAnalyzeMoveRequest} message AnalyzeMoveRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeMoveRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.destinationParent != null && Object.hasOwnProperty.call(message, "destinationParent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.destinationParent); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.view); + return writer; + }; + + /** + * Encodes the specified AnalyzeMoveRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @static + * @param {google.cloud.asset.v1.IAnalyzeMoveRequest} message AnalyzeMoveRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeMoveRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeMoveRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @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.AnalyzeMoveRequest} AnalyzeMoveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeMoveRequest.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.AnalyzeMoveRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resource = reader.string(); + break; + case 2: + message.destinationParent = reader.string(); + break; + case 3: + message.view = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeMoveRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.AnalyzeMoveRequest} AnalyzeMoveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeMoveRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeMoveRequest message. + * @function verify + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeMoveRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.destinationParent != null && message.hasOwnProperty("destinationParent")) + if (!$util.isString(message.destinationParent)) + return "destinationParent: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an AnalyzeMoveRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.AnalyzeMoveRequest} AnalyzeMoveRequest + */ + AnalyzeMoveRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzeMoveRequest) + return object; + var message = new $root.google.cloud.asset.v1.AnalyzeMoveRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.destinationParent != null) + message.destinationParent = String(object.destinationParent); + switch (object.view) { + case "ANALYSIS_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "FULL": + case 1: + message.view = 1; + break; + case "BASIC": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an AnalyzeMoveRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @static + * @param {google.cloud.asset.v1.AnalyzeMoveRequest} message AnalyzeMoveRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeMoveRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.destinationParent = ""; + object.view = options.enums === String ? "ANALYSIS_VIEW_UNSPECIFIED" : 0; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.destinationParent != null && message.hasOwnProperty("destinationParent")) + object.destinationParent = message.destinationParent; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView[message.view] : message.view; + return object; + }; + + /** + * Converts this AnalyzeMoveRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @instance + * @returns {Object.} JSON object + */ + AnalyzeMoveRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * AnalysisView enum. + * @name google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView + * @enum {number} + * @property {number} ANALYSIS_VIEW_UNSPECIFIED=0 ANALYSIS_VIEW_UNSPECIFIED value + * @property {number} FULL=1 FULL value + * @property {number} BASIC=2 BASIC value + */ + AnalyzeMoveRequest.AnalysisView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ANALYSIS_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "FULL"] = 1; + values[valuesById[2] = "BASIC"] = 2; + return values; + })(); + + return AnalyzeMoveRequest; + })(); + + v1.AnalyzeMoveResponse = (function() { + + /** + * Properties of an AnalyzeMoveResponse. + * @memberof google.cloud.asset.v1 + * @interface IAnalyzeMoveResponse + * @property {Array.|null} [moveAnalysis] AnalyzeMoveResponse moveAnalysis + */ + + /** + * Constructs a new AnalyzeMoveResponse. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an AnalyzeMoveResponse. + * @implements IAnalyzeMoveResponse + * @constructor + * @param {google.cloud.asset.v1.IAnalyzeMoveResponse=} [properties] Properties to set + */ + function AnalyzeMoveResponse(properties) { + this.moveAnalysis = []; + 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]]; + } + + /** + * AnalyzeMoveResponse moveAnalysis. + * @member {Array.} moveAnalysis + * @memberof google.cloud.asset.v1.AnalyzeMoveResponse + * @instance + */ + AnalyzeMoveResponse.prototype.moveAnalysis = $util.emptyArray; + + /** + * Creates a new AnalyzeMoveResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzeMoveResponse + * @static + * @param {google.cloud.asset.v1.IAnalyzeMoveResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzeMoveResponse} AnalyzeMoveResponse instance + */ + AnalyzeMoveResponse.create = function create(properties) { + return new AnalyzeMoveResponse(properties); + }; + + /** + * Encodes the specified AnalyzeMoveResponse message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzeMoveResponse + * @static + * @param {google.cloud.asset.v1.IAnalyzeMoveResponse} message AnalyzeMoveResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeMoveResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.moveAnalysis != null && message.moveAnalysis.length) + for (var i = 0; i < message.moveAnalysis.length; ++i) + $root.google.cloud.asset.v1.MoveAnalysis.encode(message.moveAnalysis[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnalyzeMoveResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeMoveResponse + * @static + * @param {google.cloud.asset.v1.IAnalyzeMoveResponse} message AnalyzeMoveResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeMoveResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeMoveResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.AnalyzeMoveResponse + * @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.AnalyzeMoveResponse} AnalyzeMoveResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeMoveResponse.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.AnalyzeMoveResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.moveAnalysis && message.moveAnalysis.length)) + message.moveAnalysis = []; message.moveAnalysis.push($root.google.cloud.asset.v1.MoveAnalysis.decode(reader, reader.uint32())); break; default: @@ -11271,37 +13433,496 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MoveAnalysisResult.encodeDelimited = function encodeDelimited(message, writer) { + MoveAnalysisResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MoveAnalysisResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @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.MoveAnalysisResult} MoveAnalysisResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveAnalysisResult.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.MoveAnalysisResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.blockers && message.blockers.length)) + message.blockers = []; + message.blockers.push($root.google.cloud.asset.v1.MoveImpact.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.warnings && message.warnings.length)) + message.warnings = []; + message.warnings.push($root.google.cloud.asset.v1.MoveImpact.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MoveAnalysisResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.MoveAnalysisResult} MoveAnalysisResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveAnalysisResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MoveAnalysisResult message. + * @function verify + * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MoveAnalysisResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.blockers != null && message.hasOwnProperty("blockers")) { + if (!Array.isArray(message.blockers)) + return "blockers: array expected"; + for (var i = 0; i < message.blockers.length; ++i) { + var error = $root.google.cloud.asset.v1.MoveImpact.verify(message.blockers[i]); + if (error) + return "blockers." + error; + } + } + if (message.warnings != null && message.hasOwnProperty("warnings")) { + if (!Array.isArray(message.warnings)) + return "warnings: array expected"; + for (var i = 0; i < message.warnings.length; ++i) { + var error = $root.google.cloud.asset.v1.MoveImpact.verify(message.warnings[i]); + if (error) + return "warnings." + error; + } + } + return null; + }; + + /** + * Creates a MoveAnalysisResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.MoveAnalysisResult} MoveAnalysisResult + */ + MoveAnalysisResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.MoveAnalysisResult) + return object; + var message = new $root.google.cloud.asset.v1.MoveAnalysisResult(); + if (object.blockers) { + if (!Array.isArray(object.blockers)) + throw TypeError(".google.cloud.asset.v1.MoveAnalysisResult.blockers: array expected"); + message.blockers = []; + for (var i = 0; i < object.blockers.length; ++i) { + if (typeof object.blockers[i] !== "object") + throw TypeError(".google.cloud.asset.v1.MoveAnalysisResult.blockers: object expected"); + message.blockers[i] = $root.google.cloud.asset.v1.MoveImpact.fromObject(object.blockers[i]); + } + } + if (object.warnings) { + if (!Array.isArray(object.warnings)) + throw TypeError(".google.cloud.asset.v1.MoveAnalysisResult.warnings: array expected"); + message.warnings = []; + for (var i = 0; i < object.warnings.length; ++i) { + if (typeof object.warnings[i] !== "object") + throw TypeError(".google.cloud.asset.v1.MoveAnalysisResult.warnings: object expected"); + message.warnings[i] = $root.google.cloud.asset.v1.MoveImpact.fromObject(object.warnings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MoveAnalysisResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @static + * @param {google.cloud.asset.v1.MoveAnalysisResult} message MoveAnalysisResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MoveAnalysisResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.blockers = []; + object.warnings = []; + } + if (message.blockers && message.blockers.length) { + object.blockers = []; + for (var j = 0; j < message.blockers.length; ++j) + object.blockers[j] = $root.google.cloud.asset.v1.MoveImpact.toObject(message.blockers[j], options); + } + if (message.warnings && message.warnings.length) { + object.warnings = []; + for (var j = 0; j < message.warnings.length; ++j) + object.warnings[j] = $root.google.cloud.asset.v1.MoveImpact.toObject(message.warnings[j], options); + } + return object; + }; + + /** + * Converts this MoveAnalysisResult to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @instance + * @returns {Object.} JSON object + */ + MoveAnalysisResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MoveAnalysisResult; + })(); + + v1.MoveImpact = (function() { + + /** + * Properties of a MoveImpact. + * @memberof google.cloud.asset.v1 + * @interface IMoveImpact + * @property {string|null} [detail] MoveImpact detail + */ + + /** + * Constructs a new MoveImpact. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a MoveImpact. + * @implements IMoveImpact + * @constructor + * @param {google.cloud.asset.v1.IMoveImpact=} [properties] Properties to set + */ + function MoveImpact(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]]; + } + + /** + * MoveImpact detail. + * @member {string} detail + * @memberof google.cloud.asset.v1.MoveImpact + * @instance + */ + MoveImpact.prototype.detail = ""; + + /** + * Creates a new MoveImpact instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.MoveImpact + * @static + * @param {google.cloud.asset.v1.IMoveImpact=} [properties] Properties to set + * @returns {google.cloud.asset.v1.MoveImpact} MoveImpact instance + */ + MoveImpact.create = function create(properties) { + return new MoveImpact(properties); + }; + + /** + * Encodes the specified MoveImpact message. Does not implicitly {@link google.cloud.asset.v1.MoveImpact.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.MoveImpact + * @static + * @param {google.cloud.asset.v1.IMoveImpact} message MoveImpact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveImpact.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.detail != null && Object.hasOwnProperty.call(message, "detail")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.detail); + return writer; + }; + + /** + * Encodes the specified MoveImpact message, length delimited. Does not implicitly {@link google.cloud.asset.v1.MoveImpact.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.MoveImpact + * @static + * @param {google.cloud.asset.v1.IMoveImpact} message MoveImpact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveImpact.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MoveImpact message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.MoveImpact + * @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.MoveImpact} MoveImpact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveImpact.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.MoveImpact(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.detail = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MoveImpact message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.MoveImpact + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.MoveImpact} MoveImpact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveImpact.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MoveImpact message. + * @function verify + * @memberof google.cloud.asset.v1.MoveImpact + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MoveImpact.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.detail != null && message.hasOwnProperty("detail")) + if (!$util.isString(message.detail)) + return "detail: string expected"; + return null; + }; + + /** + * Creates a MoveImpact message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.MoveImpact + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.MoveImpact} MoveImpact + */ + MoveImpact.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.MoveImpact) + return object; + var message = new $root.google.cloud.asset.v1.MoveImpact(); + if (object.detail != null) + message.detail = String(object.detail); + return message; + }; + + /** + * Creates a plain object from a MoveImpact message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.MoveImpact + * @static + * @param {google.cloud.asset.v1.MoveImpact} message MoveImpact + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MoveImpact.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.detail = ""; + if (message.detail != null && message.hasOwnProperty("detail")) + object.detail = message.detail; + return object; + }; + + /** + * Converts this MoveImpact to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.MoveImpact + * @instance + * @returns {Object.} JSON object + */ + MoveImpact.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MoveImpact; + })(); + + /** + * ContentType enum. + * @name google.cloud.asset.v1.ContentType + * @enum {number} + * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value + * @property {number} RESOURCE=1 RESOURCE value + * @property {number} IAM_POLICY=2 IAM_POLICY value + * @property {number} ORG_POLICY=4 ORG_POLICY value + * @property {number} ACCESS_POLICY=5 ACCESS_POLICY value + * @property {number} OS_INVENTORY=6 OS_INVENTORY value + * @property {number} RELATIONSHIP=7 RELATIONSHIP value + */ + v1.ContentType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONTENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RESOURCE"] = 1; + values[valuesById[2] = "IAM_POLICY"] = 2; + values[valuesById[4] = "ORG_POLICY"] = 4; + values[valuesById[5] = "ACCESS_POLICY"] = 5; + values[valuesById[6] = "OS_INVENTORY"] = 6; + values[valuesById[7] = "RELATIONSHIP"] = 7; + return values; + })(); + + v1.BatchGetEffectiveIamPoliciesRequest = (function() { + + /** + * Properties of a BatchGetEffectiveIamPoliciesRequest. + * @memberof google.cloud.asset.v1 + * @interface IBatchGetEffectiveIamPoliciesRequest + * @property {string|null} [scope] BatchGetEffectiveIamPoliciesRequest scope + * @property {Array.|null} [names] BatchGetEffectiveIamPoliciesRequest names + */ + + /** + * Constructs a new BatchGetEffectiveIamPoliciesRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a BatchGetEffectiveIamPoliciesRequest. + * @implements IBatchGetEffectiveIamPoliciesRequest + * @constructor + * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest=} [properties] Properties to set + */ + function BatchGetEffectiveIamPoliciesRequest(properties) { + this.names = []; + 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]]; + } + + /** + * BatchGetEffectiveIamPoliciesRequest scope. + * @member {string} scope + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @instance + */ + BatchGetEffectiveIamPoliciesRequest.prototype.scope = ""; + + /** + * BatchGetEffectiveIamPoliciesRequest names. + * @member {Array.} names + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @instance + */ + BatchGetEffectiveIamPoliciesRequest.prototype.names = $util.emptyArray; + + /** + * Creates a new BatchGetEffectiveIamPoliciesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @static + * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest} BatchGetEffectiveIamPoliciesRequest instance + */ + BatchGetEffectiveIamPoliciesRequest.create = function create(properties) { + return new BatchGetEffectiveIamPoliciesRequest(properties); + }; + + /** + * Encodes the specified BatchGetEffectiveIamPoliciesRequest message. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @static + * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest} message BatchGetEffectiveIamPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchGetEffectiveIamPoliciesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.scope); + if (message.names != null && message.names.length) + for (var i = 0; i < message.names.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.names[i]); + return writer; + }; + + /** + * Encodes the specified BatchGetEffectiveIamPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @static + * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest} message BatchGetEffectiveIamPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchGetEffectiveIamPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MoveAnalysisResult message from the specified reader or buffer. + * Decodes a BatchGetEffectiveIamPoliciesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest * @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.MoveAnalysisResult} MoveAnalysisResult + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest} BatchGetEffectiveIamPoliciesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MoveAnalysisResult.decode = function decode(reader, length) { + BatchGetEffectiveIamPoliciesRequest.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.MoveAnalysisResult(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.blockers && message.blockers.length)) - message.blockers = []; - message.blockers.push($root.google.cloud.asset.v1.MoveImpact.decode(reader, reader.uint32())); + message.scope = reader.string(); break; - case 2: - if (!(message.warnings && message.warnings.length)) - message.warnings = []; - message.warnings.push($root.google.cloud.asset.v1.MoveImpact.decode(reader, reader.uint32())); + case 3: + if (!(message.names && message.names.length)) + message.names = []; + message.names.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -11312,150 +13933,129 @@ }; /** - * Decodes a MoveAnalysisResult message from the specified reader or buffer, length delimited. + * Decodes a BatchGetEffectiveIamPoliciesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.MoveAnalysisResult} MoveAnalysisResult + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest} BatchGetEffectiveIamPoliciesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MoveAnalysisResult.decodeDelimited = function decodeDelimited(reader) { + BatchGetEffectiveIamPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MoveAnalysisResult message. + * Verifies a BatchGetEffectiveIamPoliciesRequest message. * @function verify - * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MoveAnalysisResult.verify = function verify(message) { + BatchGetEffectiveIamPoliciesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.blockers != null && message.hasOwnProperty("blockers")) { - if (!Array.isArray(message.blockers)) - return "blockers: array expected"; - for (var i = 0; i < message.blockers.length; ++i) { - var error = $root.google.cloud.asset.v1.MoveImpact.verify(message.blockers[i]); - if (error) - return "blockers." + error; - } - } - if (message.warnings != null && message.hasOwnProperty("warnings")) { - if (!Array.isArray(message.warnings)) - return "warnings: array expected"; - for (var i = 0; i < message.warnings.length; ++i) { - var error = $root.google.cloud.asset.v1.MoveImpact.verify(message.warnings[i]); - if (error) - return "warnings." + error; - } + if (message.scope != null && message.hasOwnProperty("scope")) + if (!$util.isString(message.scope)) + return "scope: string expected"; + if (message.names != null && message.hasOwnProperty("names")) { + if (!Array.isArray(message.names)) + return "names: array expected"; + for (var i = 0; i < message.names.length; ++i) + if (!$util.isString(message.names[i])) + return "names: string[] expected"; } return null; }; /** - * Creates a MoveAnalysisResult message from a plain object. Also converts values to their respective internal types. + * Creates a BatchGetEffectiveIamPoliciesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.MoveAnalysisResult} MoveAnalysisResult + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest} BatchGetEffectiveIamPoliciesRequest */ - MoveAnalysisResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.MoveAnalysisResult) + BatchGetEffectiveIamPoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest) return object; - var message = new $root.google.cloud.asset.v1.MoveAnalysisResult(); - if (object.blockers) { - if (!Array.isArray(object.blockers)) - throw TypeError(".google.cloud.asset.v1.MoveAnalysisResult.blockers: array expected"); - message.blockers = []; - for (var i = 0; i < object.blockers.length; ++i) { - if (typeof object.blockers[i] !== "object") - throw TypeError(".google.cloud.asset.v1.MoveAnalysisResult.blockers: object expected"); - message.blockers[i] = $root.google.cloud.asset.v1.MoveImpact.fromObject(object.blockers[i]); - } - } - if (object.warnings) { - if (!Array.isArray(object.warnings)) - throw TypeError(".google.cloud.asset.v1.MoveAnalysisResult.warnings: array expected"); - message.warnings = []; - for (var i = 0; i < object.warnings.length; ++i) { - if (typeof object.warnings[i] !== "object") - throw TypeError(".google.cloud.asset.v1.MoveAnalysisResult.warnings: object expected"); - message.warnings[i] = $root.google.cloud.asset.v1.MoveImpact.fromObject(object.warnings[i]); - } + var message = new $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest(); + if (object.scope != null) + message.scope = String(object.scope); + if (object.names) { + if (!Array.isArray(object.names)) + throw TypeError(".google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.names: array expected"); + message.names = []; + for (var i = 0; i < object.names.length; ++i) + message.names[i] = String(object.names[i]); } return message; }; /** - * Creates a plain object from a MoveAnalysisResult message. Also converts values to other types if specified. + * Creates a plain object from a BatchGetEffectiveIamPoliciesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest * @static - * @param {google.cloud.asset.v1.MoveAnalysisResult} message MoveAnalysisResult + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest} message BatchGetEffectiveIamPoliciesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MoveAnalysisResult.toObject = function toObject(message, options) { + BatchGetEffectiveIamPoliciesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.blockers = []; - object.warnings = []; - } - if (message.blockers && message.blockers.length) { - object.blockers = []; - for (var j = 0; j < message.blockers.length; ++j) - object.blockers[j] = $root.google.cloud.asset.v1.MoveImpact.toObject(message.blockers[j], options); - } - if (message.warnings && message.warnings.length) { - object.warnings = []; - for (var j = 0; j < message.warnings.length; ++j) - object.warnings[j] = $root.google.cloud.asset.v1.MoveImpact.toObject(message.warnings[j], options); + if (options.arrays || options.defaults) + object.names = []; + if (options.defaults) + object.scope = ""; + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = message.scope; + if (message.names && message.names.length) { + object.names = []; + for (var j = 0; j < message.names.length; ++j) + object.names[j] = message.names[j]; } return object; }; /** - * Converts this MoveAnalysisResult to JSON. + * Converts this BatchGetEffectiveIamPoliciesRequest to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest * @instance * @returns {Object.} JSON object */ - MoveAnalysisResult.prototype.toJSON = function toJSON() { + BatchGetEffectiveIamPoliciesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return MoveAnalysisResult; + return BatchGetEffectiveIamPoliciesRequest; })(); - v1.MoveImpact = (function() { + v1.BatchGetEffectiveIamPoliciesResponse = (function() { /** - * Properties of a MoveImpact. + * Properties of a BatchGetEffectiveIamPoliciesResponse. * @memberof google.cloud.asset.v1 - * @interface IMoveImpact - * @property {string|null} [detail] MoveImpact detail + * @interface IBatchGetEffectiveIamPoliciesResponse + * @property {Array.|null} [policyResults] BatchGetEffectiveIamPoliciesResponse policyResults */ /** - * Constructs a new MoveImpact. + * Constructs a new BatchGetEffectiveIamPoliciesResponse. * @memberof google.cloud.asset.v1 - * @classdesc Represents a MoveImpact. - * @implements IMoveImpact + * @classdesc Represents a BatchGetEffectiveIamPoliciesResponse. + * @implements IBatchGetEffectiveIamPoliciesResponse * @constructor - * @param {google.cloud.asset.v1.IMoveImpact=} [properties] Properties to set + * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse=} [properties] Properties to set */ - function MoveImpact(properties) { + function BatchGetEffectiveIamPoliciesResponse(properties) { + this.policyResults = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11463,75 +14063,78 @@ } /** - * MoveImpact detail. - * @member {string} detail - * @memberof google.cloud.asset.v1.MoveImpact + * BatchGetEffectiveIamPoliciesResponse policyResults. + * @member {Array.} policyResults + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse * @instance */ - MoveImpact.prototype.detail = ""; + BatchGetEffectiveIamPoliciesResponse.prototype.policyResults = $util.emptyArray; /** - * Creates a new MoveImpact instance using the specified properties. + * Creates a new BatchGetEffectiveIamPoliciesResponse instance using the specified properties. * @function create - * @memberof google.cloud.asset.v1.MoveImpact + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse * @static - * @param {google.cloud.asset.v1.IMoveImpact=} [properties] Properties to set - * @returns {google.cloud.asset.v1.MoveImpact} MoveImpact instance + * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse} BatchGetEffectiveIamPoliciesResponse instance */ - MoveImpact.create = function create(properties) { - return new MoveImpact(properties); + BatchGetEffectiveIamPoliciesResponse.create = function create(properties) { + return new BatchGetEffectiveIamPoliciesResponse(properties); }; /** - * Encodes the specified MoveImpact message. Does not implicitly {@link google.cloud.asset.v1.MoveImpact.verify|verify} messages. + * Encodes the specified BatchGetEffectiveIamPoliciesResponse message. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.asset.v1.MoveImpact + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse * @static - * @param {google.cloud.asset.v1.IMoveImpact} message MoveImpact message or plain object to encode + * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse} message BatchGetEffectiveIamPoliciesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MoveImpact.encode = function encode(message, writer) { + BatchGetEffectiveIamPoliciesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.detail != null && Object.hasOwnProperty.call(message, "detail")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.detail); + if (message.policyResults != null && message.policyResults.length) + for (var i = 0; i < message.policyResults.length; ++i) + $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.encode(message.policyResults[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified MoveImpact message, length delimited. Does not implicitly {@link google.cloud.asset.v1.MoveImpact.verify|verify} messages. + * Encodes the specified BatchGetEffectiveIamPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.asset.v1.MoveImpact + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse * @static - * @param {google.cloud.asset.v1.IMoveImpact} message MoveImpact message or plain object to encode + * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse} message BatchGetEffectiveIamPoliciesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MoveImpact.encodeDelimited = function encodeDelimited(message, writer) { + BatchGetEffectiveIamPoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MoveImpact message from the specified reader or buffer. + * Decodes a BatchGetEffectiveIamPoliciesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.asset.v1.MoveImpact + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse * @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.MoveImpact} MoveImpact + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse} BatchGetEffectiveIamPoliciesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MoveImpact.decode = function decode(reader, length) { + BatchGetEffectiveIamPoliciesResponse.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.MoveImpact(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.detail = reader.string(); + case 2: + if (!(message.policyResults && message.policyResults.length)) + message.policyResults = []; + message.policyResults.push($root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -11542,111 +14145,550 @@ }; /** - * Decodes a MoveImpact message from the specified reader or buffer, length delimited. + * Decodes a BatchGetEffectiveIamPoliciesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.asset.v1.MoveImpact + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1.MoveImpact} MoveImpact + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse} BatchGetEffectiveIamPoliciesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MoveImpact.decodeDelimited = function decodeDelimited(reader) { + BatchGetEffectiveIamPoliciesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MoveImpact message. + * Verifies a BatchGetEffectiveIamPoliciesResponse message. * @function verify - * @memberof google.cloud.asset.v1.MoveImpact + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MoveImpact.verify = function verify(message) { + BatchGetEffectiveIamPoliciesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.detail != null && message.hasOwnProperty("detail")) - if (!$util.isString(message.detail)) - return "detail: string expected"; + if (message.policyResults != null && message.hasOwnProperty("policyResults")) { + if (!Array.isArray(message.policyResults)) + return "policyResults: array expected"; + for (var i = 0; i < message.policyResults.length; ++i) { + var error = $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.verify(message.policyResults[i]); + if (error) + return "policyResults." + error; + } + } return null; }; /** - * Creates a MoveImpact message from a plain object. Also converts values to their respective internal types. + * Creates a BatchGetEffectiveIamPoliciesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.asset.v1.MoveImpact + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1.MoveImpact} MoveImpact + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse} BatchGetEffectiveIamPoliciesResponse */ - MoveImpact.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1.MoveImpact) + BatchGetEffectiveIamPoliciesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse) return object; - var message = new $root.google.cloud.asset.v1.MoveImpact(); - if (object.detail != null) - message.detail = String(object.detail); + var message = new $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse(); + if (object.policyResults) { + if (!Array.isArray(object.policyResults)) + throw TypeError(".google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.policyResults: array expected"); + message.policyResults = []; + for (var i = 0; i < object.policyResults.length; ++i) { + if (typeof object.policyResults[i] !== "object") + throw TypeError(".google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.policyResults: object expected"); + message.policyResults[i] = $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.fromObject(object.policyResults[i]); + } + } return message; }; /** - * Creates a plain object from a MoveImpact message. Also converts values to other types if specified. + * Creates a plain object from a BatchGetEffectiveIamPoliciesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.asset.v1.MoveImpact + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse * @static - * @param {google.cloud.asset.v1.MoveImpact} message MoveImpact + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse} message BatchGetEffectiveIamPoliciesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MoveImpact.toObject = function toObject(message, options) { + BatchGetEffectiveIamPoliciesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.detail = ""; - if (message.detail != null && message.hasOwnProperty("detail")) - object.detail = message.detail; + if (options.arrays || options.defaults) + object.policyResults = []; + if (message.policyResults && message.policyResults.length) { + object.policyResults = []; + for (var j = 0; j < message.policyResults.length; ++j) + object.policyResults[j] = $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.toObject(message.policyResults[j], options); + } return object; }; /** - * Converts this MoveImpact to JSON. + * Converts this BatchGetEffectiveIamPoliciesResponse to JSON. * @function toJSON - * @memberof google.cloud.asset.v1.MoveImpact + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse * @instance * @returns {Object.} JSON object */ - MoveImpact.prototype.toJSON = function toJSON() { + BatchGetEffectiveIamPoliciesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return MoveImpact; - })(); + BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy = (function() { - /** - * ContentType enum. - * @name google.cloud.asset.v1.ContentType - * @enum {number} - * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value - * @property {number} RESOURCE=1 RESOURCE value - * @property {number} IAM_POLICY=2 IAM_POLICY value - * @property {number} ORG_POLICY=4 ORG_POLICY value - * @property {number} ACCESS_POLICY=5 ACCESS_POLICY value - * @property {number} OS_INVENTORY=6 OS_INVENTORY value - * @property {number} RELATIONSHIP=7 RELATIONSHIP value - */ - v1.ContentType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CONTENT_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RESOURCE"] = 1; - values[valuesById[2] = "IAM_POLICY"] = 2; - values[valuesById[4] = "ORG_POLICY"] = 4; - values[valuesById[5] = "ACCESS_POLICY"] = 5; - values[valuesById[6] = "OS_INVENTORY"] = 6; - values[valuesById[7] = "RELATIONSHIP"] = 7; - return values; + /** + * Properties of an EffectiveIamPolicy. + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse + * @interface IEffectiveIamPolicy + * @property {string|null} [fullResourceName] EffectiveIamPolicy fullResourceName + * @property {Array.|null} [policies] EffectiveIamPolicy policies + */ + + /** + * Constructs a new EffectiveIamPolicy. + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse + * @classdesc Represents an EffectiveIamPolicy. + * @implements IEffectiveIamPolicy + * @constructor + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy=} [properties] Properties to set + */ + function EffectiveIamPolicy(properties) { + this.policies = []; + 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]]; + } + + /** + * EffectiveIamPolicy fullResourceName. + * @member {string} fullResourceName + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @instance + */ + EffectiveIamPolicy.prototype.fullResourceName = ""; + + /** + * EffectiveIamPolicy policies. + * @member {Array.} policies + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @instance + */ + EffectiveIamPolicy.prototype.policies = $util.emptyArray; + + /** + * Creates a new EffectiveIamPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @static + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy=} [properties] Properties to set + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy} EffectiveIamPolicy instance + */ + EffectiveIamPolicy.create = function create(properties) { + return new EffectiveIamPolicy(properties); + }; + + /** + * Encodes the specified EffectiveIamPolicy message. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @static + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy} message EffectiveIamPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EffectiveIamPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fullResourceName != null && Object.hasOwnProperty.call(message, "fullResourceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fullResourceName); + if (message.policies != null && message.policies.length) + for (var i = 0; i < message.policies.length; ++i) + $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.encode(message.policies[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EffectiveIamPolicy message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @static + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy} message EffectiveIamPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EffectiveIamPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EffectiveIamPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @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.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy} EffectiveIamPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EffectiveIamPolicy.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.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fullResourceName = reader.string(); + break; + case 2: + if (!(message.policies && message.policies.length)) + message.policies = []; + message.policies.push($root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EffectiveIamPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy} EffectiveIamPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EffectiveIamPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EffectiveIamPolicy message. + * @function verify + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EffectiveIamPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + if (!$util.isString(message.fullResourceName)) + return "fullResourceName: string expected"; + if (message.policies != null && message.hasOwnProperty("policies")) { + if (!Array.isArray(message.policies)) + return "policies: array expected"; + for (var i = 0; i < message.policies.length; ++i) { + var error = $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.verify(message.policies[i]); + if (error) + return "policies." + error; + } + } + return null; + }; + + /** + * Creates an EffectiveIamPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy} EffectiveIamPolicy + */ + EffectiveIamPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy) + return object; + var message = new $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy(); + if (object.fullResourceName != null) + message.fullResourceName = String(object.fullResourceName); + if (object.policies) { + if (!Array.isArray(object.policies)) + throw TypeError(".google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.policies: array expected"); + message.policies = []; + for (var i = 0; i < object.policies.length; ++i) { + if (typeof object.policies[i] !== "object") + throw TypeError(".google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.policies: object expected"); + message.policies[i] = $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.fromObject(object.policies[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EffectiveIamPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @static + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy} message EffectiveIamPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EffectiveIamPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.policies = []; + if (options.defaults) + object.fullResourceName = ""; + if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + object.fullResourceName = message.fullResourceName; + if (message.policies && message.policies.length) { + object.policies = []; + for (var j = 0; j < message.policies.length; ++j) + object.policies[j] = $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.toObject(message.policies[j], options); + } + return object; + }; + + /** + * Converts this EffectiveIamPolicy to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @instance + * @returns {Object.} JSON object + */ + EffectiveIamPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + EffectiveIamPolicy.PolicyInfo = (function() { + + /** + * Properties of a PolicyInfo. + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @interface IPolicyInfo + * @property {string|null} [attachedResource] PolicyInfo attachedResource + * @property {google.iam.v1.IPolicy|null} [policy] PolicyInfo policy + */ + + /** + * Constructs a new PolicyInfo. + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @classdesc Represents a PolicyInfo. + * @implements IPolicyInfo + * @constructor + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo=} [properties] Properties to set + */ + function PolicyInfo(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]]; + } + + /** + * PolicyInfo attachedResource. + * @member {string} attachedResource + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo + * @instance + */ + PolicyInfo.prototype.attachedResource = ""; + + /** + * PolicyInfo policy. + * @member {google.iam.v1.IPolicy|null|undefined} policy + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo + * @instance + */ + PolicyInfo.prototype.policy = null; + + /** + * Creates a new PolicyInfo instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo + * @static + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo=} [properties] Properties to set + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo} PolicyInfo instance + */ + PolicyInfo.create = function create(properties) { + return new PolicyInfo(properties); + }; + + /** + * Encodes the specified PolicyInfo message. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo + * @static + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo} message PolicyInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attachedResource != null && Object.hasOwnProperty.call(message, "attachedResource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.attachedResource); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PolicyInfo message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo + * @static + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo} message PolicyInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PolicyInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo + * @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.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo} PolicyInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyInfo.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.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.attachedResource = reader.string(); + break; + case 2: + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PolicyInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo} PolicyInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PolicyInfo message. + * @function verify + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolicyInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attachedResource != null && message.hasOwnProperty("attachedResource")) + if (!$util.isString(message.attachedResource)) + return "attachedResource: string expected"; + if (message.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.iam.v1.Policy.verify(message.policy); + if (error) + return "policy." + error; + } + return null; + }; + + /** + * Creates a PolicyInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo} PolicyInfo + */ + PolicyInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo) + return object; + var message = new $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo(); + if (object.attachedResource != null) + message.attachedResource = String(object.attachedResource); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.policy: object expected"); + message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); + } + return message; + }; + + /** + * Creates a plain object from a PolicyInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo + * @static + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo} message PolicyInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PolicyInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.attachedResource = ""; + object.policy = null; + } + if (message.attachedResource != null && message.hasOwnProperty("attachedResource")) + object.attachedResource = message.attachedResource; + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); + return object; + }; + + /** + * Converts this PolicyInfo to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo + * @instance + * @returns {Object.} JSON object + */ + PolicyInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PolicyInfo; + })(); + + return EffectiveIamPolicy; + })(); + + return BatchGetEffectiveIamPoliciesResponse; })(); v1.TemporalAsset = (function() { @@ -12225,6 +15267,7 @@ * @property {google.identity.accesscontextmanager.v1.IServicePerimeter|null} [servicePerimeter] Asset servicePerimeter * @property {google.cloud.osconfig.v1.IInventory|null} [osInventory] Asset osInventory * @property {google.cloud.asset.v1.IRelatedAssets|null} [relatedAssets] Asset relatedAssets + * @property {google.cloud.asset.v1.IRelatedAsset|null} [relatedAsset] Asset relatedAsset * @property {Array.|null} [ancestors] Asset ancestors */ @@ -12333,6 +15376,14 @@ */ Asset.prototype.relatedAssets = null; + /** + * Asset relatedAsset. + * @member {google.cloud.asset.v1.IRelatedAsset|null|undefined} relatedAsset + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.relatedAsset = null; + /** * Asset ancestors. * @member {Array.} ancestors @@ -12405,6 +15456,8 @@ $root.google.cloud.osconfig.v1.Inventory.encode(message.osInventory, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); if (message.relatedAssets != null && Object.hasOwnProperty.call(message, "relatedAssets")) $root.google.cloud.asset.v1.RelatedAssets.encode(message.relatedAssets, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.relatedAsset != null && Object.hasOwnProperty.call(message, "relatedAsset")) + $root.google.cloud.asset.v1.RelatedAsset.encode(message.relatedAsset, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); return writer; }; @@ -12474,6 +15527,9 @@ case 13: message.relatedAssets = $root.google.cloud.asset.v1.RelatedAssets.decode(reader, reader.uint32()); break; + case 15: + message.relatedAsset = $root.google.cloud.asset.v1.RelatedAsset.decode(reader, reader.uint32()); + break; case 10: if (!(message.ancestors && message.ancestors.length)) message.ancestors = []; @@ -12583,6 +15639,11 @@ if (error) return "relatedAssets." + error; } + if (message.relatedAsset != null && message.hasOwnProperty("relatedAsset")) { + var error = $root.google.cloud.asset.v1.RelatedAsset.verify(message.relatedAsset); + if (error) + return "relatedAsset." + error; + } if (message.ancestors != null && message.hasOwnProperty("ancestors")) { if (!Array.isArray(message.ancestors)) return "ancestors: array expected"; @@ -12659,6 +15720,11 @@ throw TypeError(".google.cloud.asset.v1.Asset.relatedAssets: object expected"); message.relatedAssets = $root.google.cloud.asset.v1.RelatedAssets.fromObject(object.relatedAssets); } + if (object.relatedAsset != null) { + if (typeof object.relatedAsset !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.relatedAsset: object expected"); + message.relatedAsset = $root.google.cloud.asset.v1.RelatedAsset.fromObject(object.relatedAsset); + } if (object.ancestors) { if (!Array.isArray(object.ancestors)) throw TypeError(".google.cloud.asset.v1.Asset.ancestors: array expected"); @@ -12694,6 +15760,7 @@ object.updateTime = null; object.osInventory = null; object.relatedAssets = null; + object.relatedAsset = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -12734,6 +15801,8 @@ object.osInventory = $root.google.cloud.osconfig.v1.Inventory.toObject(message.osInventory, options); if (message.relatedAssets != null && message.hasOwnProperty("relatedAssets")) object.relatedAssets = $root.google.cloud.asset.v1.RelatedAssets.toObject(message.relatedAssets, options); + if (message.relatedAsset != null && message.hasOwnProperty("relatedAsset")) + object.relatedAsset = $root.google.cloud.asset.v1.RelatedAsset.toObject(message.relatedAsset, options); return object; }; @@ -13575,6 +16644,7 @@ * @property {string|null} [asset] RelatedAsset asset * @property {string|null} [assetType] RelatedAsset assetType * @property {Array.|null} [ancestors] RelatedAsset ancestors + * @property {string|null} [relationshipType] RelatedAsset relationshipType */ /** @@ -13617,6 +16687,14 @@ */ RelatedAsset.prototype.ancestors = $util.emptyArray; + /** + * RelatedAsset relationshipType. + * @member {string} relationshipType + * @memberof google.cloud.asset.v1.RelatedAsset + * @instance + */ + RelatedAsset.prototype.relationshipType = ""; + /** * Creates a new RelatedAsset instance using the specified properties. * @function create @@ -13648,6 +16726,8 @@ if (message.ancestors != null && message.ancestors.length) for (var i = 0; i < message.ancestors.length; ++i) writer.uint32(/* id 3, wireType 2 =*/26).string(message.ancestors[i]); + if (message.relationshipType != null && Object.hasOwnProperty.call(message, "relationshipType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.relationshipType); return writer; }; @@ -13693,6 +16773,9 @@ message.ancestors = []; message.ancestors.push(reader.string()); break; + case 4: + message.relationshipType = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -13741,6 +16824,9 @@ if (!$util.isString(message.ancestors[i])) return "ancestors: string[] expected"; } + if (message.relationshipType != null && message.hasOwnProperty("relationshipType")) + if (!$util.isString(message.relationshipType)) + return "relationshipType: string expected"; return null; }; @@ -13767,6 +16853,8 @@ for (var i = 0; i < object.ancestors.length; ++i) message.ancestors[i] = String(object.ancestors[i]); } + if (object.relationshipType != null) + message.relationshipType = String(object.relationshipType); return message; }; @@ -13788,6 +16876,7 @@ if (options.defaults) { object.asset = ""; object.assetType = ""; + object.relationshipType = ""; } if (message.asset != null && message.hasOwnProperty("asset")) object.asset = message.asset; @@ -13798,6 +16887,8 @@ for (var j = 0; j < message.ancestors.length; ++j) object.ancestors[j] = message.ancestors[j]; } + if (message.relationshipType != null && message.hasOwnProperty("relationshipType")) + object.relationshipType = message.relationshipType; return object; }; @@ -13840,6 +16931,9 @@ * @property {Array.|null} [versionedResources] ResourceSearchResult versionedResources * @property {Array.|null} [attachedResources] ResourceSearchResult attachedResources * @property {Object.|null} [relationships] ResourceSearchResult relationships + * @property {Array.|null} [tagKeys] ResourceSearchResult tagKeys + * @property {Array.|null} [tagValues] ResourceSearchResult tagValues + * @property {Array.|null} [tagValueIds] ResourceSearchResult tagValueIds * @property {string|null} [parentAssetType] ResourceSearchResult parentAssetType */ @@ -13858,6 +16952,9 @@ this.versionedResources = []; this.attachedResources = []; this.relationships = {}; + this.tagKeys = []; + this.tagValues = []; + this.tagValueIds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14016,6 +17113,30 @@ */ ResourceSearchResult.prototype.relationships = $util.emptyObject; + /** + * ResourceSearchResult tagKeys. + * @member {Array.} tagKeys + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.tagKeys = $util.emptyArray; + + /** + * ResourceSearchResult tagValues. + * @member {Array.} tagValues + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.tagValues = $util.emptyArray; + + /** + * ResourceSearchResult tagValueIds. + * @member {Array.} tagValueIds + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.tagValueIds = $util.emptyArray; + /** * ResourceSearchResult parentAssetType. * @member {string} parentAssetType @@ -14094,6 +17215,15 @@ writer.uint32(/* id 21, wireType 2 =*/170).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); $root.google.cloud.asset.v1.RelatedResources.encode(message.relationships[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } + if (message.tagKeys != null && message.tagKeys.length) + for (var i = 0; i < message.tagKeys.length; ++i) + writer.uint32(/* id 23, wireType 2 =*/186).string(message.tagKeys[i]); + if (message.tagValues != null && message.tagValues.length) + for (var i = 0; i < message.tagValues.length; ++i) + writer.uint32(/* id 25, wireType 2 =*/202).string(message.tagValues[i]); + if (message.tagValueIds != null && message.tagValueIds.length) + for (var i = 0; i < message.tagValueIds.length; ++i) + writer.uint32(/* id 26, wireType 2 =*/210).string(message.tagValueIds[i]); if (message.parentAssetType != null && Object.hasOwnProperty.call(message, "parentAssetType")) writer.uint32(/* id 103, wireType 2 =*/826).string(message.parentAssetType); return writer; @@ -14233,6 +17363,21 @@ } message.relationships[key] = value; break; + case 23: + if (!(message.tagKeys && message.tagKeys.length)) + message.tagKeys = []; + message.tagKeys.push(reader.string()); + break; + case 25: + if (!(message.tagValues && message.tagValues.length)) + message.tagValues = []; + message.tagValues.push(reader.string()); + break; + case 26: + if (!(message.tagValueIds && message.tagValueIds.length)) + message.tagValueIds = []; + message.tagValueIds.push(reader.string()); + break; case 103: message.parentAssetType = reader.string(); break; @@ -14366,6 +17511,27 @@ return "relationships." + error; } } + if (message.tagKeys != null && message.hasOwnProperty("tagKeys")) { + if (!Array.isArray(message.tagKeys)) + return "tagKeys: array expected"; + for (var i = 0; i < message.tagKeys.length; ++i) + if (!$util.isString(message.tagKeys[i])) + return "tagKeys: string[] expected"; + } + if (message.tagValues != null && message.hasOwnProperty("tagValues")) { + if (!Array.isArray(message.tagValues)) + return "tagValues: array expected"; + for (var i = 0; i < message.tagValues.length; ++i) + if (!$util.isString(message.tagValues[i])) + return "tagValues: string[] expected"; + } + if (message.tagValueIds != null && message.hasOwnProperty("tagValueIds")) { + if (!Array.isArray(message.tagValueIds)) + return "tagValueIds: array expected"; + for (var i = 0; i < message.tagValueIds.length; ++i) + if (!$util.isString(message.tagValueIds[i])) + return "tagValueIds: string[] expected"; + } if (message.parentAssetType != null && message.hasOwnProperty("parentAssetType")) if (!$util.isString(message.parentAssetType)) return "parentAssetType: string expected"; @@ -14470,6 +17636,27 @@ message.relationships[keys[i]] = $root.google.cloud.asset.v1.RelatedResources.fromObject(object.relationships[keys[i]]); } } + if (object.tagKeys) { + if (!Array.isArray(object.tagKeys)) + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.tagKeys: array expected"); + message.tagKeys = []; + for (var i = 0; i < object.tagKeys.length; ++i) + message.tagKeys[i] = String(object.tagKeys[i]); + } + if (object.tagValues) { + if (!Array.isArray(object.tagValues)) + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.tagValues: array expected"); + message.tagValues = []; + for (var i = 0; i < object.tagValues.length; ++i) + message.tagValues[i] = String(object.tagValues[i]); + } + if (object.tagValueIds) { + if (!Array.isArray(object.tagValueIds)) + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.tagValueIds: array expected"); + message.tagValueIds = []; + for (var i = 0; i < object.tagValueIds.length; ++i) + message.tagValueIds[i] = String(object.tagValueIds[i]); + } if (object.parentAssetType != null) message.parentAssetType = String(object.parentAssetType); return message; @@ -14493,6 +17680,9 @@ object.versionedResources = []; object.folders = []; object.attachedResources = []; + object.tagKeys = []; + object.tagValues = []; + object.tagValueIds = []; } if (options.objects || options.defaults) { object.labels = {}; @@ -14571,6 +17761,21 @@ for (var j = 0; j < keys2.length; ++j) object.relationships[keys2[j]] = $root.google.cloud.asset.v1.RelatedResources.toObject(message.relationships[keys2[j]], options); } + if (message.tagKeys && message.tagKeys.length) { + object.tagKeys = []; + for (var j = 0; j < message.tagKeys.length; ++j) + object.tagKeys[j] = message.tagKeys[j]; + } + if (message.tagValues && message.tagValues.length) { + object.tagValues = []; + for (var j = 0; j < message.tagValues.length; ++j) + object.tagValues[j] = message.tagValues[j]; + } + if (message.tagValueIds && message.tagValueIds.length) { + object.tagValueIds = []; + for (var j = 0; j < message.tagValueIds.length; ++j) + object.tagValueIds[j] = message.tagValueIds[j]; + } if (message.parentAssetType != null && message.hasOwnProperty("parentAssetType")) object.parentAssetType = message.parentAssetType; return object; @@ -47054,225 +50259,6 @@ return Timestamp; })(); - protobuf.Any = (function() { - - /** - * Properties of an Any. - * @memberof google.protobuf - * @interface IAny - * @property {string|null} [type_url] Any type_url - * @property {Uint8Array|null} [value] Any value - */ - - /** - * Constructs a new Any. - * @memberof google.protobuf - * @classdesc Represents an Any. - * @implements IAny - * @constructor - * @param {google.protobuf.IAny=} [properties] Properties to set - */ - function Any(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]]; - } - - /** - * Any type_url. - * @member {string} type_url - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.type_url = ""; - - /** - * Any value. - * @member {Uint8Array} value - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.value = $util.newBuffer([]); - - /** - * Creates a new Any instance using the specified properties. - * @function create - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny=} [properties] Properties to set - * @returns {google.protobuf.Any} Any instance - */ - Any.create = function create(properties) { - return new Any(properties); - }; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); - return writer; - }; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Any message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.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.protobuf.Any(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type_url = reader.string(); - break; - case 2: - message.value = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Any message. - * @function verify - * @memberof google.protobuf.Any - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Any.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type_url != null && message.hasOwnProperty("type_url")) - if (!$util.isString(message.type_url)) - return "type_url: string expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - return null; - }; - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Any - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Any} Any - */ - Any.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Any) - return object; - var message = new $root.google.protobuf.Any(); - if (object.type_url != null) - message.type_url = String(object.type_url); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length) - message.value = object.value; - return message; - }; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.Any} message Any - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Any.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type_url = ""; - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - } - if (message.type_url != null && message.hasOwnProperty("type_url")) - object.type_url = message.type_url; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; - - /** - * Converts this Any to JSON. - * @function toJSON - * @memberof google.protobuf.Any - * @instance - * @returns {Object.} JSON object - */ - Any.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Any; - })(); - protobuf.Struct = (function() { /** @@ -48074,17 +51060,236 @@ }; /** - * Converts this ListValue to JSON. + * Converts this ListValue to JSON. + * @function toJSON + * @memberof google.protobuf.ListValue + * @instance + * @returns {Object.} JSON object + */ + ListValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListValue; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(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]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.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.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type_url = reader.string(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. * @function toJSON - * @memberof google.protobuf.ListValue + * @memberof google.protobuf.Any * @instance * @returns {Object.} JSON object */ - ListValue.prototype.toJSON = function toJSON() { + Any.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListValue; + return Any; })(); protobuf.Duration = (function() { @@ -48517,6 +51722,504 @@ return protobuf; })(); + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Date = (function() { + + /** + * Properties of a Date. + * @memberof google.type + * @interface IDate + * @property {number|null} [year] Date year + * @property {number|null} [month] Date month + * @property {number|null} [day] Date day + */ + + /** + * Constructs a new Date. + * @memberof google.type + * @classdesc Represents a Date. + * @implements IDate + * @constructor + * @param {google.type.IDate=} [properties] Properties to set + */ + function Date(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]]; + } + + /** + * Date year. + * @member {number} year + * @memberof google.type.Date + * @instance + */ + Date.prototype.year = 0; + + /** + * Date month. + * @member {number} month + * @memberof google.type.Date + * @instance + */ + Date.prototype.month = 0; + + /** + * Date day. + * @member {number} day + * @memberof google.type.Date + * @instance + */ + Date.prototype.day = 0; + + /** + * Creates a new Date instance using the specified properties. + * @function create + * @memberof google.type.Date + * @static + * @param {google.type.IDate=} [properties] Properties to set + * @returns {google.type.Date} Date instance + */ + Date.create = function create(properties) { + return new Date(properties); + }; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @function encode + * @memberof google.type.Date + * @static + * @param {google.type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.year != null && Object.hasOwnProperty.call(message, "year")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.year); + if (message.month != null && Object.hasOwnProperty.call(message, "month")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.month); + if (message.day != null && Object.hasOwnProperty.call(message, "day")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.day); + return writer; + }; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Date + * @static + * @param {google.type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Date message from the specified reader or buffer. + * @function decode + * @memberof google.type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.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.type.Date(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.year = reader.int32(); + break; + case 2: + message.month = reader.int32(); + break; + case 3: + message.day = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Date message. + * @function verify + * @memberof google.type.Date + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Date.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.year != null && message.hasOwnProperty("year")) + if (!$util.isInteger(message.year)) + return "year: integer expected"; + if (message.month != null && message.hasOwnProperty("month")) + if (!$util.isInteger(message.month)) + return "month: integer expected"; + if (message.day != null && message.hasOwnProperty("day")) + if (!$util.isInteger(message.day)) + return "day: integer expected"; + return null; + }; + + /** + * Creates a Date message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Date + * @static + * @param {Object.} object Plain object + * @returns {google.type.Date} Date + */ + Date.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Date) + return object; + var message = new $root.google.type.Date(); + if (object.year != null) + message.year = object.year | 0; + if (object.month != null) + message.month = object.month | 0; + if (object.day != null) + message.day = object.day | 0; + return message; + }; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Date + * @static + * @param {google.type.Date} message Date + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Date.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.year = 0; + object.month = 0; + object.day = 0; + } + if (message.year != null && message.hasOwnProperty("year")) + object.year = message.year; + if (message.month != null && message.hasOwnProperty("month")) + object.month = message.month; + if (message.day != null && message.hasOwnProperty("day")) + object.day = message.day; + return object; + }; + + /** + * Converts this Date to JSON. + * @function toJSON + * @memberof google.type.Date + * @instance + * @returns {Object.} JSON object + */ + Date.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Date; + })(); + + type.Expr = (function() { + + /** + * Properties of an Expr. + * @memberof google.type + * @interface IExpr + * @property {string|null} [expression] Expr expression + * @property {string|null} [title] Expr title + * @property {string|null} [description] Expr description + * @property {string|null} [location] Expr location + */ + + /** + * Constructs a new Expr. + * @memberof google.type + * @classdesc Represents an Expr. + * @implements IExpr + * @constructor + * @param {google.type.IExpr=} [properties] Properties to set + */ + function Expr(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]]; + } + + /** + * Expr expression. + * @member {string} expression + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.expression = ""; + + /** + * Expr title. + * @member {string} title + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.title = ""; + + /** + * Expr description. + * @member {string} description + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.description = ""; + + /** + * Expr location. + * @member {string} location + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.location = ""; + + /** + * Creates a new Expr instance using the specified properties. + * @function create + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr=} [properties] Properties to set + * @returns {google.type.Expr} Expr instance + */ + Expr.create = function create(properties) { + return new Expr(properties); + }; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encode + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); + return writer; + }; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @function decode + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.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.type.Expr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.expression = reader.string(); + break; + case 2: + message.title = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.location = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Expr message. + * @function verify + * @memberof google.type.Expr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Expr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expression != null && message.hasOwnProperty("expression")) + if (!$util.isString(message.expression)) + return "expression: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Expr + * @static + * @param {Object.} object Plain object + * @returns {google.type.Expr} Expr + */ + Expr.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Expr) + return object; + var message = new $root.google.type.Expr(); + if (object.expression != null) + message.expression = String(object.expression); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Expr + * @static + * @param {google.type.Expr} message Expr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Expr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expression = ""; + object.title = ""; + object.description = ""; + object.location = ""; + } + if (message.expression != null && message.hasOwnProperty("expression")) + object.expression = message.expression; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this Expr to JSON. + * @function toJSON + * @memberof google.type.Expr + * @instance + * @returns {Object.} JSON object + */ + Expr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Expr; + })(); + + return type; + })(); + google.iam = (function() { /** @@ -49891,504 +53594,6 @@ return iam; })(); - google.type = (function() { - - /** - * Namespace type. - * @memberof google - * @namespace - */ - var type = {}; - - type.Expr = (function() { - - /** - * Properties of an Expr. - * @memberof google.type - * @interface IExpr - * @property {string|null} [expression] Expr expression - * @property {string|null} [title] Expr title - * @property {string|null} [description] Expr description - * @property {string|null} [location] Expr location - */ - - /** - * Constructs a new Expr. - * @memberof google.type - * @classdesc Represents an Expr. - * @implements IExpr - * @constructor - * @param {google.type.IExpr=} [properties] Properties to set - */ - function Expr(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]]; - } - - /** - * Expr expression. - * @member {string} expression - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.expression = ""; - - /** - * Expr title. - * @member {string} title - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.title = ""; - - /** - * Expr description. - * @member {string} description - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.description = ""; - - /** - * Expr location. - * @member {string} location - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.location = ""; - - /** - * Creates a new Expr instance using the specified properties. - * @function create - * @memberof google.type.Expr - * @static - * @param {google.type.IExpr=} [properties] Properties to set - * @returns {google.type.Expr} Expr instance - */ - Expr.create = function create(properties) { - return new Expr(properties); - }; - - /** - * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @function encode - * @memberof google.type.Expr - * @static - * @param {google.type.IExpr} message Expr message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Expr.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); - return writer; - }; - - /** - * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @function encodeDelimited - * @memberof google.type.Expr - * @static - * @param {google.type.IExpr} message Expr message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Expr.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Expr message from the specified reader or buffer. - * @function decode - * @memberof google.type.Expr - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.type.Expr} Expr - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Expr.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.type.Expr(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.expression = reader.string(); - break; - case 2: - message.title = reader.string(); - break; - case 3: - message.description = reader.string(); - break; - case 4: - message.location = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Expr message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.type.Expr - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.type.Expr} Expr - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Expr.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Expr message. - * @function verify - * @memberof google.type.Expr - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Expr.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.expression != null && message.hasOwnProperty("expression")) - if (!$util.isString(message.expression)) - return "expression: string expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; - return null; - }; - - /** - * Creates an Expr message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.type.Expr - * @static - * @param {Object.} object Plain object - * @returns {google.type.Expr} Expr - */ - Expr.fromObject = function fromObject(object) { - if (object instanceof $root.google.type.Expr) - return object; - var message = new $root.google.type.Expr(); - if (object.expression != null) - message.expression = String(object.expression); - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); - if (object.location != null) - message.location = String(object.location); - return message; - }; - - /** - * Creates a plain object from an Expr message. Also converts values to other types if specified. - * @function toObject - * @memberof google.type.Expr - * @static - * @param {google.type.Expr} message Expr - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Expr.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.expression = ""; - object.title = ""; - object.description = ""; - object.location = ""; - } - if (message.expression != null && message.hasOwnProperty("expression")) - object.expression = message.expression; - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - return object; - }; - - /** - * Converts this Expr to JSON. - * @function toJSON - * @memberof google.type.Expr - * @instance - * @returns {Object.} JSON object - */ - Expr.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Expr; - })(); - - type.Date = (function() { - - /** - * Properties of a Date. - * @memberof google.type - * @interface IDate - * @property {number|null} [year] Date year - * @property {number|null} [month] Date month - * @property {number|null} [day] Date day - */ - - /** - * Constructs a new Date. - * @memberof google.type - * @classdesc Represents a Date. - * @implements IDate - * @constructor - * @param {google.type.IDate=} [properties] Properties to set - */ - function Date(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]]; - } - - /** - * Date year. - * @member {number} year - * @memberof google.type.Date - * @instance - */ - Date.prototype.year = 0; - - /** - * Date month. - * @member {number} month - * @memberof google.type.Date - * @instance - */ - Date.prototype.month = 0; - - /** - * Date day. - * @member {number} day - * @memberof google.type.Date - * @instance - */ - Date.prototype.day = 0; - - /** - * Creates a new Date instance using the specified properties. - * @function create - * @memberof google.type.Date - * @static - * @param {google.type.IDate=} [properties] Properties to set - * @returns {google.type.Date} Date instance - */ - Date.create = function create(properties) { - return new Date(properties); - }; - - /** - * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. - * @function encode - * @memberof google.type.Date - * @static - * @param {google.type.IDate} message Date message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Date.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.year != null && Object.hasOwnProperty.call(message, "year")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.year); - if (message.month != null && Object.hasOwnProperty.call(message, "month")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.month); - if (message.day != null && Object.hasOwnProperty.call(message, "day")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.day); - return writer; - }; - - /** - * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. - * @function encodeDelimited - * @memberof google.type.Date - * @static - * @param {google.type.IDate} message Date message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Date.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Date message from the specified reader or buffer. - * @function decode - * @memberof google.type.Date - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.type.Date} Date - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Date.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.type.Date(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.year = reader.int32(); - break; - case 2: - message.month = reader.int32(); - break; - case 3: - message.day = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Date message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.type.Date - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.type.Date} Date - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Date.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Date message. - * @function verify - * @memberof google.type.Date - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Date.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.year != null && message.hasOwnProperty("year")) - if (!$util.isInteger(message.year)) - return "year: integer expected"; - if (message.month != null && message.hasOwnProperty("month")) - if (!$util.isInteger(message.month)) - return "month: integer expected"; - if (message.day != null && message.hasOwnProperty("day")) - if (!$util.isInteger(message.day)) - return "day: integer expected"; - return null; - }; - - /** - * Creates a Date message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.type.Date - * @static - * @param {Object.} object Plain object - * @returns {google.type.Date} Date - */ - Date.fromObject = function fromObject(object) { - if (object instanceof $root.google.type.Date) - return object; - var message = new $root.google.type.Date(); - if (object.year != null) - message.year = object.year | 0; - if (object.month != null) - message.month = object.month | 0; - if (object.day != null) - message.day = object.day | 0; - return message; - }; - - /** - * Creates a plain object from a Date message. Also converts values to other types if specified. - * @function toObject - * @memberof google.type.Date - * @static - * @param {google.type.Date} message Date - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Date.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.year = 0; - object.month = 0; - object.day = 0; - } - if (message.year != null && message.hasOwnProperty("year")) - object.year = message.year; - if (message.month != null && message.hasOwnProperty("month")) - object.month = message.month; - if (message.day != null && message.hasOwnProperty("day")) - object.day = message.day; - return object; - }; - - /** - * Converts this Date to JSON. - * @function toJSON - * @memberof google.type.Date - * @instance - * @returns {Object.} JSON object - */ - Date.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Date; - })(); - - return type; - })(); - google.identity = (function() { /** diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index 7fafb533d28..acc1f37e931 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -260,6 +260,114 @@ } } ] + }, + "CreateSavedQuery": { + "requestType": "CreateSavedQueryRequest", + "responseType": "SavedQuery", + "options": { + "(google.api.http).post": "/v1/{parent=*/*}/savedQueries", + "(google.api.http).body": "saved_query", + "(google.api.method_signature)": "parent,saved_query,saved_query_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=*/*}/savedQueries", + "body": "saved_query" + } + }, + { + "(google.api.method_signature)": "parent,saved_query,saved_query_id" + } + ] + }, + "GetSavedQuery": { + "requestType": "GetSavedQueryRequest", + "responseType": "SavedQuery", + "options": { + "(google.api.http).get": "/v1/{name=*/*/savedQueries/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=*/*/savedQueries/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListSavedQueries": { + "requestType": "ListSavedQueriesRequest", + "responseType": "ListSavedQueriesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=*/*}/savedQueries", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=*/*}/savedQueries" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateSavedQuery": { + "requestType": "UpdateSavedQueryRequest", + "responseType": "SavedQuery", + "options": { + "(google.api.http).patch": "/v1/{saved_query.name=*/*/savedQueries/*}", + "(google.api.http).body": "saved_query", + "(google.api.method_signature)": "saved_query,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{saved_query.name=*/*/savedQueries/*}", + "body": "saved_query" + } + }, + { + "(google.api.method_signature)": "saved_query,update_mask" + } + ] + }, + "DeleteSavedQuery": { + "requestType": "DeleteSavedQueryRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=*/*/savedQueries/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=*/*/savedQueries/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "BatchGetEffectiveIamPolicies": { + "requestType": "BatchGetEffectiveIamPoliciesRequest", + "responseType": "BatchGetEffectiveIamPoliciesResponse", + "options": { + "(google.api.http).get": "/v1/{scope=*/*}/effectiveIamPolicies:batchGet" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{scope=*/*}/effectiveIamPolicies:batchGet" + } + } + ] } } }, @@ -984,6 +1092,13 @@ "(google.api.field_behavior)": "REQUIRED" } }, + "savedAnalysisQuery": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, "executionTimeout": { "type": "google.protobuf.Duration", "id": 2, @@ -1113,6 +1228,13 @@ "(google.api.field_behavior)": "REQUIRED" } }, + "savedAnalysisQuery": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, "outputConfig": { "type": "IamPolicyAnalysisOutputConfig", "id": 2, @@ -1125,6 +1247,190 @@ "AnalyzeIamPolicyLongrunningResponse": { "fields": {} }, + "SavedQuery": { + "options": { + "(google.api.resource).type": "cloudasset.googleapis.com/SavedQuery", + "(google.api.resource).pattern": "organizations/{organization}/savedQueries/{saved_query}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "creator": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastUpdateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastUpdater": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 7 + }, + "content": { + "type": "QueryContent", + "id": 8 + } + }, + "nested": { + "QueryContent": { + "oneofs": { + "queryContent": { + "oneof": [ + "iamPolicyAnalysisQuery" + ] + } + }, + "fields": { + "iamPolicyAnalysisQuery": { + "type": "IamPolicyAnalysisQuery", + "id": 1 + } + } + } + } + }, + "CreateSavedQueryRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "cloudasset.googleapis.com/SavedQuery" + } + }, + "savedQuery": { + "type": "SavedQuery", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "savedQueryId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetSavedQueryRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudasset.googleapis.com/SavedQuery" + } + } + } + }, + "ListSavedQueriesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "cloudasset.googleapis.com/SavedQuery" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListSavedQueriesResponse": { + "fields": { + "savedQueries": { + "rule": "repeated", + "type": "SavedQuery", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "UpdateSavedQueryRequest": { + "fields": { + "savedQuery": { + "type": "SavedQuery", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteSavedQueryRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudasset.googleapis.com/SavedQuery" + } + } + } + }, "AnalyzeMoveRequest": { "fields": { "resource": { @@ -1222,6 +1528,65 @@ "RELATIONSHIP": 7 } }, + "BatchGetEffectiveIamPoliciesRequest": { + "fields": { + "scope": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "*" + } + }, + "names": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + } + } + }, + "BatchGetEffectiveIamPoliciesResponse": { + "fields": { + "policyResults": { + "rule": "repeated", + "type": "EffectiveIamPolicy", + "id": 2 + } + }, + "nested": { + "EffectiveIamPolicy": { + "fields": { + "fullResourceName": { + "type": "string", + "id": 1 + }, + "policies": { + "rule": "repeated", + "type": "PolicyInfo", + "id": 2 + } + }, + "nested": { + "PolicyInfo": { + "fields": { + "attachedResource": { + "type": "string", + "id": 1 + }, + "policy": { + "type": "google.iam.v1.Policy", + "id": 2 + } + } + } + } + } + } + }, "TemporalAsset": { "fields": { "window": { @@ -1327,7 +1692,14 @@ }, "relatedAssets": { "type": "RelatedAssets", - "id": 13 + "id": 13, + "options": { + "deprecated": true + } + }, + "relatedAsset": { + "type": "RelatedAsset", + "id": 15 }, "ancestors": { "rule": "repeated", @@ -1369,6 +1741,9 @@ } }, "RelatedAssets": { + "options": { + "deprecated": true + }, "fields": { "relationshipAttributes": { "type": "RelationshipAttributes", @@ -1382,6 +1757,9 @@ } }, "RelationshipAttributes": { + "options": { + "deprecated": true + }, "fields": { "type": { "type": "string", @@ -1418,6 +1796,10 @@ "rule": "repeated", "type": "string", "id": 3 + }, + "relationshipType": { + "type": "string", + "id": 4 } } }, @@ -1505,6 +1887,21 @@ "type": "RelatedResources", "id": 21 }, + "tagKeys": { + "rule": "repeated", + "type": "string", + "id": 23 + }, + "tagValues": { + "rule": "repeated", + "type": "string", + "id": 25 + }, + "tagValueIds": { + "rule": "repeated", + "type": "string", + "id": 26 + }, "parentAssetType": { "type": "string", "id": 103 @@ -4698,18 +5095,6 @@ } } }, - "Any": { - "fields": { - "type_url": { - "type": "string", - "id": 1 - }, - "value": { - "type": "bytes", - "id": 2 - } - } - }, "Struct": { "fields": { "fields": { @@ -4773,6 +5158,18 @@ } } }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, "Duration": { "fields": { "seconds": { @@ -4796,6 +5193,54 @@ } } }, + "type": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/type/expr;expr", + "java_multiple_files": true, + "java_outer_classname": "ExprProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "Date": { + "fields": { + "year": { + "type": "int32", + "id": 1 + }, + "month": { + "type": "int32", + "id": 2 + }, + "day": { + "type": "int32", + "id": 3 + } + } + }, + "Expr": { + "fields": { + "expression": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "location": { + "type": "string", + "id": 4 + } + } + } + } + }, "iam": { "nested": { "v1": { @@ -4919,54 +5364,6 @@ } } }, - "type": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/type/date;date", - "java_multiple_files": true, - "java_outer_classname": "DateProto", - "java_package": "com.google.type", - "objc_class_prefix": "GTP", - "cc_enable_arenas": true - }, - "nested": { - "Expr": { - "fields": { - "expression": { - "type": "string", - "id": 1 - }, - "title": { - "type": "string", - "id": 2 - }, - "description": { - "type": "string", - "id": 3 - }, - "location": { - "type": "string", - "id": 4 - } - } - }, - "Date": { - "fields": { - "year": { - "type": "int32", - "id": 1 - }, - "month": { - "type": "int32", - "id": 2 - }, - "day": { - "type": "int32", - "id": 3 - } - } - } - } - }, "identity": { "nested": { "accesscontextmanager": { diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy.js index 38fcd423fb0..e385da62df9 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy.js @@ -30,7 +30,24 @@ function main(analysisQuery) { */ // const analysisQuery = {} /** - * Optional. Amount of time executable has to complete. See JSON representation of + * Optional. The name of a saved query, which must be in the format of: + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * If both `analysis_query` and `saved_analysis_query` are provided, they + * will be merged together with the `saved_analysis_query` as base and + * the `analysis_query` as overrides. For more details of the merge behavior, + * please refer to the + * MergeFrom (https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details) + * page. + * Note that you cannot override primitive fields with default value, such as + * 0 or empty string, etc., because we use proto3, which doesn't support field + * presence yet. + */ + // const savedAnalysisQuery = 'abc123' + /** + * Optional. Amount of time executable has to complete. See JSON + * representation of * Duration (https://developers.google.com/protocol-buffers/docs/proto3#json). * If this field is set with a value less than the RPC deadline, and the * execution of your query hasn't finished in the specified diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js index abb0aa3fdee..fbba9d86a41 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js @@ -30,7 +30,24 @@ function main(analysisQuery, outputConfig) { */ // const analysisQuery = {} /** - * Required. Output configuration indicating where the results will be output to. + * Optional. The name of a saved query, which must be in the format of: + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * If both `analysis_query` and `saved_analysis_query` are provided, they + * will be merged together with the `saved_analysis_query` as base and + * the `analysis_query` as overrides. For more details of the merge behavior, + * please refer to the + * MergeFrom (https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details) + * doc. + * Note that you cannot override primitive fields with default value, such as + * 0 or empty string, etc., because we use proto3, which doesn't support field + * presence yet. + */ + // const savedAnalysisQuery = 'abc123' + /** + * Required. Output configuration indicating where the results will be output + * to. */ // const outputConfig = {} diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_effective_iam_policies.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_effective_iam_policies.js new file mode 100644 index 00000000000..033ae273f29 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_effective_iam_policies.js @@ -0,0 +1,74 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(scope, names) { + // [START cloudasset_v1_generated_AssetService_BatchGetEffectiveIamPolicies_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Only IAM policies on or below the scope will be returned. + * This can only be an organization number (such as "organizations/123"), a + * folder number (such as "folders/123"), a project ID (such as + * "projects/my-project-id"), or a project number (such as "projects/12345"). + * To know how to get organization id, visit here + * (https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). + * To know how to get folder or project id, visit here + * (https://cloud.google.com/resource-manager/docs/creating-managing-folders#viewing_or_listing_folders_and_projects). + */ + // const scope = 'abc123' + /** + * Required. The names refer to the full_resource_names + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) + * of searchable asset + * types (https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). + * A maximum of 20 resources' effective policies can be retrieved in a batch. + */ + // const names = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callBatchGetEffectiveIamPolicies() { + // Construct request + const request = { + scope, + names, + }; + + // Run request + const response = await assetClient.batchGetEffectiveIamPolicies(request); + console.log(response); + } + + callBatchGetEffectiveIamPolicies(); + // [END cloudasset_v1_generated_AssetService_BatchGetEffectiveIamPolicies_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.create_feed.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.create_feed.js index 20c0bf80b72..6d8067479e2 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.create_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.create_feed.js @@ -39,9 +39,8 @@ function main(parent, feedId, feed) { */ // const feedId = 'abc123' /** - * 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 */ diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.create_saved_query.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.create_saved_query.js new file mode 100644 index 00000000000..48130bd57d8 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.create_saved_query.js @@ -0,0 +1,79 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, savedQuery, savedQueryId) { + // [START cloudasset_v1_generated_AssetService_CreateSavedQuery_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the project/folder/organization where this + * saved_query should be created in. It can only be an organization number + * (such as "organizations/123"), a folder number (such as "folders/123"), a + * project ID (such as "projects/my-project-id")", or a project number (such + * as "projects/12345"). + */ + // const parent = 'abc123' + /** + * Required. The saved_query details. The `name` field must be empty as it + * will be generated based on the parent and saved_query_id. + */ + // const savedQuery = {} + /** + * Required. The ID to use for the saved query, which must be unique in the + * specified parent. It will become the final component of the saved query's + * resource name. + * This value should be 4-63 characters, and valid characters + * are /[a-z][0-9]-/. + * Notice that this field is required in the saved query creation, and the + * `name` field of the `saved_query` will be ignored. + */ + // const savedQueryId = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callCreateSavedQuery() { + // Construct request + const request = { + parent, + savedQuery, + savedQueryId, + }; + + // Run request + const response = await assetClient.createSavedQuery(request); + console.log(response); + } + + callCreateSavedQuery(); + // [END cloudasset_v1_generated_AssetService_CreateSavedQuery_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_saved_query.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_saved_query.js new file mode 100644 index 00000000000..0d1fb0c05cc --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_saved_query.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START cloudasset_v1_generated_AssetService_DeleteSavedQuery_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the saved query to delete. It must be in the format + * of: + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + */ + // const name = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callDeleteSavedQuery() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await assetClient.deleteSavedQuery(request); + console.log(response); + } + + callDeleteSavedQuery(); + // [END cloudasset_v1_generated_AssetService_DeleteSavedQuery_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.export_assets.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.export_assets.js index 97fc5e5f3ed..c9a2107938d 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.export_assets.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.export_assets.js @@ -63,7 +63,8 @@ function main(parent, outputConfig) { */ // const contentType = {} /** - * Required. Output configuration indicating where the results will be output to. + * Required. Output configuration indicating where the results will be output + * to. */ // const outputConfig = {} /** diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.get_saved_query.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.get_saved_query.js new file mode 100644 index 00000000000..c15cd1c395a --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.get_saved_query.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START cloudasset_v1_generated_AssetService_GetSavedQuery_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the saved query and it must be in the format of: + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + */ + // const name = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callGetSavedQuery() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await assetClient.getSavedQuery(request); + console.log(response); + } + + callGetSavedQuery(); + // [END cloudasset_v1_generated_AssetService_GetSavedQuery_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.list_assets.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_assets.js index 768cd0c6866..ae4c321b8d2 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.list_assets.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_assets.js @@ -26,10 +26,11 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. Name of the organization or project the assets belong to. Format: - * "organizations/[organization-number]" (such as "organizations/123"), - * "projects/[project-id]" (such as "projects/my-project-id"), or - * "projects/[project-number]" (such as "projects/12345"). + * Required. Name of the organization, folder, or project the assets belong + * to. Format: "organizations/[organization-number]" (such as + * "organizations/123"), "projects/[project-id]" (such as + * "projects/my-project-id"), "projects/[project-number]" (such as + * "projects/12345"), or "folders/[folder-number]" (such as "folders/12345"). */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.list_saved_queries.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_saved_queries.js new file mode 100644 index 00000000000..97b7a598922 --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_saved_queries.js @@ -0,0 +1,85 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START cloudasset_v1_generated_AssetService_ListSavedQueries_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent project/folder/organization whose savedQueries are to + * be listed. It can only be using project/folder/organization number (such as + * "folders/12345")", or a project ID (such as "projects/my-project-id"). + */ + // const parent = 'abc123' + /** + * Optional. The expression to filter resources. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. When `AND` and `OR` are both used in the + * expression, parentheses must be appropriately used to group the + * combinations. The expression may also contain regular expressions. + * See https://google.aip.dev/160 for more information on the grammar. + */ + // const filter = 'abc123' + /** + * Optional. The maximum number of saved queries to return per page. The + * service may return fewer than this value. If unspecified, at most 50 will + * be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListSavedQueries` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListSavedQueries` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callListSavedQueries() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await assetClient.listSavedQueriesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSavedQueries(); + // [END cloudasset_v1_generated_AssetService_ListSavedQueries_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.js index b0cd4dcc6b6..110dd00f85c 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.js @@ -26,9 +26,9 @@ function main(scope) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * 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 + * 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` (https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) * permission on the desired scope. * The allowed values are: @@ -43,7 +43,7 @@ function main(scope) { * 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`. Note that the query string is - * compared against each Cloud IAM policy binding, including its members, + * compared against each Cloud IAM policy binding, including its principals, * 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 @@ -77,27 +77,29 @@ function main(scope) { * "instance2" and also specify user "amy". * * `roles:roles/compute.admin` to find IAM policy bindings that specify the * Compute Admin role. - * * `memberTypes:user` to find IAM policy bindings that contain the "user" - * member type. + * * `memberTypes:user` to find IAM policy bindings that contain the + * principal type "user". */ // const query = 'abc123' /** - * 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. */ // const pageSize = 1234 /** - * 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. */ // const pageToken = 'abc123' /** - * Optional. A list of asset types that the IAM policies are attached to. If empty, it - * will search the IAM policies that are attached to all the searchable asset + * Optional. A list of asset types that the IAM policies are attached to. If + * empty, it will search the IAM policies that are attached to all the + * searchable asset * types (https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). * Regular expressions are also supported. For example: * * "compute.googleapis.com.*" snapshots IAM policies attached to asset type @@ -112,9 +114,9 @@ function main(scope) { */ // const assetTypes = 'abc123' /** - * 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. + * 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: "assetType DESC, resource". * Only singular primitive fields in the response are sortable: * * resource diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_resources.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_resources.js index 20fe964d82f..8c22917886c 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_resources.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_resources.js @@ -26,8 +26,9 @@ function main(scope) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * 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 + * 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` (https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) * permission on the desired scope. * The allowed values are: @@ -79,8 +80,8 @@ function main(scope) { */ // const query = 'abc123' /** - * 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). * Regular expressions are also supported. For example: * * "compute.googleapis.com.*" snapshots resources whose asset type starts @@ -93,23 +94,24 @@ function main(scope) { */ // const assetTypes = 'abc123' /** - * 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. */ // const pageSize = 1234 /** - * 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. */ // const pageToken = 'abc123' /** - * 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. + * 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 singular primitive fields in the response are sortable: * * name @@ -130,10 +132,10 @@ function main(scope) { */ // const orderBy = 'abc123' /** - * Optional. A comma-separated list of fields specifying which fields to be returned in - * ResourceSearchResult. Only '*' or combination of top level fields can be - * specified. Field names of both snake_case and camelCase are supported. - * Examples: `"*"`, `"name,location"`, `"name,versionedResources"`. + * Optional. A comma-separated list of fields specifying which fields to be + * returned in ResourceSearchResult. Only '*' or combination of top level + * fields can be specified. Field names of both snake_case and camelCase are + * supported. Examples: `"*"`, `"name,location"`, `"name,versionedResources"`. * The read_mask paths must be valid field paths listed but not limited to * (both snake_case and camelCase are supported): * * name @@ -142,6 +144,9 @@ function main(scope) { * * displayName * * description * * location + * * tagKeys + * * tagValues + * * tagValueIds * * labels * * networkTags * * kmsKey diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.update_feed.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.update_feed.js index 2b51e15f699..2cbdd3610cc 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.update_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.update_feed.js @@ -26,8 +26,8 @@ function main(feed, updateMask) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * 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. diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.update_saved_query.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.update_saved_query.js new file mode 100644 index 00000000000..c9c77ca777c --- /dev/null +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.update_saved_query.js @@ -0,0 +1,68 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(savedQuery, updateMask) { + // [START cloudasset_v1_generated_AssetService_UpdateSavedQuery_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The saved query to update. + * The saved query's `name` field is used to identify the one to update, + * which has format as below: + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + */ + // const savedQuery = {} + /** + * Required. The list of fields to update. + */ + // const updateMask = {} + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callUpdateSavedQuery() { + // Construct request + const request = { + savedQuery, + updateMask, + }; + + // Run request + const response = await assetClient.updateSavedQuery(request); + console.log(response); + } + + callUpdateSavedQuery(); + // [END cloudasset_v1_generated_AssetService_UpdateSavedQuery_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json b/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json index ad5e39dd0f4..9b186674bfb 100644 --- a/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json +++ b/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json @@ -15,14 +15,14 @@ "regionTag": "cloudasset_v1_generated_AssetService_ExportAssets_async", "title": "AssetService exportAssets Sample", "origin": "API_DEFINITION", - "description": " 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.", + "description": " 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 Protobuf 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.", "canonical": true, "file": "asset_service.export_assets.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 107, + "end": 108, "type": "FULL" } ], @@ -82,7 +82,7 @@ "segments": [ { "start": 25, - "end": 114, + "end": 115, "type": "FULL" } ], @@ -202,7 +202,7 @@ "segments": [ { "start": 25, - "end": 69, + "end": 68, "type": "FULL" } ], @@ -414,7 +414,7 @@ "segments": [ { "start": 25, - "end": 180, + "end": 185, "type": "FULL" } ], @@ -478,7 +478,7 @@ "segments": [ { "start": 25, - "end": 147, + "end": 149, "type": "FULL" } ], @@ -538,7 +538,7 @@ "segments": [ { "start": 25, - "end": 61, + "end": 78, "type": "FULL" } ], @@ -551,6 +551,10 @@ "name": "analysis_query", "type": ".google.cloud.asset.v1.IamPolicyAnalysisQuery" }, + { + "name": "saved_analysis_query", + "type": "TYPE_STRING" + }, { "name": "execution_timeout", "type": ".google.protobuf.Duration" @@ -582,7 +586,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 73, "type": "FULL" } ], @@ -595,6 +599,10 @@ "name": "analysis_query", "type": ".google.cloud.asset.v1.IamPolicyAnalysisQuery" }, + { + "name": "saved_analysis_query", + "type": "TYPE_STRING" + }, { "name": "output_config", "type": ".google.cloud.asset.v1.IamPolicyAnalysisOutputConfig" @@ -662,6 +670,274 @@ } } } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_CreateSavedQuery_async", + "title": "AssetService createSavedQuery Sample", + "origin": "API_DEFINITION", + "description": " Creates a saved query in a parent project/folder/organization.", + "canonical": true, + "file": "asset_service.create_saved_query.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSavedQuery", + "fullName": "google.cloud.asset.v1.AssetService.CreateSavedQuery", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "saved_query", + "type": ".google.cloud.asset.v1.SavedQuery" + }, + { + "name": "saved_query_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.asset.v1.SavedQuery", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "CreateSavedQuery", + "fullName": "google.cloud.asset.v1.AssetService.CreateSavedQuery", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_GetSavedQuery_async", + "title": "AssetService getSavedQuery Sample", + "origin": "API_DEFINITION", + "description": " Gets details about a saved query.", + "canonical": true, + "file": "asset_service.get_saved_query.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSavedQuery", + "fullName": "google.cloud.asset.v1.AssetService.GetSavedQuery", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.asset.v1.SavedQuery", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "GetSavedQuery", + "fullName": "google.cloud.asset.v1.AssetService.GetSavedQuery", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_ListSavedQueries_async", + "title": "AssetService listSavedQueries Sample", + "origin": "API_DEFINITION", + "description": " Lists all saved queries in a parent project/folder/organization.", + "canonical": true, + "file": "asset_service.list_saved_queries.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSavedQueries", + "fullName": "google.cloud.asset.v1.AssetService.ListSavedQueries", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.asset.v1.ListSavedQueriesResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "ListSavedQueries", + "fullName": "google.cloud.asset.v1.AssetService.ListSavedQueries", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_UpdateSavedQuery_async", + "title": "AssetService updateSavedQuery Sample", + "origin": "API_DEFINITION", + "description": " Updates a saved query.", + "canonical": true, + "file": "asset_service.update_saved_query.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSavedQuery", + "fullName": "google.cloud.asset.v1.AssetService.UpdateSavedQuery", + "async": true, + "parameters": [ + { + "name": "saved_query", + "type": ".google.cloud.asset.v1.SavedQuery" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.asset.v1.SavedQuery", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "UpdateSavedQuery", + "fullName": "google.cloud.asset.v1.AssetService.UpdateSavedQuery", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_DeleteSavedQuery_async", + "title": "AssetService deleteSavedQuery Sample", + "origin": "API_DEFINITION", + "description": " Deletes a saved query.", + "canonical": true, + "file": "asset_service.delete_saved_query.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteSavedQuery", + "fullName": "google.cloud.asset.v1.AssetService.DeleteSavedQuery", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "DeleteSavedQuery", + "fullName": "google.cloud.asset.v1.AssetService.DeleteSavedQuery", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_BatchGetEffectiveIamPolicies_async", + "title": "AssetService batchGetEffectiveIamPolicies Sample", + "origin": "API_DEFINITION", + "description": " Gets effective IAM policies for a batch of resources.", + "canonical": true, + "file": "asset_service.batch_get_effective_iam_policies.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchGetEffectiveIamPolicies", + "fullName": "google.cloud.asset.v1.AssetService.BatchGetEffectiveIamPolicies", + "async": true, + "parameters": [ + { + "name": "scope", + "type": "TYPE_STRING" + }, + { + "name": "names", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "BatchGetEffectiveIamPolicies", + "fullName": "google.cloud.asset.v1.AssetService.BatchGetEffectiveIamPolicies", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } } ] } \ No newline at end of file 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 1d1725ec543..f98ad77a9b0 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -175,15 +175,27 @@ export class AssetServiceClient { folderFeedPathTemplate: new this._gaxModule.PathTemplate( 'folders/{folder}/feeds/{feed}' ), + folderSavedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/savedQueries/{saved_query}' + ), inventoryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/instances/{instance}/inventory' ), organizationFeedPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/feeds/{feed}' ), + organizationSavedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/savedQueries/{saved_query}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), projectFeedPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/feeds/{feed}' ), + projectSavedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/savedQueries/{saved_query}' + ), servicePerimeterPathTemplate: new this._gaxModule.PathTemplate( 'accessPolicies/{access_policy}/servicePerimeters/{service_perimeter}' ), @@ -208,6 +220,11 @@ export class AssetServiceClient { 'nextPageToken', 'results' ), + listSavedQueries: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'savedQueries' + ), }; const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); @@ -315,6 +332,12 @@ export class AssetServiceClient { 'analyzeIamPolicy', 'analyzeIamPolicyLongrunning', 'analyzeMove', + 'createSavedQuery', + 'getSavedQuery', + 'listSavedQueries', + 'updateSavedQuery', + 'deleteSavedQuery', + 'batchGetEffectiveIamPolicies', ]; for (const methodName of assetServiceStubMethods) { const callPromise = this.assetServiceStub.then( @@ -550,9 +573,8 @@ 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] @@ -808,8 +830,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. @@ -987,8 +1009,26 @@ export class AssetServiceClient { * The request object that will be sent. * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery} request.analysisQuery * Required. The request query. + * @param {string} [request.savedAnalysisQuery] + * Optional. The name of a saved query, which must be in the format of: + * + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * + * If both `analysis_query` and `saved_analysis_query` are provided, they + * will be merged together with the `saved_analysis_query` as base and + * the `analysis_query` as overrides. For more details of the merge behavior, + * please refer to the + * [MergeFrom](https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details) + * page. + * + * Note that you cannot override primitive fields with default value, such as + * 0 or empty string, etc., because we use proto3, which doesn't support field + * presence yet. * @param {google.protobuf.Duration} [request.executionTimeout] - * Optional. Amount of time executable has to complete. See JSON representation of + * Optional. Amount of time executable has to complete. See JSON + * representation of * [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json). * * If this field is set with a value less than the RPC deadline, and the @@ -1119,41 +1159,527 @@ export class AssetServiceClient { {} | undefined ] >; - analyzeMove( - request: protos.google.cloud.asset.v1.IAnalyzeMoveRequest, + analyzeMove( + request: protos.google.cloud.asset.v1.IAnalyzeMoveRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.asset.v1.IAnalyzeMoveResponse, + protos.google.cloud.asset.v1.IAnalyzeMoveRequest | null | undefined, + {} | null | undefined + > + ): void; + analyzeMove( + request: protos.google.cloud.asset.v1.IAnalyzeMoveRequest, + callback: Callback< + protos.google.cloud.asset.v1.IAnalyzeMoveResponse, + protos.google.cloud.asset.v1.IAnalyzeMoveRequest | null | undefined, + {} | null | undefined + > + ): void; + analyzeMove( + request?: protos.google.cloud.asset.v1.IAnalyzeMoveRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.asset.v1.IAnalyzeMoveResponse, + protos.google.cloud.asset.v1.IAnalyzeMoveRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.asset.v1.IAnalyzeMoveResponse, + protos.google.cloud.asset.v1.IAnalyzeMoveRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.asset.v1.IAnalyzeMoveResponse, + protos.google.cloud.asset.v1.IAnalyzeMoveRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + resource: request.resource || '', + }); + this.initialize(); + return this.innerApiCalls.analyzeMove(request, options, callback); + } + /** + * Creates a saved query in a parent project/folder/organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project/folder/organization where this + * saved_query should be created in. It can only be an organization number + * (such as "organizations/123"), a folder number (such as "folders/123"), a + * project ID (such as "projects/my-project-id")", or a project number (such + * as "projects/12345"). + * @param {google.cloud.asset.v1.SavedQuery} request.savedQuery + * Required. The saved_query details. The `name` field must be empty as it + * will be generated based on the parent and saved_query_id. + * @param {string} request.savedQueryId + * Required. The ID to use for the saved query, which must be unique in the + * specified parent. It will become the final component of the saved query's + * resource name. + * + * This value should be 4-63 characters, and valid characters + * are /{@link 0-9|a-z}-/. + * + * Notice that this field is required in the saved query creation, and the + * `name` field of the `saved_query` will be ignored. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SavedQuery]{@link google.cloud.asset.v1.SavedQuery}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/asset_service.create_saved_query.js + * region_tag:cloudasset_v1_generated_AssetService_CreateSavedQuery_async + */ + createSavedQuery( + request?: protos.google.cloud.asset.v1.ICreateSavedQueryRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.ICreateSavedQueryRequest | undefined, + {} | undefined + ] + >; + createSavedQuery( + request: protos.google.cloud.asset.v1.ICreateSavedQueryRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.ICreateSavedQueryRequest | null | undefined, + {} | null | undefined + > + ): void; + createSavedQuery( + request: protos.google.cloud.asset.v1.ICreateSavedQueryRequest, + callback: Callback< + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.ICreateSavedQueryRequest | null | undefined, + {} | null | undefined + > + ): void; + createSavedQuery( + request?: protos.google.cloud.asset.v1.ICreateSavedQueryRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.asset.v1.ISavedQuery, + | protos.google.cloud.asset.v1.ICreateSavedQueryRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.ICreateSavedQueryRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.ICreateSavedQueryRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createSavedQuery(request, options, callback); + } + /** + * Gets details about a saved query. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the saved query and it must be in the format of: + * + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SavedQuery]{@link google.cloud.asset.v1.SavedQuery}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/asset_service.get_saved_query.js + * region_tag:cloudasset_v1_generated_AssetService_GetSavedQuery_async + */ + getSavedQuery( + request?: protos.google.cloud.asset.v1.IGetSavedQueryRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.IGetSavedQueryRequest | undefined, + {} | undefined + ] + >; + getSavedQuery( + request: protos.google.cloud.asset.v1.IGetSavedQueryRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.IGetSavedQueryRequest | null | undefined, + {} | null | undefined + > + ): void; + getSavedQuery( + request: protos.google.cloud.asset.v1.IGetSavedQueryRequest, + callback: Callback< + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.IGetSavedQueryRequest | null | undefined, + {} | null | undefined + > + ): void; + getSavedQuery( + request?: protos.google.cloud.asset.v1.IGetSavedQueryRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.IGetSavedQueryRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.IGetSavedQueryRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.IGetSavedQueryRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getSavedQuery(request, options, callback); + } + /** + * Updates a saved query. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.asset.v1.SavedQuery} request.savedQuery + * Required. The saved query to update. + * + * The saved query's `name` field is used to identify the one to update, + * which has format as below: + * + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to update. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SavedQuery]{@link google.cloud.asset.v1.SavedQuery}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/asset_service.update_saved_query.js + * region_tag:cloudasset_v1_generated_AssetService_UpdateSavedQuery_async + */ + updateSavedQuery( + request?: protos.google.cloud.asset.v1.IUpdateSavedQueryRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.IUpdateSavedQueryRequest | undefined, + {} | undefined + ] + >; + updateSavedQuery( + request: protos.google.cloud.asset.v1.IUpdateSavedQueryRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.IUpdateSavedQueryRequest | null | undefined, + {} | null | undefined + > + ): void; + updateSavedQuery( + request: protos.google.cloud.asset.v1.IUpdateSavedQueryRequest, + callback: Callback< + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.IUpdateSavedQueryRequest | null | undefined, + {} | null | undefined + > + ): void; + updateSavedQuery( + request?: protos.google.cloud.asset.v1.IUpdateSavedQueryRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.asset.v1.ISavedQuery, + | protos.google.cloud.asset.v1.IUpdateSavedQueryRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.IUpdateSavedQueryRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.IUpdateSavedQueryRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'saved_query.name': request.savedQuery!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateSavedQuery(request, options, callback); + } + /** + * Deletes a saved query. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the saved query to delete. It must be in the format + * of: + * + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/asset_service.delete_saved_query.js + * region_tag:cloudasset_v1_generated_AssetService_DeleteSavedQuery_async + */ + deleteSavedQuery( + request?: protos.google.cloud.asset.v1.IDeleteSavedQueryRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1.IDeleteSavedQueryRequest | undefined, + {} | undefined + ] + >; + deleteSavedQuery( + request: protos.google.cloud.asset.v1.IDeleteSavedQueryRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1.IDeleteSavedQueryRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteSavedQuery( + request: protos.google.cloud.asset.v1.IDeleteSavedQueryRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1.IDeleteSavedQueryRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteSavedQuery( + request?: protos.google.cloud.asset.v1.IDeleteSavedQueryRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.asset.v1.IDeleteSavedQueryRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1.IDeleteSavedQueryRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1.IDeleteSavedQueryRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteSavedQuery(request, options, callback); + } + /** + * Gets effective IAM policies for a batch of resources. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.scope + * Required. Only IAM policies on or below the scope will be returned. + * + * This can only be an organization number (such as "organizations/123"), a + * folder number (such as "folders/123"), a project ID (such as + * "projects/my-project-id"), or a project number (such as "projects/12345"). + * + * To know how to get organization id, visit [here + * ](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). + * + * To know how to get folder or project id, visit [here + * ](https://cloud.google.com/resource-manager/docs/creating-managing-folders#viewing_or_listing_folders_and_projects). + * @param {string[]} request.names + * Required. The names refer to the [full_resource_names] + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) + * of [searchable asset + * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). + * A maximum of 20 resources' effective policies can be retrieved in a batch. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [BatchGetEffectiveIamPoliciesResponse]{@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/asset_service.batch_get_effective_iam_policies.js + * region_tag:cloudasset_v1_generated_AssetService_BatchGetEffectiveIamPolicies_async + */ + batchGetEffectiveIamPolicies( + request?: protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse, + ( + | protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest + | undefined + ), + {} | undefined + ] + >; + batchGetEffectiveIamPolicies( + request: protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest, options: CallOptions, callback: Callback< - protos.google.cloud.asset.v1.IAnalyzeMoveResponse, - protos.google.cloud.asset.v1.IAnalyzeMoveRequest | null | undefined, + protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse, + | protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest + | null + | undefined, {} | null | undefined > ): void; - analyzeMove( - request: protos.google.cloud.asset.v1.IAnalyzeMoveRequest, + batchGetEffectiveIamPolicies( + request: protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest, callback: Callback< - protos.google.cloud.asset.v1.IAnalyzeMoveResponse, - protos.google.cloud.asset.v1.IAnalyzeMoveRequest | null | undefined, + protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse, + | protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest + | null + | undefined, {} | null | undefined > ): void; - analyzeMove( - request?: protos.google.cloud.asset.v1.IAnalyzeMoveRequest, + batchGetEffectiveIamPolicies( + request?: protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest, optionsOrCallback?: | CallOptions | Callback< - protos.google.cloud.asset.v1.IAnalyzeMoveResponse, - protos.google.cloud.asset.v1.IAnalyzeMoveRequest | null | undefined, + protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse, + | protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest + | null + | undefined, {} | null | undefined >, callback?: Callback< - protos.google.cloud.asset.v1.IAnalyzeMoveResponse, - protos.google.cloud.asset.v1.IAnalyzeMoveRequest | null | undefined, + protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse, + | protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest + | null + | undefined, {} | null | undefined > ): Promise< [ - protos.google.cloud.asset.v1.IAnalyzeMoveResponse, - protos.google.cloud.asset.v1.IAnalyzeMoveRequest | undefined, + protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse, + ( + | protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest + | undefined + ), {} | undefined ] > | void { @@ -1170,23 +1696,28 @@ export class AssetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ - resource: request.resource || '', + scope: request.scope || '', }); this.initialize(); - return this.innerApiCalls.analyzeMove(request, options, callback); + return this.innerApiCalls.batchGetEffectiveIamPolicies( + request, + options, + callback + ); } /** * 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 Protobuf 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. @@ -1224,7 +1755,8 @@ export class AssetServiceClient { * 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 {string[]} request.relationshipTypes * A list of relationship types to export, for example: * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if @@ -1376,18 +1908,37 @@ export class AssetServiceClient { * accesses on which resources, and writes the analysis results to a Google * Cloud Storage or a BigQuery destination. For Cloud Storage destination, the * output format is the JSON format that represents a - * {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse|AnalyzeIamPolicyResponse}. This method implements the - * {@link google.longrunning.Operation|google.longrunning.Operation}, which allows you to track the operation - * status. We recommend intervals of at least 2 seconds with exponential - * backoff retry to poll the operation result. The metadata contains the - * metadata for the long-running operation. + * {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse|AnalyzeIamPolicyResponse}. + * This method implements the + * {@link google.longrunning.Operation|google.longrunning.Operation}, which allows + * you to track the operation status. We recommend intervals of at least 2 + * seconds with exponential backoff retry to poll the operation result. The + * metadata contains the metadata for the long-running operation. * * @param {Object} request * The request object that will be sent. * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery} request.analysisQuery * Required. The request query. + * @param {string} [request.savedAnalysisQuery] + * Optional. The name of a saved query, which must be in the format of: + * + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * + * If both `analysis_query` and `saved_analysis_query` are provided, they + * will be merged together with the `saved_analysis_query` as base and + * the `analysis_query` as overrides. For more details of the merge behavior, + * please refer to the + * [MergeFrom](https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details) + * doc. + * + * Note that you cannot override primitive fields with default value, such as + * 0 or empty string, etc., because we use proto3, which doesn't support field + * presence yet. * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig} 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. @@ -1529,10 +2080,11 @@ export class AssetServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of the organization or project the assets belong to. Format: - * "organizations/[organization-number]" (such as "organizations/123"), - * "projects/[project-id]" (such as "projects/my-project-id"), or - * "projects/[project-number]" (such as "projects/12345"). + * Required. Name of the organization, folder, or project the assets belong + * to. Format: "organizations/[organization-number]" (such as + * "organizations/123"), "projects/[project-id]" (such as + * "projects/my-project-id"), "projects/[project-number]" (such as + * "projects/12345"), or "folders/[folder-number]" (such as "folders/12345"). * @param {google.protobuf.Timestamp} request.readTime * Timestamp to take an asset snapshot. This can only be set to a timestamp * between the current time and the current time minus 35 days (inclusive). @@ -1669,10 +2221,11 @@ export class AssetServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of the organization or project the assets belong to. Format: - * "organizations/[organization-number]" (such as "organizations/123"), - * "projects/[project-id]" (such as "projects/my-project-id"), or - * "projects/[project-number]" (such as "projects/12345"). + * Required. Name of the organization, folder, or project the assets belong + * to. Format: "organizations/[organization-number]" (such as + * "organizations/123"), "projects/[project-id]" (such as + * "projects/my-project-id"), "projects/[project-number]" (such as + * "projects/12345"), or "folders/[folder-number]" (such as "folders/12345"). * @param {google.protobuf.Timestamp} request.readTime * Timestamp to take an asset snapshot. This can only be set to a timestamp * between the current time and the current time minus 35 days (inclusive). @@ -1765,10 +2318,11 @@ export class AssetServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of the organization or project the assets belong to. Format: - * "organizations/[organization-number]" (such as "organizations/123"), - * "projects/[project-id]" (such as "projects/my-project-id"), or - * "projects/[project-number]" (such as "projects/12345"). + * Required. Name of the organization, folder, or project the assets belong + * to. Format: "organizations/[organization-number]" (such as + * "organizations/123"), "projects/[project-id]" (such as + * "projects/my-project-id"), "projects/[project-number]" (such as + * "projects/12345"), or "folders/[folder-number]" (such as "folders/12345"). * @param {google.protobuf.Timestamp} request.readTime * Timestamp to take an asset snapshot. This can only be set to a timestamp * between the current time and the current time minus 35 days (inclusive). @@ -1863,8 +2417,9 @@ 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`. The caller must be granted the + * 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`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) * permission on the desired scope. * @@ -1916,8 +2471,8 @@ export class AssetServiceClient { * fields and are also located in the "us-west1" region or the "global" * location. * @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). * * Regular expressions are also supported. For example: @@ -1931,19 +2486,20 @@ export class AssetServiceClient { * regular expression syntax. If the regular expression does not match any * supported asset type, an INVALID_ARGUMENT error will be returned. * @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. + * 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 singular primitive fields in the response are sortable: * @@ -1964,10 +2520,10 @@ export class AssetServiceClient { * fields (e.g., `labels`) and struct fields (e.g., `additionalAttributes`) * are not supported. * @param {google.protobuf.FieldMask} [request.readMask] - * Optional. A comma-separated list of fields specifying which fields to be returned in - * ResourceSearchResult. Only '*' or combination of top level fields can be - * specified. Field names of both snake_case and camelCase are supported. - * Examples: `"*"`, `"name,location"`, `"name,versionedResources"`. + * Optional. A comma-separated list of fields specifying which fields to be + * returned in ResourceSearchResult. Only '*' or combination of top level + * fields can be specified. Field names of both snake_case and camelCase are + * supported. Examples: `"*"`, `"name,location"`, `"name,versionedResources"`. * * The read_mask paths must be valid field paths listed but not limited to * (both snake_case and camelCase are supported): @@ -1978,6 +2534,9 @@ export class AssetServiceClient { * * displayName * * description * * location + * * tagKeys + * * tagValues + * * tagValueIds * * labels * * networkTags * * kmsKey @@ -2085,8 +2644,9 @@ 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`. The caller must be granted the + * 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`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) * permission on the desired scope. * @@ -2138,8 +2698,8 @@ export class AssetServiceClient { * fields and are also located in the "us-west1" region or the "global" * location. * @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). * * Regular expressions are also supported. For example: @@ -2153,19 +2713,20 @@ export class AssetServiceClient { * regular expression syntax. If the regular expression does not match any * supported asset type, an INVALID_ARGUMENT error will be returned. * @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. + * 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 singular primitive fields in the response are sortable: * @@ -2186,10 +2747,10 @@ export class AssetServiceClient { * fields (e.g., `labels`) and struct fields (e.g., `additionalAttributes`) * are not supported. * @param {google.protobuf.FieldMask} [request.readMask] - * Optional. A comma-separated list of fields specifying which fields to be returned in - * ResourceSearchResult. Only '*' or combination of top level fields can be - * specified. Field names of both snake_case and camelCase are supported. - * Examples: `"*"`, `"name,location"`, `"name,versionedResources"`. + * Optional. A comma-separated list of fields specifying which fields to be + * returned in ResourceSearchResult. Only '*' or combination of top level + * fields can be specified. Field names of both snake_case and camelCase are + * supported. Examples: `"*"`, `"name,location"`, `"name,versionedResources"`. * * The read_mask paths must be valid field paths listed but not limited to * (both snake_case and camelCase are supported): @@ -2200,6 +2761,9 @@ export class AssetServiceClient { * * displayName * * description * * location + * * tagKeys + * * tagValues + * * tagValueIds * * labels * * networkTags * * kmsKey @@ -2255,8 +2819,9 @@ 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`. The caller must be granted the + * 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`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) * permission on the desired scope. * @@ -2308,8 +2873,8 @@ export class AssetServiceClient { * fields and are also located in the "us-west1" region or the "global" * location. * @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). * * Regular expressions are also supported. For example: @@ -2323,19 +2888,20 @@ export class AssetServiceClient { * regular expression syntax. If the regular expression does not match any * supported asset type, an INVALID_ARGUMENT error will be returned. * @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. + * 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 singular primitive fields in the response are sortable: * @@ -2356,10 +2922,10 @@ export class AssetServiceClient { * fields (e.g., `labels`) and struct fields (e.g., `additionalAttributes`) * are not supported. * @param {google.protobuf.FieldMask} [request.readMask] - * Optional. A comma-separated list of fields specifying which fields to be returned in - * ResourceSearchResult. Only '*' or combination of top level fields can be - * specified. Field names of both snake_case and camelCase are supported. - * Examples: `"*"`, `"name,location"`, `"name,versionedResources"`. + * Optional. A comma-separated list of fields specifying which fields to be + * returned in ResourceSearchResult. Only '*' or combination of top level + * fields can be specified. Field names of both snake_case and camelCase are + * supported. Examples: `"*"`, `"name,location"`, `"name,versionedResources"`. * * The read_mask paths must be valid field paths listed but not limited to * (both snake_case and camelCase are supported): @@ -2370,6 +2936,9 @@ export class AssetServiceClient { * * displayName * * description * * location + * * tagKeys + * * tagValues + * * tagValueIds * * labels * * networkTags * * kmsKey @@ -2427,9 +2996,9 @@ 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`. The caller must be granted - * the + * 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`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) * permission on the desired scope. * @@ -2444,7 +3013,7 @@ export class AssetServiceClient { * 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`. Note that the query string is - * compared against each Cloud IAM policy binding, including its members, + * compared against each Cloud IAM policy binding, including its principals, * 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 @@ -2480,21 +3049,23 @@ export class AssetServiceClient { * "instance2" and also specify user "amy". * * `roles:roles/compute.admin` to find IAM policy bindings that specify the * Compute Admin role. - * * `memberTypes:user` to find IAM policy bindings that contain the "user" - * member type. + * * `memberTypes:user` to find IAM policy bindings that contain the + * principal type "user". * @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 {string[]} [request.assetTypes] - * Optional. A list of asset types that the IAM policies are attached to. If empty, it - * will search the IAM policies that are attached to all the [searchable asset + * Optional. A list of asset types that the IAM policies are attached to. If + * empty, it will search the IAM policies that are attached to all the + * [searchable asset * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). * * Regular expressions are also supported. For example: @@ -2510,9 +3081,9 @@ export class AssetServiceClient { * regular expression syntax. If the regular expression does not match any * supported asset type, an INVALID_ARGUMENT error will be returned. * @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. + * 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: "assetType DESC, resource". * Only singular primitive fields in the response are sortable: * * resource @@ -2613,9 +3184,9 @@ 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`. The caller must be granted - * the + * 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`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) * permission on the desired scope. * @@ -2630,7 +3201,7 @@ export class AssetServiceClient { * 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`. Note that the query string is - * compared against each Cloud IAM policy binding, including its members, + * compared against each Cloud IAM policy binding, including its principals, * 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 @@ -2666,21 +3237,23 @@ export class AssetServiceClient { * "instance2" and also specify user "amy". * * `roles:roles/compute.admin` to find IAM policy bindings that specify the * Compute Admin role. - * * `memberTypes:user` to find IAM policy bindings that contain the "user" - * member type. + * * `memberTypes:user` to find IAM policy bindings that contain the + * principal type "user". * @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 {string[]} [request.assetTypes] - * Optional. A list of asset types that the IAM policies are attached to. If empty, it - * will search the IAM policies that are attached to all the [searchable asset + * Optional. A list of asset types that the IAM policies are attached to. If + * empty, it will search the IAM policies that are attached to all the + * [searchable asset * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). * * Regular expressions are also supported. For example: @@ -2696,9 +3269,9 @@ export class AssetServiceClient { * regular expression syntax. If the regular expression does not match any * supported asset type, an INVALID_ARGUMENT error will be returned. * @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. + * 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: "assetType DESC, resource". * Only singular primitive fields in the response are sortable: * * resource @@ -2747,9 +3320,9 @@ 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`. The caller must be granted - * the + * 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`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) * permission on the desired scope. * @@ -2764,7 +3337,7 @@ export class AssetServiceClient { * 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`. Note that the query string is - * compared against each Cloud IAM policy binding, including its members, + * compared against each Cloud IAM policy binding, including its principals, * 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 @@ -2800,21 +3373,23 @@ export class AssetServiceClient { * "instance2" and also specify user "amy". * * `roles:roles/compute.admin` to find IAM policy bindings that specify the * Compute Admin role. - * * `memberTypes:user` to find IAM policy bindings that contain the "user" - * member type. + * * `memberTypes:user` to find IAM policy bindings that contain the + * principal type "user". * @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 {string[]} [request.assetTypes] - * Optional. A list of asset types that the IAM policies are attached to. If empty, it - * will search the IAM policies that are attached to all the [searchable asset + * Optional. A list of asset types that the IAM policies are attached to. If + * empty, it will search the IAM policies that are attached to all the + * [searchable asset * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). * * Regular expressions are also supported. For example: @@ -2830,9 +3405,9 @@ export class AssetServiceClient { * regular expression syntax. If the regular expression does not match any * supported asset type, an INVALID_ARGUMENT error will be returned. * @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. + * 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: "assetType DESC, resource". * Only singular primitive fields in the response are sortable: * * resource @@ -2874,6 +3449,240 @@ export class AssetServiceClient { callSettings ) as AsyncIterable; } + /** + * Lists all saved queries in a parent project/folder/organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent project/folder/organization whose savedQueries are to + * be listed. It can only be using project/folder/organization number (such as + * "folders/12345")", or a project ID (such as "projects/my-project-id"). + * @param {string} [request.filter] + * Optional. The expression to filter resources. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. When `AND` and `OR` are both used in the + * expression, parentheses must be appropriately used to group the + * combinations. The expression may also contain regular expressions. + * + * See https://google.aip.dev/160 for more information on the grammar. + * @param {number} [request.pageSize] + * Optional. The maximum number of saved queries to return per page. The + * service may return fewer than this value. If unspecified, at most 50 will + * be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListSavedQueries` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListSavedQueries` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [SavedQuery]{@link google.cloud.asset.v1.SavedQuery}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listSavedQueriesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listSavedQueries( + request?: protos.google.cloud.asset.v1.IListSavedQueriesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.asset.v1.ISavedQuery[], + protos.google.cloud.asset.v1.IListSavedQueriesRequest | null, + protos.google.cloud.asset.v1.IListSavedQueriesResponse + ] + >; + listSavedQueries( + request: protos.google.cloud.asset.v1.IListSavedQueriesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.asset.v1.IListSavedQueriesRequest, + protos.google.cloud.asset.v1.IListSavedQueriesResponse | null | undefined, + protos.google.cloud.asset.v1.ISavedQuery + > + ): void; + listSavedQueries( + request: protos.google.cloud.asset.v1.IListSavedQueriesRequest, + callback: PaginationCallback< + protos.google.cloud.asset.v1.IListSavedQueriesRequest, + protos.google.cloud.asset.v1.IListSavedQueriesResponse | null | undefined, + protos.google.cloud.asset.v1.ISavedQuery + > + ): void; + listSavedQueries( + request?: protos.google.cloud.asset.v1.IListSavedQueriesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.asset.v1.IListSavedQueriesRequest, + | protos.google.cloud.asset.v1.IListSavedQueriesResponse + | null + | undefined, + protos.google.cloud.asset.v1.ISavedQuery + >, + callback?: PaginationCallback< + protos.google.cloud.asset.v1.IListSavedQueriesRequest, + protos.google.cloud.asset.v1.IListSavedQueriesResponse | null | undefined, + protos.google.cloud.asset.v1.ISavedQuery + > + ): Promise< + [ + protos.google.cloud.asset.v1.ISavedQuery[], + protos.google.cloud.asset.v1.IListSavedQueriesRequest | null, + protos.google.cloud.asset.v1.IListSavedQueriesResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listSavedQueries(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent project/folder/organization whose savedQueries are to + * be listed. It can only be using project/folder/organization number (such as + * "folders/12345")", or a project ID (such as "projects/my-project-id"). + * @param {string} [request.filter] + * Optional. The expression to filter resources. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. When `AND` and `OR` are both used in the + * expression, parentheses must be appropriately used to group the + * combinations. The expression may also contain regular expressions. + * + * See https://google.aip.dev/160 for more information on the grammar. + * @param {number} [request.pageSize] + * Optional. The maximum number of saved queries to return per page. The + * service may return fewer than this value. If unspecified, at most 50 will + * be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListSavedQueries` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListSavedQueries` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [SavedQuery]{@link google.cloud.asset.v1.SavedQuery} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listSavedQueriesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listSavedQueriesStream( + request?: protos.google.cloud.asset.v1.IListSavedQueriesRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const defaultCallSettings = this._defaults['listSavedQueries']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSavedQueries.createStream( + this.innerApiCalls.listSavedQueries as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listSavedQueries`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent project/folder/organization whose savedQueries are to + * be listed. It can only be using project/folder/organization number (such as + * "folders/12345")", or a project ID (such as "projects/my-project-id"). + * @param {string} [request.filter] + * Optional. The expression to filter resources. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. When `AND` and `OR` are both used in the + * expression, parentheses must be appropriately used to group the + * combinations. The expression may also contain regular expressions. + * + * See https://google.aip.dev/160 for more information on the grammar. + * @param {number} [request.pageSize] + * Optional. The maximum number of saved queries to return per page. The + * service may return fewer than this value. If unspecified, at most 50 will + * be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListSavedQueries` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListSavedQueries` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [SavedQuery]{@link google.cloud.asset.v1.SavedQuery}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/asset_service.list_saved_queries.js + * region_tag:cloudasset_v1_generated_AssetService_ListSavedQueries_async + */ + listSavedQueriesAsync( + request?: protos.google.cloud.asset.v1.IListSavedQueriesRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const defaultCallSettings = this._defaults['listSavedQueries']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSavedQueries.asyncIterate( + this.innerApiCalls['listSavedQueries'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } // -------------------- // -- Path templates -- // -------------------- @@ -2977,6 +3786,46 @@ export class AssetServiceClient { return this.pathTemplates.folderFeedPathTemplate.match(folderFeedName).feed; } + /** + * Return a fully-qualified folderSavedQuery resource name string. + * + * @param {string} folder + * @param {string} saved_query + * @returns {string} Resource name string. + */ + folderSavedQueryPath(folder: string, savedQuery: string) { + return this.pathTemplates.folderSavedQueryPathTemplate.render({ + folder: folder, + saved_query: savedQuery, + }); + } + + /** + * Parse the folder from FolderSavedQuery resource. + * + * @param {string} folderSavedQueryName + * A fully-qualified path representing folder_saved_query resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderSavedQueryName(folderSavedQueryName: string) { + return this.pathTemplates.folderSavedQueryPathTemplate.match( + folderSavedQueryName + ).folder; + } + + /** + * Parse the saved_query from FolderSavedQuery resource. + * + * @param {string} folderSavedQueryName + * A fully-qualified path representing folder_saved_query resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromFolderSavedQueryName(folderSavedQueryName: string) { + return this.pathTemplates.folderSavedQueryPathTemplate.match( + folderSavedQueryName + ).saved_query; + } + /** * Return a fully-qualified inventory resource name string. * @@ -3069,6 +3918,73 @@ export class AssetServiceClient { ).feed; } + /** + * Return a fully-qualified organizationSavedQuery resource name string. + * + * @param {string} organization + * @param {string} saved_query + * @returns {string} Resource name string. + */ + organizationSavedQueryPath(organization: string, savedQuery: string) { + return this.pathTemplates.organizationSavedQueryPathTemplate.render({ + organization: organization, + saved_query: savedQuery, + }); + } + + /** + * Parse the organization from OrganizationSavedQuery resource. + * + * @param {string} organizationSavedQueryName + * A fully-qualified path representing organization_saved_query resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSavedQueryName( + organizationSavedQueryName: string + ) { + return this.pathTemplates.organizationSavedQueryPathTemplate.match( + organizationSavedQueryName + ).organization; + } + + /** + * Parse the saved_query from OrganizationSavedQuery resource. + * + * @param {string} organizationSavedQueryName + * A fully-qualified path representing organization_saved_query resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromOrganizationSavedQueryName( + organizationSavedQueryName: string + ) { + return this.pathTemplates.organizationSavedQueryPathTemplate.match( + organizationSavedQueryName + ).saved_query; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + /** * Return a fully-qualified projectFeed resource name string. * @@ -3107,6 +4023,46 @@ export class AssetServiceClient { .feed; } + /** + * Return a fully-qualified projectSavedQuery resource name string. + * + * @param {string} project + * @param {string} saved_query + * @returns {string} Resource name string. + */ + projectSavedQueryPath(project: string, savedQuery: string) { + return this.pathTemplates.projectSavedQueryPathTemplate.render({ + project: project, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from ProjectSavedQuery resource. + * + * @param {string} projectSavedQueryName + * A fully-qualified path representing project_saved_query resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectSavedQueryName(projectSavedQueryName: string) { + return this.pathTemplates.projectSavedQueryPathTemplate.match( + projectSavedQueryName + ).project; + } + + /** + * Parse the saved_query from ProjectSavedQuery resource. + * + * @param {string} projectSavedQueryName + * A fully-qualified path representing project_saved_query resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromProjectSavedQueryName(projectSavedQueryName: string) { + return this.pathTemplates.projectSavedQueryPathTemplate.match( + projectSavedQueryName + ).saved_query; + } + /** * Return a fully-qualified servicePerimeter resource name string. * diff --git a/packages/google-cloud-asset/src/v1/asset_service_client_config.json b/packages/google-cloud-asset/src/v1/asset_service_client_config.json index ced7e2fd6b7..9be8722e81e 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client_config.json +++ b/packages/google-cloud-asset/src/v1/asset_service_client_config.json @@ -86,6 +86,30 @@ "AnalyzeMove": { "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "CreateSavedQuery": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetSavedQuery": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListSavedQueries": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateSavedQuery": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteSavedQuery": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchGetEffectiveIamPolicies": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-asset/src/v1/gapic_metadata.json b/packages/google-cloud-asset/src/v1/gapic_metadata.json index 68aa629a313..1aceb2f63ab 100644 --- a/packages/google-cloud-asset/src/v1/gapic_metadata.json +++ b/packages/google-cloud-asset/src/v1/gapic_metadata.json @@ -50,6 +50,31 @@ "analyzeMove" ] }, + "CreateSavedQuery": { + "methods": [ + "createSavedQuery" + ] + }, + "GetSavedQuery": { + "methods": [ + "getSavedQuery" + ] + }, + "UpdateSavedQuery": { + "methods": [ + "updateSavedQuery" + ] + }, + "DeleteSavedQuery": { + "methods": [ + "deleteSavedQuery" + ] + }, + "BatchGetEffectiveIamPolicies": { + "methods": [ + "batchGetEffectiveIamPolicies" + ] + }, "ExportAssets": { "methods": [ "exportAssets" @@ -80,6 +105,13 @@ "searchAllIamPoliciesStream", "searchAllIamPoliciesAsync" ] + }, + "ListSavedQueries": { + "methods": [ + "listSavedQueries", + "listSavedQueriesStream", + "listSavedQueriesAsync" + ] } } }, @@ -126,6 +158,31 @@ "analyzeMove" ] }, + "CreateSavedQuery": { + "methods": [ + "createSavedQuery" + ] + }, + "GetSavedQuery": { + "methods": [ + "getSavedQuery" + ] + }, + "UpdateSavedQuery": { + "methods": [ + "updateSavedQuery" + ] + }, + "DeleteSavedQuery": { + "methods": [ + "deleteSavedQuery" + ] + }, + "BatchGetEffectiveIamPolicies": { + "methods": [ + "batchGetEffectiveIamPolicies" + ] + }, "ExportAssets": { "methods": [ "exportAssets" @@ -156,6 +213,13 @@ "searchAllIamPoliciesStream", "searchAllIamPoliciesAsync" ] + }, + "ListSavedQueries": { + "methods": [ + "listSavedQueries", + "listSavedQueriesStream", + "listSavedQueriesAsync" + ] } } } diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts index 9791b5636c2..5fd697ad2ce 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts @@ -1257,15 +1257,15 @@ describe('v1.AssetServiceClient', () => { }); }); - describe('exportAssets', () => { - it('invokes exportAssets without error', async () => { + describe('createSavedQuery', () => { + it('invokes createSavedQuery without error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.ExportAssetsRequest() + new protos.google.cloud.asset.v1.CreateSavedQueryRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -1277,27 +1277,26 @@ describe('v1.AssetServiceClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.asset.v1.SavedQuery() ); - client.innerApiCalls.exportAssets = stubLongRunningCall(expectedResponse); - const [operation] = await client.exportAssets(request); - const [response] = await operation.promise(); + client.innerApiCalls.createSavedQuery = stubSimpleCall(expectedResponse); + const [response] = await client.createSavedQuery(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.exportAssets as SinonStub) + (client.innerApiCalls.createSavedQuery as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes exportAssets without error using callback', async () => { + it('invokes createSavedQuery without error using callback', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.ExportAssetsRequest() + new protos.google.cloud.asset.v1.CreateSavedQueryRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -1309,19 +1308,16 @@ describe('v1.AssetServiceClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.asset.v1.SavedQuery() ); - client.innerApiCalls.exportAssets = - stubLongRunningCallWithCallback(expectedResponse); + client.innerApiCalls.createSavedQuery = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.exportAssets( + client.createSavedQuery( request, ( err?: Error | null, - result?: LROperation< - protos.google.cloud.asset.v1.IExportAssetsResponse, - protos.google.cloud.asset.v1.IExportAssetsRequest - > | null + result?: protos.google.cloud.asset.v1.ISavedQuery | null ) => { if (err) { reject(err); @@ -1331,27 +1327,23 @@ describe('v1.AssetServiceClient', () => { } ); }); - const operation = (await promise) as LROperation< - protos.google.cloud.asset.v1.IExportAssetsResponse, - protos.google.cloud.asset.v1.IExportAssetsRequest - >; - const [response] = await operation.promise(); + const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.exportAssets as SinonStub) + (client.innerApiCalls.createSavedQuery as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes exportAssets with call error', async () => { + it('invokes createSavedQuery with error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.ExportAssetsRequest() + new protos.google.cloud.asset.v1.CreateSavedQueryRequest() ); request.parent = ''; const expectedHeaderRequestParams = 'parent='; @@ -1363,103 +1355,46 @@ describe('v1.AssetServiceClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.exportAssets = stubLongRunningCall( + client.innerApiCalls.createSavedQuery = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.exportAssets(request), expectedError); + await assert.rejects(client.createSavedQuery(request), expectedError); assert( - (client.innerApiCalls.exportAssets as SinonStub) + (client.innerApiCalls.createSavedQuery as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes exportAssets with LRO error', async () => { + it('invokes createSavedQuery with closed client', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.ExportAssetsRequest() + new protos.google.cloud.asset.v1.CreateSavedQueryRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.exportAssets = stubLongRunningCall( - undefined, - undefined, - expectedError - ); - const [operation] = await client.exportAssets(request); - await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.exportAssets as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - - it('invokes checkExportAssetsProgress without error', async () => { - const client = new assetserviceModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkExportAssetsProgress( - expectedResponse.name - ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkExportAssetsProgress with error', async () => { - const client = new assetserviceModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.checkExportAssetsProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createSavedQuery(request), expectedError); }); }); - describe('analyzeIamPolicyLongrunning', () => { - it('invokes analyzeIamPolicyLongrunning without error', async () => { + describe('getSavedQuery', () => { + it('invokes getSavedQuery without error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest() + new protos.google.cloud.asset.v1.GetSavedQueryRequest() ); - request.analysisQuery = {}; - request.analysisQuery.scope = ''; - const expectedHeaderRequestParams = 'analysis_query.scope='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -1468,32 +1403,29 @@ describe('v1.AssetServiceClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.asset.v1.SavedQuery() ); - client.innerApiCalls.analyzeIamPolicyLongrunning = - stubLongRunningCall(expectedResponse); - const [operation] = await client.analyzeIamPolicyLongrunning(request); - const [response] = await operation.promise(); + client.innerApiCalls.getSavedQuery = stubSimpleCall(expectedResponse); + const [response] = await client.getSavedQuery(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub) + (client.innerApiCalls.getSavedQuery as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes analyzeIamPolicyLongrunning without error using callback', async () => { + it('invokes getSavedQuery without error using callback', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest() + new protos.google.cloud.asset.v1.GetSavedQueryRequest() ); - request.analysisQuery = {}; - request.analysisQuery.scope = ''; - const expectedHeaderRequestParams = 'analysis_query.scope='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -1502,19 +1434,16 @@ describe('v1.AssetServiceClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.asset.v1.SavedQuery() ); - client.innerApiCalls.analyzeIamPolicyLongrunning = - stubLongRunningCallWithCallback(expectedResponse); + client.innerApiCalls.getSavedQuery = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.analyzeIamPolicyLongrunning( + client.getSavedQuery( request, ( err?: Error | null, - result?: LROperation< - protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse, - protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningMetadata - > | null + result?: protos.google.cloud.asset.v1.ISavedQuery | null ) => { if (err) { reject(err); @@ -1524,31 +1453,26 @@ describe('v1.AssetServiceClient', () => { } ); }); - const operation = (await promise) as LROperation< - protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse, - protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningMetadata - >; - const [response] = await operation.promise(); + const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub) + (client.innerApiCalls.getSavedQuery as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes analyzeIamPolicyLongrunning with call error', async () => { + it('invokes getSavedQuery with error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest() + new protos.google.cloud.asset.v1.GetSavedQueryRequest() ); - request.analysisQuery = {}; - request.analysisQuery.scope = ''; - const expectedHeaderRequestParams = 'analysis_query.scope='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -1557,110 +1481,47 @@ describe('v1.AssetServiceClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.analyzeIamPolicyLongrunning = stubLongRunningCall( + client.innerApiCalls.getSavedQuery = stubSimpleCall( undefined, expectedError ); - await assert.rejects( - client.analyzeIamPolicyLongrunning(request), - expectedError - ); + await assert.rejects(client.getSavedQuery(request), expectedError); assert( - (client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub) + (client.innerApiCalls.getSavedQuery as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes analyzeIamPolicyLongrunning with LRO error', async () => { + it('invokes getSavedQuery with closed client', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest() - ); - request.analysisQuery = {}; - request.analysisQuery.scope = ''; - const expectedHeaderRequestParams = 'analysis_query.scope='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.analyzeIamPolicyLongrunning = stubLongRunningCall( - undefined, - undefined, - expectedError - ); - const [operation] = await client.analyzeIamPolicyLongrunning(request); - await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - - it('invokes checkAnalyzeIamPolicyLongrunningProgress without error', async () => { - const client = new assetserviceModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = - await client.checkAnalyzeIamPolicyLongrunningProgress( - expectedResponse.name - ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkAnalyzeIamPolicyLongrunningProgress with error', async () => { - const client = new assetserviceModule.v1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects( - client.checkAnalyzeIamPolicyLongrunningProgress(''), - expectedError + new protos.google.cloud.asset.v1.GetSavedQueryRequest() ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getSavedQuery(request), expectedError); }); }); - describe('listAssets', () => { - it('invokes listAssets without error', async () => { + describe('updateSavedQuery', () => { + it('invokes updateSavedQuery without error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.ListAssetsRequest() + new protos.google.cloud.asset.v1.UpdateSavedQueryRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + request.savedQuery = {}; + request.savedQuery.name = ''; + const expectedHeaderRequestParams = 'saved_query.name='; const expectedOptions = { otherArgs: { headers: { @@ -1668,32 +1529,31 @@ describe('v1.AssetServiceClient', () => { }, }, }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), - generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), - generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), - ]; - client.innerApiCalls.listAssets = stubSimpleCall(expectedResponse); - const [response] = await client.listAssets(request); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.SavedQuery() + ); + client.innerApiCalls.updateSavedQuery = stubSimpleCall(expectedResponse); + const [response] = await client.updateSavedQuery(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.listAssets as SinonStub) + (client.innerApiCalls.updateSavedQuery as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes listAssets without error using callback', async () => { + it('invokes updateSavedQuery without error using callback', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.ListAssetsRequest() + new protos.google.cloud.asset.v1.UpdateSavedQueryRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + request.savedQuery = {}; + request.savedQuery.name = ''; + const expectedHeaderRequestParams = 'saved_query.name='; const expectedOptions = { otherArgs: { headers: { @@ -1701,19 +1561,17 @@ describe('v1.AssetServiceClient', () => { }, }, }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), - generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), - generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), - ]; - client.innerApiCalls.listAssets = + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.SavedQuery() + ); + client.innerApiCalls.updateSavedQuery = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listAssets( + client.updateSavedQuery( request, ( err?: Error | null, - result?: protos.google.cloud.asset.v1.IAsset[] | null + result?: protos.google.cloud.asset.v1.ISavedQuery | null ) => { if (err) { reject(err); @@ -1726,23 +1584,24 @@ describe('v1.AssetServiceClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.listAssets as SinonStub) + (client.innerApiCalls.updateSavedQuery as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes listAssets with error', async () => { + it('invokes updateSavedQuery with error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.ListAssetsRequest() + new protos.google.cloud.asset.v1.UpdateSavedQueryRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + request.savedQuery = {}; + request.savedQuery.name = ''; + const expectedHeaderRequestParams = 'saved_query.name='; const expectedOptions = { otherArgs: { headers: { @@ -1751,42 +1610,1126 @@ describe('v1.AssetServiceClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.listAssets = stubSimpleCall( + client.innerApiCalls.updateSavedQuery = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.listAssets(request), expectedError); + await assert.rejects(client.updateSavedQuery(request), expectedError); assert( - (client.innerApiCalls.listAssets as SinonStub) + (client.innerApiCalls.updateSavedQuery as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes listAssetsStream without error', async () => { + it('invokes updateSavedQuery with closed client', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.ListAssetsRequest() + new protos.google.cloud.asset.v1.UpdateSavedQueryRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedResponse = [ + request.savedQuery = {}; + request.savedQuery.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateSavedQuery(request), expectedError); + }); + }); + + describe('deleteSavedQuery', () => { + it('invokes deleteSavedQuery without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.DeleteSavedQueryRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSavedQuery = stubSimpleCall(expectedResponse); + const [response] = await client.deleteSavedQuery(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteSavedQuery as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteSavedQuery without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.DeleteSavedQueryRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSavedQuery = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSavedQuery( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteSavedQuery as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteSavedQuery with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.DeleteSavedQueryRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSavedQuery = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteSavedQuery(request), expectedError); + assert( + (client.innerApiCalls.deleteSavedQuery as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteSavedQuery with closed client', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.DeleteSavedQueryRequest() + ); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteSavedQuery(request), expectedError); + }); + }); + + describe('batchGetEffectiveIamPolicies', () => { + it('invokes batchGetEffectiveIamPolicies without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse() + ); + client.innerApiCalls.batchGetEffectiveIamPolicies = + stubSimpleCall(expectedResponse); + const [response] = await client.batchGetEffectiveIamPolicies(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.batchGetEffectiveIamPolicies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes batchGetEffectiveIamPolicies without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse() + ); + client.innerApiCalls.batchGetEffectiveIamPolicies = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchGetEffectiveIamPolicies( + request, + ( + err?: Error | null, + result?: protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.batchGetEffectiveIamPolicies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes batchGetEffectiveIamPolicies with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchGetEffectiveIamPolicies = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.batchGetEffectiveIamPolicies(request), + expectedError + ); + assert( + (client.innerApiCalls.batchGetEffectiveIamPolicies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes batchGetEffectiveIamPolicies with closed client', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest() + ); + request.scope = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.batchGetEffectiveIamPolicies(request), + expectedError + ); + }); + }); + + describe('exportAssets', () => { + it('invokes exportAssets without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ExportAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportAssets = stubLongRunningCall(expectedResponse); + const [operation] = await client.exportAssets(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.exportAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes exportAssets without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ExportAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportAssets = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportAssets( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.asset.v1.IExportAssetsResponse, + protos.google.cloud.asset.v1.IExportAssetsRequest + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.asset.v1.IExportAssetsResponse, + protos.google.cloud.asset.v1.IExportAssetsRequest + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.exportAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes exportAssets with call error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ExportAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.exportAssets = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.exportAssets(request), expectedError); + assert( + (client.innerApiCalls.exportAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes exportAssets with LRO error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ExportAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.exportAssets = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.exportAssets(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.exportAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkExportAssetsProgress without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkExportAssetsProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportAssetsProgress with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkExportAssetsProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('analyzeIamPolicyLongrunning', () => { + it('invokes analyzeIamPolicyLongrunning without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest() + ); + request.analysisQuery = {}; + request.analysisQuery.scope = ''; + const expectedHeaderRequestParams = 'analysis_query.scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.analyzeIamPolicyLongrunning = + stubLongRunningCall(expectedResponse); + const [operation] = await client.analyzeIamPolicyLongrunning(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes analyzeIamPolicyLongrunning without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest() + ); + request.analysisQuery = {}; + request.analysisQuery.scope = ''; + const expectedHeaderRequestParams = 'analysis_query.scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.analyzeIamPolicyLongrunning = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.analyzeIamPolicyLongrunning( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse, + protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse, + protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes analyzeIamPolicyLongrunning with call error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest() + ); + request.analysisQuery = {}; + request.analysisQuery.scope = ''; + const expectedHeaderRequestParams = 'analysis_query.scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.analyzeIamPolicyLongrunning = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.analyzeIamPolicyLongrunning(request), + expectedError + ); + assert( + (client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes analyzeIamPolicyLongrunning with LRO error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest() + ); + request.analysisQuery = {}; + request.analysisQuery.scope = ''; + const expectedHeaderRequestParams = 'analysis_query.scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.analyzeIamPolicyLongrunning = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.analyzeIamPolicyLongrunning(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkAnalyzeIamPolicyLongrunningProgress without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkAnalyzeIamPolicyLongrunningProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkAnalyzeIamPolicyLongrunningProgress with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkAnalyzeIamPolicyLongrunningProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listAssets', () => { + it('invokes listAssets without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + ]; + client.innerApiCalls.listAssets = stubSimpleCall(expectedResponse); + const [response] = await client.listAssets(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listAssets without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + ]; + client.innerApiCalls.listAssets = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAssets( + request, + ( + err?: Error | null, + result?: protos.google.cloud.asset.v1.IAsset[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listAssets with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listAssets = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listAssets(request), expectedError); + assert( + (client.innerApiCalls.listAssets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listAssetsStream without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + ]; + client.descriptors.page.listAssets.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.asset.v1.Asset[] = []; + stream.on('data', (response: protos.google.cloud.asset.v1.Asset) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAssets, request) + ); + assert.strictEqual( + (client.descriptors.page.listAssets.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listAssetsStream with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listAssets.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.asset.v1.Asset[] = []; + stream.on('data', (response: protos.google.cloud.asset.v1.Asset) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAssets, request) + ); + assert.strictEqual( + (client.descriptors.page.listAssets.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listAssets without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), ]; - client.descriptors.page.listAssets.createStream = + client.descriptors.page.listAssets.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.asset.v1.IAsset[] = []; + const iterable = client.listAssetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listAssets with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListAssetsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAssetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.asset.v1.IAsset[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('searchAllResources', () => { + it('invokes searchAllResources without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.SearchAllResourcesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.asset.v1.ResourceSearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1.ResourceSearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1.ResourceSearchResult() + ), + ]; + client.innerApiCalls.searchAllResources = + stubSimpleCall(expectedResponse); + const [response] = await client.searchAllResources(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.searchAllResources as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes searchAllResources without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.SearchAllResourcesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.asset.v1.ResourceSearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1.ResourceSearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1.ResourceSearchResult() + ), + ]; + client.innerApiCalls.searchAllResources = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchAllResources( + request, + ( + err?: Error | null, + result?: protos.google.cloud.asset.v1.IResourceSearchResult[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.searchAllResources as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes searchAllResources with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.SearchAllResourcesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.searchAllResources = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.searchAllResources(request), expectedError); + assert( + (client.innerApiCalls.searchAllResources as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes searchAllResourcesStream without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.SearchAllResourcesRequest() + ); + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.asset.v1.ResourceSearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1.ResourceSearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1.ResourceSearchResult() + ), + ]; + client.descriptors.page.searchAllResources.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listAssetsStream(request); + const stream = client.searchAllResourcesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.asset.v1.Asset[] = []; - stream.on('data', (response: protos.google.cloud.asset.v1.Asset) => { - responses.push(response); - }); + const responses: protos.google.cloud.asset.v1.ResourceSearchResult[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.asset.v1.ResourceSearchResult) => { + responses.push(response); + } + ); stream.on('end', () => { resolve(responses); }); @@ -1797,40 +2740,42 @@ describe('v1.AssetServiceClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listAssets.createStream as SinonStub) + (client.descriptors.page.searchAllResources.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listAssets, request) - ); - assert.strictEqual( - (client.descriptors.page.listAssets.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], + .calledWith(client.innerApiCalls.searchAllResources, request) + ); + assert.strictEqual( + ( + client.descriptors.page.searchAllResources.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('invokes listAssetsStream with error', async () => { + it('invokes searchAllResourcesStream with error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.ListAssetsRequest() + new protos.google.cloud.asset.v1.SearchAllResourcesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; const expectedError = new Error('expected'); - client.descriptors.page.listAssets.createStream = stubPageStreamingCall( - undefined, - expectedError - ); - const stream = client.listAssetsStream(request); + client.descriptors.page.searchAllResources.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.searchAllResourcesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.asset.v1.Asset[] = []; - stream.on('data', (response: protos.google.cloud.asset.v1.Asset) => { - responses.push(response); - }); + const responses: protos.google.cloud.asset.v1.ResourceSearchResult[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.asset.v1.ResourceSearchResult) => { + responses.push(response); + } + ); stream.on('end', () => { resolve(responses); }); @@ -1840,103 +2785,109 @@ describe('v1.AssetServiceClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listAssets.createStream as SinonStub) + (client.descriptors.page.searchAllResources.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listAssets, request) + .calledWith(client.innerApiCalls.searchAllResources, request) ); assert.strictEqual( - (client.descriptors.page.listAssets.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], + ( + client.descriptors.page.searchAllResources.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with listAssets without error', async () => { + it('uses async iteration with searchAllResources without error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.ListAssetsRequest() + new protos.google.cloud.asset.v1.SearchAllResourcesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), - generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), - generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + generateSampleMessage( + new protos.google.cloud.asset.v1.ResourceSearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1.ResourceSearchResult() + ), + generateSampleMessage( + new protos.google.cloud.asset.v1.ResourceSearchResult() + ), ]; - client.descriptors.page.listAssets.asyncIterate = + client.descriptors.page.searchAllResources.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.asset.v1.IAsset[] = []; - const iterable = client.listAssetsAsync(request); + const responses: protos.google.cloud.asset.v1.IResourceSearchResult[] = + []; + const iterable = client.searchAllResourcesAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[1], + ( + client.descriptors.page.searchAllResources.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], + ( + client.descriptors.page.searchAllResources.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with listAssets with error', async () => { + it('uses async iteration with searchAllResources with error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.ListAssetsRequest() + new protos.google.cloud.asset.v1.SearchAllResourcesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + request.scope = ''; + const expectedHeaderRequestParams = 'scope='; const expectedError = new Error('expected'); - client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); - const iterable = client.listAssetsAsync(request); + client.descriptors.page.searchAllResources.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.searchAllResourcesAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.asset.v1.IAsset[] = []; + const responses: protos.google.cloud.asset.v1.IResourceSearchResult[] = + []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[1], + ( + client.descriptors.page.searchAllResources.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], + ( + client.descriptors.page.searchAllResources.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); }); - describe('searchAllResources', () => { - it('invokes searchAllResources without error', async () => { + describe('searchAllIamPolicies', () => { + it('invokes searchAllIamPolicies without error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.SearchAllResourcesRequest() + new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() ); request.scope = ''; const expectedHeaderRequestParams = 'scope='; @@ -1949,34 +2900,34 @@ describe('v1.AssetServiceClient', () => { }; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.asset.v1.ResourceSearchResult() + new protos.google.cloud.asset.v1.IamPolicySearchResult() ), generateSampleMessage( - new protos.google.cloud.asset.v1.ResourceSearchResult() + new protos.google.cloud.asset.v1.IamPolicySearchResult() ), generateSampleMessage( - new protos.google.cloud.asset.v1.ResourceSearchResult() + new protos.google.cloud.asset.v1.IamPolicySearchResult() ), ]; - client.innerApiCalls.searchAllResources = + client.innerApiCalls.searchAllIamPolicies = stubSimpleCall(expectedResponse); - const [response] = await client.searchAllResources(request); + const [response] = await client.searchAllIamPolicies(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.searchAllResources as SinonStub) + (client.innerApiCalls.searchAllIamPolicies as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes searchAllResources without error using callback', async () => { + it('invokes searchAllIamPolicies without error using callback', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.SearchAllResourcesRequest() + new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() ); request.scope = ''; const expectedHeaderRequestParams = 'scope='; @@ -1989,23 +2940,25 @@ describe('v1.AssetServiceClient', () => { }; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.asset.v1.ResourceSearchResult() + new protos.google.cloud.asset.v1.IamPolicySearchResult() ), generateSampleMessage( - new protos.google.cloud.asset.v1.ResourceSearchResult() + new protos.google.cloud.asset.v1.IamPolicySearchResult() ), generateSampleMessage( - new protos.google.cloud.asset.v1.ResourceSearchResult() + new protos.google.cloud.asset.v1.IamPolicySearchResult() ), ]; - client.innerApiCalls.searchAllResources = + client.innerApiCalls.searchAllIamPolicies = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.searchAllResources( + client.searchAllIamPolicies( request, ( err?: Error | null, - result?: protos.google.cloud.asset.v1.IResourceSearchResult[] | null + result?: + | protos.google.cloud.asset.v1.IIamPolicySearchResult[] + | null ) => { if (err) { reject(err); @@ -2018,20 +2971,20 @@ describe('v1.AssetServiceClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.searchAllResources as SinonStub) + (client.innerApiCalls.searchAllIamPolicies as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes searchAllResources with error', async () => { + it('invokes searchAllIamPolicies with error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.SearchAllResourcesRequest() + new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() ); request.scope = ''; const expectedHeaderRequestParams = 'scope='; @@ -2043,49 +2996,49 @@ describe('v1.AssetServiceClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.searchAllResources = stubSimpleCall( + client.innerApiCalls.searchAllIamPolicies = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.searchAllResources(request), expectedError); + await assert.rejects(client.searchAllIamPolicies(request), expectedError); assert( - (client.innerApiCalls.searchAllResources as SinonStub) + (client.innerApiCalls.searchAllIamPolicies as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes searchAllResourcesStream without error', async () => { + it('invokes searchAllIamPoliciesStream without error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.SearchAllResourcesRequest() + new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() ); request.scope = ''; const expectedHeaderRequestParams = 'scope='; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.asset.v1.ResourceSearchResult() + new protos.google.cloud.asset.v1.IamPolicySearchResult() ), generateSampleMessage( - new protos.google.cloud.asset.v1.ResourceSearchResult() + new protos.google.cloud.asset.v1.IamPolicySearchResult() ), generateSampleMessage( - new protos.google.cloud.asset.v1.ResourceSearchResult() + new protos.google.cloud.asset.v1.IamPolicySearchResult() ), ]; - client.descriptors.page.searchAllResources.createStream = + client.descriptors.page.searchAllIamPolicies.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.searchAllResourcesStream(request); + const stream = client.searchAllIamPoliciesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.asset.v1.ResourceSearchResult[] = + const responses: protos.google.cloud.asset.v1.IamPolicySearchResult[] = []; stream.on( 'data', - (response: protos.google.cloud.asset.v1.ResourceSearchResult) => { + (response: protos.google.cloud.asset.v1.IamPolicySearchResult) => { responses.push(response); } ); @@ -2099,39 +3052,39 @@ describe('v1.AssetServiceClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.searchAllResources.createStream as SinonStub) + (client.descriptors.page.searchAllIamPolicies.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.searchAllResources, request) + .calledWith(client.innerApiCalls.searchAllIamPolicies, request) ); assert.strictEqual( ( - client.descriptors.page.searchAllResources.createStream as SinonStub + client.descriptors.page.searchAllIamPolicies.createStream as SinonStub ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('invokes searchAllResourcesStream with error', async () => { + it('invokes searchAllIamPoliciesStream with error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.SearchAllResourcesRequest() + new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() ); request.scope = ''; const expectedHeaderRequestParams = 'scope='; const expectedError = new Error('expected'); - client.descriptors.page.searchAllResources.createStream = + client.descriptors.page.searchAllIamPolicies.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.searchAllResourcesStream(request); + const stream = client.searchAllIamPoliciesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.asset.v1.ResourceSearchResult[] = + const responses: protos.google.cloud.asset.v1.IamPolicySearchResult[] = []; stream.on( 'data', - (response: protos.google.cloud.asset.v1.ResourceSearchResult) => { + (response: protos.google.cloud.asset.v1.IamPolicySearchResult) => { responses.push(response); } ); @@ -2144,80 +3097,80 @@ describe('v1.AssetServiceClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.searchAllResources.createStream as SinonStub) + (client.descriptors.page.searchAllIamPolicies.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.searchAllResources, request) + .calledWith(client.innerApiCalls.searchAllIamPolicies, request) ); assert.strictEqual( ( - client.descriptors.page.searchAllResources.createStream as SinonStub + client.descriptors.page.searchAllIamPolicies.createStream as SinonStub ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with searchAllResources without error', async () => { + it('uses async iteration with searchAllIamPolicies without error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.SearchAllResourcesRequest() + new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() ); request.scope = ''; const expectedHeaderRequestParams = 'scope='; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.asset.v1.ResourceSearchResult() + new protos.google.cloud.asset.v1.IamPolicySearchResult() ), generateSampleMessage( - new protos.google.cloud.asset.v1.ResourceSearchResult() + new protos.google.cloud.asset.v1.IamPolicySearchResult() ), generateSampleMessage( - new protos.google.cloud.asset.v1.ResourceSearchResult() + new protos.google.cloud.asset.v1.IamPolicySearchResult() ), ]; - client.descriptors.page.searchAllResources.asyncIterate = + client.descriptors.page.searchAllIamPolicies.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.asset.v1.IResourceSearchResult[] = + const responses: protos.google.cloud.asset.v1.IIamPolicySearchResult[] = []; - const iterable = client.searchAllResourcesAsync(request); + const iterable = client.searchAllIamPoliciesAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( ( - client.descriptors.page.searchAllResources.asyncIterate as SinonStub + client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub ).getCall(0).args[1], request ); assert.strictEqual( ( - client.descriptors.page.searchAllResources.asyncIterate as SinonStub + client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with searchAllResources with error', async () => { + it('uses async iteration with searchAllIamPolicies with error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.SearchAllResourcesRequest() + new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() ); request.scope = ''; const expectedHeaderRequestParams = 'scope='; const expectedError = new Error('expected'); - client.descriptors.page.searchAllResources.asyncIterate = + client.descriptors.page.searchAllIamPolicies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.searchAllResourcesAsync(request); + const iterable = client.searchAllIamPoliciesAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.asset.v1.IResourceSearchResult[] = + const responses: protos.google.cloud.asset.v1.IIamPolicySearchResult[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -2225,31 +3178,31 @@ describe('v1.AssetServiceClient', () => { }); assert.deepStrictEqual( ( - client.descriptors.page.searchAllResources.asyncIterate as SinonStub + client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub ).getCall(0).args[1], request ); assert.strictEqual( ( - client.descriptors.page.searchAllResources.asyncIterate as SinonStub + client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); }); - describe('searchAllIamPolicies', () => { - it('invokes searchAllIamPolicies without error', async () => { + describe('listSavedQueries', () => { + it('invokes listSavedQueries without error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() + new protos.google.cloud.asset.v1.ListSavedQueriesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; const expectedOptions = { otherArgs: { headers: { @@ -2258,38 +3211,31 @@ describe('v1.AssetServiceClient', () => { }, }; const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.asset.v1.IamPolicySearchResult() - ), - generateSampleMessage( - new protos.google.cloud.asset.v1.IamPolicySearchResult() - ), - generateSampleMessage( - new protos.google.cloud.asset.v1.IamPolicySearchResult() - ), + generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), ]; - client.innerApiCalls.searchAllIamPolicies = - stubSimpleCall(expectedResponse); - const [response] = await client.searchAllIamPolicies(request); + client.innerApiCalls.listSavedQueries = stubSimpleCall(expectedResponse); + const [response] = await client.listSavedQueries(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.searchAllIamPolicies as SinonStub) + (client.innerApiCalls.listSavedQueries as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes searchAllIamPolicies without error using callback', async () => { + it('invokes listSavedQueries without error using callback', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() + new protos.google.cloud.asset.v1.ListSavedQueriesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; const expectedOptions = { otherArgs: { headers: { @@ -2298,26 +3244,18 @@ describe('v1.AssetServiceClient', () => { }, }; const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.asset.v1.IamPolicySearchResult() - ), - generateSampleMessage( - new protos.google.cloud.asset.v1.IamPolicySearchResult() - ), - generateSampleMessage( - new protos.google.cloud.asset.v1.IamPolicySearchResult() - ), + generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), ]; - client.innerApiCalls.searchAllIamPolicies = + client.innerApiCalls.listSavedQueries = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.searchAllIamPolicies( + client.listSavedQueries( request, ( err?: Error | null, - result?: - | protos.google.cloud.asset.v1.IIamPolicySearchResult[] - | null + result?: protos.google.cloud.asset.v1.ISavedQuery[] | null ) => { if (err) { reject(err); @@ -2330,23 +3268,23 @@ describe('v1.AssetServiceClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.searchAllIamPolicies as SinonStub) + (client.innerApiCalls.listSavedQueries as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes searchAllIamPolicies with error', async () => { + it('invokes listSavedQueries with error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() + new protos.google.cloud.asset.v1.ListSavedQueriesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; const expectedOptions = { otherArgs: { headers: { @@ -2355,49 +3293,42 @@ describe('v1.AssetServiceClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.searchAllIamPolicies = stubSimpleCall( + client.innerApiCalls.listSavedQueries = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.searchAllIamPolicies(request), expectedError); + await assert.rejects(client.listSavedQueries(request), expectedError); assert( - (client.innerApiCalls.searchAllIamPolicies as SinonStub) + (client.innerApiCalls.listSavedQueries as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes searchAllIamPoliciesStream without error', async () => { + it('invokes listSavedQueriesStream without error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() + new protos.google.cloud.asset.v1.ListSavedQueriesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.asset.v1.IamPolicySearchResult() - ), - generateSampleMessage( - new protos.google.cloud.asset.v1.IamPolicySearchResult() - ), - generateSampleMessage( - new protos.google.cloud.asset.v1.IamPolicySearchResult() - ), + generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), ]; - client.descriptors.page.searchAllIamPolicies.createStream = + client.descriptors.page.listSavedQueries.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.searchAllIamPoliciesStream(request); + const stream = client.listSavedQueriesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.asset.v1.IamPolicySearchResult[] = - []; + const responses: protos.google.cloud.asset.v1.SavedQuery[] = []; stream.on( 'data', - (response: protos.google.cloud.asset.v1.IamPolicySearchResult) => { + (response: protos.google.cloud.asset.v1.SavedQuery) => { responses.push(response); } ); @@ -2411,39 +3342,38 @@ describe('v1.AssetServiceClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.searchAllIamPolicies.createStream as SinonStub) + (client.descriptors.page.listSavedQueries.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.searchAllIamPolicies, request) + .calledWith(client.innerApiCalls.listSavedQueries, request) ); assert.strictEqual( ( - client.descriptors.page.searchAllIamPolicies.createStream as SinonStub + client.descriptors.page.listSavedQueries.createStream as SinonStub ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('invokes searchAllIamPoliciesStream with error', async () => { + it('invokes listSavedQueriesStream with error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() + new protos.google.cloud.asset.v1.ListSavedQueriesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.searchAllIamPolicies.createStream = + client.descriptors.page.listSavedQueries.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.searchAllIamPoliciesStream(request); + const stream = client.listSavedQueriesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.asset.v1.IamPolicySearchResult[] = - []; + const responses: protos.google.cloud.asset.v1.SavedQuery[] = []; stream.on( 'data', - (response: protos.google.cloud.asset.v1.IamPolicySearchResult) => { + (response: protos.google.cloud.asset.v1.SavedQuery) => { responses.push(response); } ); @@ -2456,94 +3386,86 @@ describe('v1.AssetServiceClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.searchAllIamPolicies.createStream as SinonStub) + (client.descriptors.page.listSavedQueries.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.searchAllIamPolicies, request) + .calledWith(client.innerApiCalls.listSavedQueries, request) ); assert.strictEqual( ( - client.descriptors.page.searchAllIamPolicies.createStream as SinonStub + client.descriptors.page.listSavedQueries.createStream as SinonStub ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with searchAllIamPolicies without error', async () => { + it('uses async iteration with listSavedQueries without error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() + new protos.google.cloud.asset.v1.ListSavedQueriesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.asset.v1.IamPolicySearchResult() - ), - generateSampleMessage( - new protos.google.cloud.asset.v1.IamPolicySearchResult() - ), - generateSampleMessage( - new protos.google.cloud.asset.v1.IamPolicySearchResult() - ), + generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), ]; - client.descriptors.page.searchAllIamPolicies.asyncIterate = + client.descriptors.page.listSavedQueries.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.asset.v1.IIamPolicySearchResult[] = - []; - const iterable = client.searchAllIamPoliciesAsync(request); + const responses: protos.google.cloud.asset.v1.ISavedQuery[] = []; + const iterable = client.listSavedQueriesAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( ( - client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub + client.descriptors.page.listSavedQueries.asyncIterate as SinonStub ).getCall(0).args[1], request ); assert.strictEqual( ( - client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub + client.descriptors.page.listSavedQueries.asyncIterate as SinonStub ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with searchAllIamPolicies with error', async () => { + it('uses async iteration with listSavedQueries with error', async () => { const client = new assetserviceModule.v1.AssetServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() + new protos.google.cloud.asset.v1.ListSavedQueriesRequest() ); - request.scope = ''; - const expectedHeaderRequestParams = 'scope='; + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.searchAllIamPolicies.asyncIterate = + client.descriptors.page.listSavedQueries.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.searchAllIamPoliciesAsync(request); + const iterable = client.listSavedQueriesAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.asset.v1.IIamPolicySearchResult[] = - []; + const responses: protos.google.cloud.asset.v1.ISavedQuery[] = []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( ( - client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub + client.descriptors.page.listSavedQueries.asyncIterate as SinonStub ).getCall(0).args[1], request ); assert.strictEqual( ( - client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub + client.descriptors.page.listSavedQueries.asyncIterate as SinonStub ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); @@ -2690,6 +3612,61 @@ describe('v1.AssetServiceClient', () => { }); }); + describe('folderSavedQuery', () => { + const fakePath = '/rendered/path/folderSavedQuery'; + const expectedParameters = { + folder: 'folderValue', + saved_query: 'savedQueryValue', + }; + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderSavedQueryPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderSavedQueryPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderSavedQueryPath', () => { + const result = client.folderSavedQueryPath( + 'folderValue', + 'savedQueryValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderSavedQueryPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderSavedQueryName', () => { + const result = client.matchFolderFromFolderSavedQueryName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + (client.pathTemplates.folderSavedQueryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSavedQueryFromFolderSavedQueryName', () => { + const result = client.matchSavedQueryFromFolderSavedQueryName(fakePath); + assert.strictEqual(result, 'savedQueryValue'); + assert( + (client.pathTemplates.folderSavedQueryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('inventory', () => { const fakePath = '/rendered/path/inventory'; const expectedParameters = { @@ -2810,6 +3787,107 @@ describe('v1.AssetServiceClient', () => { }); }); + describe('organizationSavedQuery', () => { + const fakePath = '/rendered/path/organizationSavedQuery'; + const expectedParameters = { + organization: 'organizationValue', + saved_query: 'savedQueryValue', + }; + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationSavedQueryPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationSavedQueryPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationSavedQueryPath', () => { + const result = client.organizationSavedQueryPath( + 'organizationValue', + 'savedQueryValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationSavedQueryPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationSavedQueryName', () => { + const result = + client.matchOrganizationFromOrganizationSavedQueryName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationSavedQueryPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSavedQueryFromOrganizationSavedQueryName', () => { + const result = + client.matchSavedQueryFromOrganizationSavedQueryName(fakePath); + assert.strictEqual(result, 'savedQueryValue'); + assert( + ( + client.pathTemplates.organizationSavedQueryPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('projectFeed', () => { const fakePath = '/rendered/path/projectFeed'; const expectedParameters = { @@ -2859,6 +3937,68 @@ describe('v1.AssetServiceClient', () => { }); }); + describe('projectSavedQuery', () => { + const fakePath = '/rendered/path/projectSavedQuery'; + const expectedParameters = { + project: 'projectValue', + saved_query: 'savedQueryValue', + }; + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectSavedQueryPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectSavedQueryPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectSavedQueryPath', () => { + const result = client.projectSavedQueryPath( + 'projectValue', + 'savedQueryValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectSavedQueryPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectSavedQueryName', () => { + const result = client.matchProjectFromProjectSavedQueryName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectSavedQueryPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSavedQueryFromProjectSavedQueryName', () => { + const result = + client.matchSavedQueryFromProjectSavedQueryName(fakePath); + assert.strictEqual(result, 'savedQueryValue'); + assert( + ( + client.pathTemplates.projectSavedQueryPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('servicePerimeter', () => { const fakePath = '/rendered/path/servicePerimeter'; const expectedParameters = {