diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1p4beta1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1p4beta1/asset_service.proto new file mode 100644 index 00000000000..db60941a567 --- /dev/null +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1p4beta1/asset_service.proto @@ -0,0 +1,343 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.asset.v1p4beta1; + +import "google/api/annotations.proto"; +import "google/api/field_behavior.proto"; +import "google/cloud/asset/v1p4beta1/assets.proto"; +import "google/iam/v1/policy.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/api/client.proto"; + +option csharp_namespace = "Google.Cloud.Asset.V1P4Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1p4beta1;asset"; +option java_multiple_files = true; +option java_outer_classname = "AssetServiceProto"; +option java_package = "com.google.cloud.asset.v1p4beta1"; +option php_namespace = "Google\\Cloud\\Asset\\V1p4beta1"; + +// 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"; + + // Analyzes IAM policies based on the specified request. Returns + // a list of [IamPolicyAnalysisResult][google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult] matching the request. + rpc AnalyzeIamPolicy(AnalyzeIamPolicyRequest) returns (AnalyzeIamPolicyResponse) { + option (google.api.http) = { + get: "/v1p4beta1/{analysis_query.parent=*/*}:analyzeIamPolicy" + }; + } + + // Exports IAM policy analysis based on the specified request. This API + // implements the [google.longrunning.Operation][google.longrunning.Operation] API allowing you to keep + // track of the export. The metadata contains the request to help callers to + // map responses to requests. + rpc ExportIamPolicyAnalysis(ExportIamPolicyAnalysisRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1p4beta1/{analysis_query.parent=*/*}:exportIamPolicyAnalysis" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse" + metadata_type: "google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest" + }; + } +} + +// 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 + // projects. At least one of [ResourceSelector][google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector], [IdentitySelector][google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector] or + // [AccessSelector][google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector] must be specified in a request. + message ResourceSelector { + // Required. The [full resource + // name](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // . + string full_resource_name = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Specifies an identity for which to determine resource access, based on + // 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 + // [IAM policy + // binding](https://cloud.google.com/iam/reference/rest/v1/Binding). + string identity = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Specifies roles and/or permissions to analyze, to determine both the + // identities possessing them and the resources they control. If multiple + // values are specified, results will include identities and resources + // matching any of them. + message AccessSelector { + // Optional. The roles to appear in result. + repeated string roles = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The permissions to appear in result. + repeated string permissions = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The relative name of the root asset. Only resources and IAM policies within + // the parent will be analyzed. This can only be an organization number (such + // as "organizations/123") or a folder number (such as "folders/123"). + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Specifies a resource for analysis. Leaving it empty means ANY. + ResourceSelector resource_selector = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies an identity for analysis. Leaving it empty means ANY. + IdentitySelector identity_selector = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies roles or permissions for analysis. Leaving it empty + // means ANY. + AccessSelector access_selector = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// A request message for [AssetService.AnalyzeIamPolicy][google.cloud.asset.v1p4beta1.AssetService.AnalyzeIamPolicy]. +message AnalyzeIamPolicyRequest { + // Contains request options. + message Options { + // Optional. If true, the identities section of the result will expand any + // Google groups appearing in an IAM policy binding. + // + // If [identity_selector][] is specified, the identity in the result will + // be determined by the selector, and this flag will have no effect. + // + // Default is false. + bool expand_groups = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, the access section of result will expand any roles + // appearing in IAM policy bindings to include their permissions. + // + // If [access_selector][] is specified, the access section of the result + // will be determined by the selector, and this flag will have no effect. + // + // Default is false. + bool expand_roles = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, 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 [resource_selector][] is specified, the resource section of the result + // will be determined by the selector, and this flag will have no effect. + // 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. + 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. + 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 ExportIamPolicyAnalysis 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 + // iam.serviceAccounts.getAccessToken permission to a service account SA, + // and there's another IAM policy states service account SA has permission P + // to a GCP folder F, then user A potentially has access to the GCP folder + // F. And those advanced analysis results will be included in + // [AnalyzeIamPolicyResponse.service_account_impersonation_analysis][google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis]. + // + // Another example, if the request analyzes for who has + // permission P to a GCP folder F, and there's an IAM policy states user A + // has iam.serviceAccounts.actAs permission to a service account SA, and + // there's another IAM policy states service account SA has permission P to + // the GCP folder F, then user A potentially has access to the GCP folder + // F. And those advanced analysis results will be included in + // [AnalyzeIamPolicyResponse.service_account_impersonation_analysis][google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis]. + // + // Default is false. + bool analyze_service_account_impersonation = 6 [(google.api.field_behavior) = OPTIONAL]; + + // 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 + // execution timeout, you will get a response with partial result. + // Otherwise, your query's execution will continue until the RPC deadline. + // If it's not finished until then, you will get a DEADLINE_EXCEEDED error. + // + // Default is empty. + google.protobuf.Duration execution_timeout = 7 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The request query. + IamPolicyAnalysisQuery analysis_query = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The request options. + Options options = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// A response message for [AssetService.AnalyzeIamPolicy][google.cloud.asset.v1p4beta1.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.v1p4beta1.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.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.analysis_results] have been + // fully explored to answer the query. + bool fully_explored = 3; + } + + // The main analysis that matches the original request. + IamPolicyAnalysis main_analysis = 1; + + // The service account impersonation analysis if + // [AnalyzeIamPolicyRequest.analyze_service_account_impersonation][] is + // enabled. + repeated IamPolicyAnalysis service_account_impersonation_analysis = 2; + + // Represents whether all entries in the [main_analysis][google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.main_analysis] and + // [service_account_impersonation_analysis][google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis] have been fully explored to + // answer the query in the request. + bool fully_explored = 3; + + // A list of non-critical errors happened during the request handling to + // explain why `fully_explored` is false, or empty if no error happened. + repeated IamPolicyAnalysisResult.AnalysisState non_critical_errors = 4; +} + +// Output configuration for export IAM policy analysis destination. +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. For example: "gs://bucket_name/object_name". See [Viewing and + // Editing Object + // Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) + // for more information. + string uri = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // IAM policy analysis export destination. + oneof destination { + // Destination on Cloud Storage. + GcsDestination gcs_destination = 1; + } +} + +// A request message for [AssetService.ExportIamPolicyAnalysis][google.cloud.asset.v1p4beta1.AssetService.ExportIamPolicyAnalysis]. +message ExportIamPolicyAnalysisRequest { + // Contains request options. + message Options { + // Optional. If true, the identities section of the result will expand any + // Google groups appearing in an IAM policy binding. + // + // If [identity_selector][] is specified, the identity in the result will + // be determined by the selector, and this flag will have no effect. + // + // Default is false. + bool expand_groups = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, the access section of result will expand any roles + // appearing in IAM policy bindings to include their permissions. + // + // If [access_selector][] is specified, the access section of the result + // will be determined by the selector, and this flag will have no effect. + // + // Default is false. + bool expand_roles = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, 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 [resource_selector][] is specified, the resource section of the result + // will be determined by the selector, and this flag will have no effect. + // 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. + 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. + 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. + // + // For example, if the request analyzes for which resources user A has + // permission P, and there's an IAM policy states user A has + // iam.serviceAccounts.getAccessToken permission to a service account SA, + // and there's another IAM policy states service account SA has permission P + // to a GCP folder F, then user A potentially has access to the GCP folder + // F. And those advanced analysis results will be included in + // [AnalyzeIamPolicyResponse.service_account_impersonation_analysis][google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis]. + // + // Another example, if the request analyzes for who has + // permission P to a GCP folder F, and there's an IAM policy states user A + // has iam.serviceAccounts.actAs permission to a service account SA, and + // there's another IAM policy states service account SA has permission P to + // the GCP folder F, then user A potentially has access to the GCP folder + // F. And those advanced analysis results will be included in + // [AnalyzeIamPolicyResponse.service_account_impersonation_analysis][google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis]. + // + // Default is false. + bool analyze_service_account_impersonation = 6 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The request query. + IamPolicyAnalysisQuery analysis_query = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The request options. + Options options = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Output configuration indicating where the results will be output to. + IamPolicyAnalysisOutputConfig output_config = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The export IAM policy analysis response. This message is returned by the +// [google.longrunning.Operations.GetOperation][] method in the returned +// [google.longrunning.Operation.response][] field. +message ExportIamPolicyAnalysisResponse { + // Output configuration indicating where the results were output to. + IamPolicyAnalysisOutputConfig output_config = 1; +} diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1p4beta1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1p4beta1/assets.proto new file mode 100644 index 00000000000..0d7c5e055be --- /dev/null +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1p4beta1/assets.proto @@ -0,0 +1,167 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.asset.v1p4beta1; + +import "google/iam/v1/policy.proto"; +import "google/rpc/code.proto"; +import "google/api/annotations.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Asset.V1P4Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1p4beta1;asset"; +option java_multiple_files = true; +option java_outer_classname = "AssetProto"; +option java_package = "com.google.cloud.asset.v1p4beta1"; +option php_namespace = "Google\\Cloud\\Asset\\V1p4beta1"; + +// IAM Policy analysis result, consisting of one IAM policy binding and derived +// access control lists. +message IamPolicyAnalysisResult { + // Represents analysis state of each node in the result graph or non-critical + // errors in the response. + message AnalysisState { + // The Google standard error code that best describes the state. + // For example: + // - OK means the node has been successfully explored; + // - PERMISSION_DENIED means an access denied error is encountered; + // - DEADLINE_EXCEEDED means the node hasn't been explored in time; + google.rpc.Code code = 1; + + // The human-readable description of the cause of failure. + string cause = 2; + } + + // A GCP resource that appears in an access control list. + message Resource { + // The [full resource name](https://aip.dev/122#full-resource-names). + string full_resource_name = 1; + + // The analysis state of this resource node. + AnalysisState analysis_state = 2; + } + + // A role or permission that appears in an access control list. + message Access { + oneof oneof_access { + // The role. + string role = 1; + + // The permission. + string permission = 2; + } + + // The analysis state of this access node. + AnalysisState analysis_state = 3; + } + + // A directional edge. + message Edge { + // The source node of the edge. + string source_node = 1; + + // The target node of the edge. + string target_node = 2; + } + + // An identity that appears in an access control list. + message Identity { + // The identity name in any form of members appear in + // [IAM policy + // binding](https://cloud.google.com/iam/reference/rest/v1/Binding), such + // as: + // - user:foo@google.com + // - group:group1@google.com + // - serviceAccount:s1@prj1.iam.gserviceaccount.com + // - projectOwner:some_project_id + // - domain:google.com + // - allUsers + // - etc. + string name = 1; + + // The analysis state of this identity node. + AnalysisState analysis_state = 2; + } + + // An access control list, derived from the above IAM policy binding, which + // contains a set of resources and accesses. May include one + // item from each set to compose an access control entry. + // + // NOTICE that there could be multiple access control lists for one IAM policy + // binding. The access control lists are created based on resource and access + // combinations. + // + // For example, assume we have the following cases in one IAM policy binding: + // - Permission P1 and P2 apply to resource R1 and R2; + // - Permission P3 applies to resource R2 and R3; + // + // This will result in the following access control lists: + // - AccessControlList 1: [R1, R2], [P1, P2] + // - AccessControlList 2: [R2, R3], [P3] + message AccessControlList { + // The resources that match one of the following conditions: + // - The resource_selector, if it is specified in request; + // - Otherwise, resources reachable from the policy attached resource. + repeated Resource resources = 1; + + // The accesses that match one of the following conditions: + // - The access_selector, if it is specified in request; + // - Otherwise, access specifiers reachable from the policy binding's role. + 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.v1p4beta1.IamPolicyAnalysisResult.Edge.source_node] contains + // the full resource name of a parent resource and [Edge.target_node][google.cloud.asset.v1p4beta1.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; + } + + message IdentityList { + // Only the identities that match one of the following conditions will be + // presented: + // - The identity_selector, if it is specified in request; + // - Otherwise, identities reachable from the policy binding's members. + 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.v1p4beta1.IamPolicyAnalysisResult.IdentityList.identities]. The [Edge.source_node][google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.source_node] + // contains a group, such as "group:parent@google.com". The + // [Edge.target_node][google.cloud.asset.v1p4beta1.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 name of the resource to which the [iam_binding][google.cloud.asset.v1p4beta1.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.v1p4beta1.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.v1p4beta1.IamPolicyAnalysisResult.iam_binding] that match or + // potentially match identity selector specified in the request. + IdentityList identity_list = 4; + + // Represents whether all nodes in the transitive closure of the + // [iam_binding][google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.iam_binding] node have been explored. + 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 9788e56fd5c..172eabfcca5 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -5623,6 +5623,2206 @@ export namespace google { public toJSON(): { [k: string]: any }; } } + + /** Namespace v1p4beta1. */ + namespace v1p4beta1 { + + /** Represents an AssetService */ + class AssetService extends $protobuf.rpc.Service { + + /** + * Constructs a new AssetService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new AssetService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): AssetService; + + /** + * Calls AnalyzeIamPolicy. + * @param request AnalyzeIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnalyzeIamPolicyResponse + */ + public analyzeIamPolicy(request: google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest, callback: google.cloud.asset.v1p4beta1.AssetService.AnalyzeIamPolicyCallback): void; + + /** + * Calls AnalyzeIamPolicy. + * @param request AnalyzeIamPolicyRequest message or plain object + * @returns Promise + */ + public analyzeIamPolicy(request: google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest): Promise; + + /** + * Calls ExportIamPolicyAnalysis. + * @param request ExportIamPolicyAnalysisRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportIamPolicyAnalysis(request: google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest, callback: google.cloud.asset.v1p4beta1.AssetService.ExportIamPolicyAnalysisCallback): void; + + /** + * Calls ExportIamPolicyAnalysis. + * @param request ExportIamPolicyAnalysisRequest message or plain object + * @returns Promise + */ + public exportIamPolicyAnalysis(request: google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest): Promise; + } + + namespace AssetService { + + /** + * Callback as used by {@link google.cloud.asset.v1p4beta1.AssetService#analyzeIamPolicy}. + * @param error Error, if any + * @param [response] AnalyzeIamPolicyResponse + */ + type AnalyzeIamPolicyCallback = (error: (Error|null), response?: google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1p4beta1.AssetService#exportIamPolicyAnalysis}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportIamPolicyAnalysisCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an IamPolicyAnalysisQuery. */ + interface IIamPolicyAnalysisQuery { + + /** IamPolicyAnalysisQuery parent */ + parent?: (string|null); + + /** IamPolicyAnalysisQuery resourceSelector */ + resourceSelector?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IResourceSelector|null); + + /** IamPolicyAnalysisQuery identitySelector */ + identitySelector?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IIdentitySelector|null); + + /** IamPolicyAnalysisQuery accessSelector */ + accessSelector?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IAccessSelector|null); + } + + /** Represents an IamPolicyAnalysisQuery. */ + class IamPolicyAnalysisQuery implements IIamPolicyAnalysisQuery { + + /** + * Constructs a new IamPolicyAnalysisQuery. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery); + + /** IamPolicyAnalysisQuery parent. */ + public parent: string; + + /** IamPolicyAnalysisQuery resourceSelector. */ + public resourceSelector?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IResourceSelector|null); + + /** IamPolicyAnalysisQuery identitySelector. */ + public identitySelector?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IIdentitySelector|null); + + /** IamPolicyAnalysisQuery accessSelector. */ + public accessSelector?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IAccessSelector|null); + + /** + * Creates a new IamPolicyAnalysisQuery instance using the specified properties. + * @param [properties] Properties to set + * @returns IamPolicyAnalysisQuery instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery): google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery; + + /** + * Encodes the specified IamPolicyAnalysisQuery message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.verify|verify} messages. + * @param message IamPolicyAnalysisQuery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamPolicyAnalysisQuery message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.verify|verify} messages. + * @param message IamPolicyAnalysisQuery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IamPolicyAnalysisQuery message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IamPolicyAnalysisQuery + * @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.v1p4beta1.IamPolicyAnalysisQuery; + + /** + * Decodes an IamPolicyAnalysisQuery message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IamPolicyAnalysisQuery + * @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.v1p4beta1.IamPolicyAnalysisQuery; + + /** + * Verifies an IamPolicyAnalysisQuery 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 IamPolicyAnalysisQuery message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IamPolicyAnalysisQuery + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery; + + /** + * Creates a plain object from an IamPolicyAnalysisQuery message. Also converts values to other types if specified. + * @param message IamPolicyAnalysisQuery + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamPolicyAnalysisQuery to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace IamPolicyAnalysisQuery { + + /** Properties of a ResourceSelector. */ + interface IResourceSelector { + + /** ResourceSelector fullResourceName */ + fullResourceName?: (string|null); + } + + /** Represents a ResourceSelector. */ + class ResourceSelector implements IResourceSelector { + + /** + * Constructs a new ResourceSelector. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IResourceSelector); + + /** ResourceSelector fullResourceName. */ + public fullResourceName: string; + + /** + * Creates a new ResourceSelector instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceSelector instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IResourceSelector): google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector; + + /** + * Encodes the specified ResourceSelector message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector.verify|verify} messages. + * @param message ResourceSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IResourceSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceSelector message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector.verify|verify} messages. + * @param message ResourceSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IResourceSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceSelector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceSelector + * @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.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector; + + /** + * Decodes a ResourceSelector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceSelector + * @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.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector; + + /** + * Verifies a ResourceSelector 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 ResourceSelector message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceSelector + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector; + + /** + * Creates a plain object from a ResourceSelector message. Also converts values to other types if specified. + * @param message ResourceSelector + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceSelector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an IdentitySelector. */ + interface IIdentitySelector { + + /** IdentitySelector identity */ + identity?: (string|null); + } + + /** Represents an IdentitySelector. */ + class IdentitySelector implements IIdentitySelector { + + /** + * Constructs a new IdentitySelector. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IIdentitySelector); + + /** IdentitySelector identity. */ + public identity: string; + + /** + * Creates a new IdentitySelector instance using the specified properties. + * @param [properties] Properties to set + * @returns IdentitySelector instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IIdentitySelector): google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector; + + /** + * Encodes the specified IdentitySelector message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector.verify|verify} messages. + * @param message IdentitySelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IIdentitySelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IdentitySelector message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector.verify|verify} messages. + * @param message IdentitySelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IIdentitySelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IdentitySelector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IdentitySelector + * @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.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector; + + /** + * Decodes an IdentitySelector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IdentitySelector + * @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.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector; + + /** + * Verifies an IdentitySelector 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 IdentitySelector message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IdentitySelector + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector; + + /** + * Creates a plain object from an IdentitySelector message. Also converts values to other types if specified. + * @param message IdentitySelector + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IdentitySelector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AccessSelector. */ + interface IAccessSelector { + + /** AccessSelector roles */ + roles?: (string[]|null); + + /** AccessSelector permissions */ + permissions?: (string[]|null); + } + + /** Represents an AccessSelector. */ + class AccessSelector implements IAccessSelector { + + /** + * Constructs a new AccessSelector. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IAccessSelector); + + /** AccessSelector roles. */ + public roles: string[]; + + /** AccessSelector permissions. */ + public permissions: string[]; + + /** + * Creates a new AccessSelector instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessSelector instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IAccessSelector): google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector; + + /** + * Encodes the specified AccessSelector message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector.verify|verify} messages. + * @param message AccessSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IAccessSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessSelector message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector.verify|verify} messages. + * @param message AccessSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IAccessSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessSelector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessSelector + * @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.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector; + + /** + * Decodes an AccessSelector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessSelector + * @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.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector; + + /** + * Verifies an AccessSelector 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 AccessSelector message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessSelector + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector; + + /** + * Creates a plain object from an AccessSelector message. Also converts values to other types if specified. + * @param message AccessSelector + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessSelector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an AnalyzeIamPolicyRequest. */ + interface IAnalyzeIamPolicyRequest { + + /** AnalyzeIamPolicyRequest analysisQuery */ + analysisQuery?: (google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery|null); + + /** AnalyzeIamPolicyRequest options */ + options?: (google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.IOptions|null); + } + + /** Represents an AnalyzeIamPolicyRequest. */ + class AnalyzeIamPolicyRequest implements IAnalyzeIamPolicyRequest { + + /** + * Constructs a new AnalyzeIamPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest); + + /** AnalyzeIamPolicyRequest analysisQuery. */ + public analysisQuery?: (google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery|null); + + /** AnalyzeIamPolicyRequest options. */ + public options?: (google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.IOptions|null); + + /** + * Creates a new AnalyzeIamPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeIamPolicyRequest instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest): google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest; + + /** + * Encodes the specified AnalyzeIamPolicyRequest message. Does not implicitly {@link google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.verify|verify} messages. + * @param message AnalyzeIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzeIamPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.verify|verify} messages. + * @param message AnalyzeIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzeIamPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzeIamPolicyRequest + * @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.v1p4beta1.AnalyzeIamPolicyRequest; + + /** + * Decodes an AnalyzeIamPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzeIamPolicyRequest + * @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.v1p4beta1.AnalyzeIamPolicyRequest; + + /** + * Verifies an AnalyzeIamPolicyRequest 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 AnalyzeIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzeIamPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest; + + /** + * Creates a plain object from an AnalyzeIamPolicyRequest message. Also converts values to other types if specified. + * @param message AnalyzeIamPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzeIamPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace AnalyzeIamPolicyRequest { + + /** Properties of an Options. */ + interface IOptions { + + /** Options expandGroups */ + expandGroups?: (boolean|null); + + /** Options expandRoles */ + expandRoles?: (boolean|null); + + /** Options expandResources */ + expandResources?: (boolean|null); + + /** Options outputResourceEdges */ + outputResourceEdges?: (boolean|null); + + /** Options outputGroupEdges */ + outputGroupEdges?: (boolean|null); + + /** Options analyzeServiceAccountImpersonation */ + analyzeServiceAccountImpersonation?: (boolean|null); + + /** Options executionTimeout */ + executionTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents an Options. */ + class Options implements IOptions { + + /** + * Constructs a new Options. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.IOptions); + + /** Options expandGroups. */ + public expandGroups: boolean; + + /** Options expandRoles. */ + public expandRoles: boolean; + + /** Options expandResources. */ + public expandResources: boolean; + + /** Options outputResourceEdges. */ + public outputResourceEdges: boolean; + + /** Options outputGroupEdges. */ + public outputGroupEdges: boolean; + + /** Options analyzeServiceAccountImpersonation. */ + public analyzeServiceAccountImpersonation: boolean; + + /** Options executionTimeout. */ + public executionTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new Options instance using the specified properties. + * @param [properties] Properties to set + * @returns Options instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.IOptions): google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options; + + /** + * Encodes the specified Options message. Does not implicitly {@link google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options.verify|verify} messages. + * @param message Options message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.IOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Options message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options.verify|verify} messages. + * @param message Options message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.IOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Options message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Options + * @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.v1p4beta1.AnalyzeIamPolicyRequest.Options; + + /** + * Decodes an Options message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Options + * @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.v1p4beta1.AnalyzeIamPolicyRequest.Options; + + /** + * Verifies an Options 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 Options message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Options + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options; + + /** + * Creates a plain object from an Options message. Also converts values to other types if specified. + * @param message Options + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Options to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an AnalyzeIamPolicyResponse. */ + interface IAnalyzeIamPolicyResponse { + + /** AnalyzeIamPolicyResponse mainAnalysis */ + mainAnalysis?: (google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis|null); + + /** AnalyzeIamPolicyResponse serviceAccountImpersonationAnalysis */ + serviceAccountImpersonationAnalysis?: (google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis[]|null); + + /** AnalyzeIamPolicyResponse fullyExplored */ + fullyExplored?: (boolean|null); + + /** AnalyzeIamPolicyResponse nonCriticalErrors */ + nonCriticalErrors?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState[]|null); + } + + /** Represents an AnalyzeIamPolicyResponse. */ + class AnalyzeIamPolicyResponse implements IAnalyzeIamPolicyResponse { + + /** + * Constructs a new AnalyzeIamPolicyResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse); + + /** AnalyzeIamPolicyResponse mainAnalysis. */ + public mainAnalysis?: (google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis|null); + + /** AnalyzeIamPolicyResponse serviceAccountImpersonationAnalysis. */ + public serviceAccountImpersonationAnalysis: google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis[]; + + /** AnalyzeIamPolicyResponse fullyExplored. */ + public fullyExplored: boolean; + + /** AnalyzeIamPolicyResponse nonCriticalErrors. */ + public nonCriticalErrors: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState[]; + + /** + * Creates a new AnalyzeIamPolicyResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeIamPolicyResponse instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse): google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse; + + /** + * Encodes the specified AnalyzeIamPolicyResponse message. Does not implicitly {@link google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.verify|verify} messages. + * @param message AnalyzeIamPolicyResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzeIamPolicyResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.verify|verify} messages. + * @param message AnalyzeIamPolicyResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzeIamPolicyResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzeIamPolicyResponse + * @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.v1p4beta1.AnalyzeIamPolicyResponse; + + /** + * Decodes an AnalyzeIamPolicyResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzeIamPolicyResponse + * @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.v1p4beta1.AnalyzeIamPolicyResponse; + + /** + * Verifies an AnalyzeIamPolicyResponse 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 AnalyzeIamPolicyResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzeIamPolicyResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse; + + /** + * Creates a plain object from an AnalyzeIamPolicyResponse message. Also converts values to other types if specified. + * @param message AnalyzeIamPolicyResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzeIamPolicyResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace AnalyzeIamPolicyResponse { + + /** Properties of an IamPolicyAnalysis. */ + interface IIamPolicyAnalysis { + + /** IamPolicyAnalysis analysisQuery */ + analysisQuery?: (google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery|null); + + /** IamPolicyAnalysis analysisResults */ + analysisResults?: (google.cloud.asset.v1p4beta1.IIamPolicyAnalysisResult[]|null); + + /** IamPolicyAnalysis fullyExplored */ + fullyExplored?: (boolean|null); + } + + /** Represents an IamPolicyAnalysis. */ + class IamPolicyAnalysis implements IIamPolicyAnalysis { + + /** + * Constructs a new IamPolicyAnalysis. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis); + + /** IamPolicyAnalysis analysisQuery. */ + public analysisQuery?: (google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery|null); + + /** IamPolicyAnalysis analysisResults. */ + public analysisResults: google.cloud.asset.v1p4beta1.IIamPolicyAnalysisResult[]; + + /** IamPolicyAnalysis fullyExplored. */ + public fullyExplored: boolean; + + /** + * Creates a new IamPolicyAnalysis instance using the specified properties. + * @param [properties] Properties to set + * @returns IamPolicyAnalysis instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis): google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis; + + /** + * Encodes the specified IamPolicyAnalysis message. Does not implicitly {@link google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.verify|verify} messages. + * @param message IamPolicyAnalysis message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamPolicyAnalysis message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.verify|verify} messages. + * @param message IamPolicyAnalysis message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IamPolicyAnalysis message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IamPolicyAnalysis + * @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.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis; + + /** + * Decodes an IamPolicyAnalysis message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IamPolicyAnalysis + * @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.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis; + + /** + * Verifies an IamPolicyAnalysis 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 IamPolicyAnalysis message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IamPolicyAnalysis + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis; + + /** + * Creates a plain object from an IamPolicyAnalysis message. Also converts values to other types if specified. + * @param message IamPolicyAnalysis + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamPolicyAnalysis to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an IamPolicyAnalysisOutputConfig. */ + interface IIamPolicyAnalysisOutputConfig { + + /** IamPolicyAnalysisOutputConfig gcsDestination */ + gcsDestination?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.IGcsDestination|null); + } + + /** Represents an IamPolicyAnalysisOutputConfig. */ + class IamPolicyAnalysisOutputConfig implements IIamPolicyAnalysisOutputConfig { + + /** + * Constructs a new IamPolicyAnalysisOutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.IIamPolicyAnalysisOutputConfig); + + /** IamPolicyAnalysisOutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.IGcsDestination|null); + + /** IamPolicyAnalysisOutputConfig destination. */ + public destination?: "gcsDestination"; + + /** + * Creates a new IamPolicyAnalysisOutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns IamPolicyAnalysisOutputConfig instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.IIamPolicyAnalysisOutputConfig): google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig; + + /** + * Encodes the specified IamPolicyAnalysisOutputConfig message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.verify|verify} messages. + * @param message IamPolicyAnalysisOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.IIamPolicyAnalysisOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamPolicyAnalysisOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.verify|verify} messages. + * @param message IamPolicyAnalysisOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.IIamPolicyAnalysisOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IamPolicyAnalysisOutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IamPolicyAnalysisOutputConfig + * @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.v1p4beta1.IamPolicyAnalysisOutputConfig; + + /** + * Decodes an IamPolicyAnalysisOutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IamPolicyAnalysisOutputConfig + * @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.v1p4beta1.IamPolicyAnalysisOutputConfig; + + /** + * Verifies an IamPolicyAnalysisOutputConfig 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 IamPolicyAnalysisOutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IamPolicyAnalysisOutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig; + + /** + * Creates a plain object from an IamPolicyAnalysisOutputConfig message. Also converts values to other types if specified. + * @param message IamPolicyAnalysisOutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamPolicyAnalysisOutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace IamPolicyAnalysisOutputConfig { + + /** Properties of a GcsDestination. */ + interface IGcsDestination { + + /** GcsDestination uri */ + uri?: (string|null); + } + + /** Represents a GcsDestination. */ + class GcsDestination implements IGcsDestination { + + /** + * Constructs a new GcsDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.IGcsDestination); + + /** GcsDestination uri. */ + public uri: string; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsDestination instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.IGcsDestination): google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination; + + /** + * Verifies a GcsDestination message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @param message GcsDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an ExportIamPolicyAnalysisRequest. */ + interface IExportIamPolicyAnalysisRequest { + + /** ExportIamPolicyAnalysisRequest analysisQuery */ + analysisQuery?: (google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery|null); + + /** ExportIamPolicyAnalysisRequest options */ + options?: (google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.IOptions|null); + + /** ExportIamPolicyAnalysisRequest outputConfig */ + outputConfig?: (google.cloud.asset.v1p4beta1.IIamPolicyAnalysisOutputConfig|null); + } + + /** Represents an ExportIamPolicyAnalysisRequest. */ + class ExportIamPolicyAnalysisRequest implements IExportIamPolicyAnalysisRequest { + + /** + * Constructs a new ExportIamPolicyAnalysisRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest); + + /** ExportIamPolicyAnalysisRequest analysisQuery. */ + public analysisQuery?: (google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery|null); + + /** ExportIamPolicyAnalysisRequest options. */ + public options?: (google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.IOptions|null); + + /** ExportIamPolicyAnalysisRequest outputConfig. */ + public outputConfig?: (google.cloud.asset.v1p4beta1.IIamPolicyAnalysisOutputConfig|null); + + /** + * Creates a new ExportIamPolicyAnalysisRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportIamPolicyAnalysisRequest instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest): google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest; + + /** + * Encodes the specified ExportIamPolicyAnalysisRequest message. Does not implicitly {@link google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.verify|verify} messages. + * @param message ExportIamPolicyAnalysisRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportIamPolicyAnalysisRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.verify|verify} messages. + * @param message ExportIamPolicyAnalysisRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportIamPolicyAnalysisRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportIamPolicyAnalysisRequest + * @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.v1p4beta1.ExportIamPolicyAnalysisRequest; + + /** + * Decodes an ExportIamPolicyAnalysisRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportIamPolicyAnalysisRequest + * @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.v1p4beta1.ExportIamPolicyAnalysisRequest; + + /** + * Verifies an ExportIamPolicyAnalysisRequest 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 ExportIamPolicyAnalysisRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportIamPolicyAnalysisRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest; + + /** + * Creates a plain object from an ExportIamPolicyAnalysisRequest message. Also converts values to other types if specified. + * @param message ExportIamPolicyAnalysisRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportIamPolicyAnalysisRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ExportIamPolicyAnalysisRequest { + + /** Properties of an Options. */ + interface IOptions { + + /** Options expandGroups */ + expandGroups?: (boolean|null); + + /** Options expandRoles */ + expandRoles?: (boolean|null); + + /** Options expandResources */ + expandResources?: (boolean|null); + + /** Options outputResourceEdges */ + outputResourceEdges?: (boolean|null); + + /** Options outputGroupEdges */ + outputGroupEdges?: (boolean|null); + + /** Options analyzeServiceAccountImpersonation */ + analyzeServiceAccountImpersonation?: (boolean|null); + } + + /** Represents an Options. */ + class Options implements IOptions { + + /** + * Constructs a new Options. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.IOptions); + + /** Options expandGroups. */ + public expandGroups: boolean; + + /** Options expandRoles. */ + public expandRoles: boolean; + + /** Options expandResources. */ + public expandResources: boolean; + + /** Options outputResourceEdges. */ + public outputResourceEdges: boolean; + + /** Options outputGroupEdges. */ + public outputGroupEdges: boolean; + + /** Options analyzeServiceAccountImpersonation. */ + public analyzeServiceAccountImpersonation: boolean; + + /** + * Creates a new Options instance using the specified properties. + * @param [properties] Properties to set + * @returns Options instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.IOptions): google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options; + + /** + * Encodes the specified Options message. Does not implicitly {@link google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options.verify|verify} messages. + * @param message Options message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.IOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Options message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options.verify|verify} messages. + * @param message Options message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.IOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Options message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Options + * @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.v1p4beta1.ExportIamPolicyAnalysisRequest.Options; + + /** + * Decodes an Options message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Options + * @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.v1p4beta1.ExportIamPolicyAnalysisRequest.Options; + + /** + * Verifies an Options 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 Options message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Options + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options; + + /** + * Creates a plain object from an Options message. Also converts values to other types if specified. + * @param message Options + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Options to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an ExportIamPolicyAnalysisResponse. */ + interface IExportIamPolicyAnalysisResponse { + + /** ExportIamPolicyAnalysisResponse outputConfig */ + outputConfig?: (google.cloud.asset.v1p4beta1.IIamPolicyAnalysisOutputConfig|null); + } + + /** Represents an ExportIamPolicyAnalysisResponse. */ + class ExportIamPolicyAnalysisResponse implements IExportIamPolicyAnalysisResponse { + + /** + * Constructs a new ExportIamPolicyAnalysisResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse); + + /** ExportIamPolicyAnalysisResponse outputConfig. */ + public outputConfig?: (google.cloud.asset.v1p4beta1.IIamPolicyAnalysisOutputConfig|null); + + /** + * Creates a new ExportIamPolicyAnalysisResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportIamPolicyAnalysisResponse instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse): google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse; + + /** + * Encodes the specified ExportIamPolicyAnalysisResponse message. Does not implicitly {@link google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse.verify|verify} messages. + * @param message ExportIamPolicyAnalysisResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportIamPolicyAnalysisResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse.verify|verify} messages. + * @param message ExportIamPolicyAnalysisResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportIamPolicyAnalysisResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportIamPolicyAnalysisResponse + * @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.v1p4beta1.ExportIamPolicyAnalysisResponse; + + /** + * Decodes an ExportIamPolicyAnalysisResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportIamPolicyAnalysisResponse + * @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.v1p4beta1.ExportIamPolicyAnalysisResponse; + + /** + * Verifies an ExportIamPolicyAnalysisResponse 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 ExportIamPolicyAnalysisResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportIamPolicyAnalysisResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse; + + /** + * Creates a plain object from an ExportIamPolicyAnalysisResponse message. Also converts values to other types if specified. + * @param message ExportIamPolicyAnalysisResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportIamPolicyAnalysisResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** 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.v1p4beta1.IamPolicyAnalysisResult.IAccessControlList[]|null); + + /** IamPolicyAnalysisResult identityList */ + identityList?: (google.cloud.asset.v1p4beta1.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.v1p4beta1.IIamPolicyAnalysisResult); + + /** IamPolicyAnalysisResult attachedResourceFullName. */ + public attachedResourceFullName: string; + + /** IamPolicyAnalysisResult iamBinding. */ + public iamBinding?: (google.iam.v1.IBinding|null); + + /** IamPolicyAnalysisResult accessControlLists. */ + public accessControlLists: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccessControlList[]; + + /** IamPolicyAnalysisResult identityList. */ + public identityList?: (google.cloud.asset.v1p4beta1.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.v1p4beta1.IIamPolicyAnalysisResult): google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult; + + /** + * Encodes the specified IamPolicyAnalysisResult message. Does not implicitly {@link google.cloud.asset.v1p4beta1.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.v1p4beta1.IIamPolicyAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamPolicyAnalysisResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.IamPolicyAnalysisResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamPolicyAnalysisResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace IamPolicyAnalysisResult { + + /** Properties of an AnalysisState. */ + interface IAnalysisState { + + /** AnalysisState code */ + code?: (google.rpc.Code|keyof typeof google.rpc.Code|null); + + /** AnalysisState cause */ + cause?: (string|null); + } + + /** Represents an AnalysisState. */ + class AnalysisState implements IAnalysisState { + + /** + * Constructs a new AnalysisState. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState); + + /** AnalysisState code. */ + public code: (google.rpc.Code|keyof typeof google.rpc.Code); + + /** AnalysisState cause. */ + public cause: string; + + /** + * Creates a new AnalysisState instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalysisState instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState): google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState; + + /** + * Encodes the specified AnalysisState message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.verify|verify} messages. + * @param message AnalysisState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalysisState message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.verify|verify} messages. + * @param message AnalysisState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalysisState message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalysisState + * @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.v1p4beta1.IamPolicyAnalysisResult.AnalysisState; + + /** + * Decodes an AnalysisState message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalysisState + * @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.v1p4beta1.IamPolicyAnalysisResult.AnalysisState; + + /** + * Verifies an AnalysisState 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 AnalysisState message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalysisState + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState; + + /** + * Creates a plain object from an AnalysisState message. Also converts values to other types if specified. + * @param message AnalysisState + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalysisState to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Resource. */ + interface IResource { + + /** Resource fullResourceName */ + fullResourceName?: (string|null); + + /** Resource analysisState */ + analysisState?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState|null); + } + + /** Represents a Resource. */ + class Resource implements IResource { + + /** + * Constructs a new Resource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IResource); + + /** Resource fullResourceName. */ + public fullResourceName: string; + + /** Resource analysisState. */ + public analysisState?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState|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.v1p4beta1.IamPolicyAnalysisResult.IResource): google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1p4beta1.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.v1p4beta1.IamPolicyAnalysisResult.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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.v1p4beta1.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 */ + role?: (string|null); + + /** Access permission */ + permission?: (string|null); + + /** Access analysisState */ + analysisState?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState|null); + } + + /** Represents an Access. */ + class Access implements IAccess { + + /** + * Constructs a new Access. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccess); + + /** Access role. */ + public role: string; + + /** Access permission. */ + public permission: string; + + /** Access analysisState. */ + public analysisState?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState|null); + + /** Access oneofAccess. */ + public oneofAccess?: ("role"|"permission"); + + /** + * Creates a new Access instance using the specified properties. + * @param [properties] Properties to set + * @returns Access instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccess): google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access; + + /** + * Encodes the specified Access message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access.verify|verify} messages. + * @param message Access message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccess, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Access message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access.verify|verify} messages. + * @param message Access message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccess, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Access message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Access + * @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.v1p4beta1.IamPolicyAnalysisResult.Access; + + /** + * Decodes an Access message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Access + * @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.v1p4beta1.IamPolicyAnalysisResult.Access; + + /** + * Verifies an Access 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 Access message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Access + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access; + + /** + * Creates a plain object from an Access message. Also converts values to other types if specified. + * @param message Access + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Access to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Edge. */ + interface IEdge { + + /** Edge sourceNode */ + sourceNode?: (string|null); + + /** Edge targetNode */ + targetNode?: (string|null); + } + + /** Represents an Edge. */ + class Edge implements IEdge { + + /** + * Constructs a new Edge. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IEdge); + + /** Edge sourceNode. */ + public sourceNode: string; + + /** Edge targetNode. */ + public targetNode: string; + + /** + * Creates a new Edge instance using the specified properties. + * @param [properties] Properties to set + * @returns Edge instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IEdge): google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge; + + /** + * Encodes the specified Edge message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.verify|verify} messages. + * @param message Edge message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IEdge, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Edge message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.verify|verify} messages. + * @param message Edge message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IEdge, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Edge message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Edge + * @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.v1p4beta1.IamPolicyAnalysisResult.Edge; + + /** + * Decodes an Edge message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Edge + * @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.v1p4beta1.IamPolicyAnalysisResult.Edge; + + /** + * Verifies an Edge 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 Edge message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Edge + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge; + + /** + * Creates a plain object from an Edge message. Also converts values to other types if specified. + * @param message Edge + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Edge to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Identity. */ + interface IIdentity { + + /** Identity name */ + name?: (string|null); + + /** Identity analysisState */ + analysisState?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState|null); + } + + /** Represents an Identity. */ + class Identity implements IIdentity { + + /** + * Constructs a new Identity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentity); + + /** Identity name. */ + public name: string; + + /** Identity analysisState. */ + public analysisState?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState|null); + + /** + * Creates a new Identity instance using the specified properties. + * @param [properties] Properties to set + * @returns Identity instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentity): google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity; + + /** + * Encodes the specified Identity message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity.verify|verify} messages. + * @param message Identity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Identity message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity.verify|verify} messages. + * @param message Identity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Identity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Identity + * @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.v1p4beta1.IamPolicyAnalysisResult.Identity; + + /** + * Decodes an Identity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Identity + * @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.v1p4beta1.IamPolicyAnalysisResult.Identity; + + /** + * Verifies an Identity 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 Identity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Identity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity; + + /** + * Creates a plain object from an Identity message. Also converts values to other types if specified. + * @param message Identity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Identity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AccessControlList. */ + interface IAccessControlList { + + /** AccessControlList resources */ + resources?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IResource[]|null); + + /** AccessControlList accesses */ + accesses?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccess[]|null); + + /** AccessControlList resourceEdges */ + resourceEdges?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IEdge[]|null); + } + + /** Represents an AccessControlList. */ + class AccessControlList implements IAccessControlList { + + /** + * Constructs a new AccessControlList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccessControlList); + + /** AccessControlList resources. */ + public resources: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IResource[]; + + /** AccessControlList accesses. */ + public accesses: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccess[]; + + /** AccessControlList resourceEdges. */ + public resourceEdges: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IEdge[]; + + /** + * Creates a new AccessControlList instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessControlList instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccessControlList): google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList; + + /** + * Encodes the specified AccessControlList message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList.verify|verify} messages. + * @param message AccessControlList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccessControlList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessControlList message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList.verify|verify} messages. + * @param message AccessControlList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccessControlList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessControlList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessControlList + * @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.v1p4beta1.IamPolicyAnalysisResult.AccessControlList; + + /** + * Decodes an AccessControlList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessControlList + * @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.v1p4beta1.IamPolicyAnalysisResult.AccessControlList; + + /** + * Verifies an AccessControlList 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 AccessControlList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessControlList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList; + + /** + * Creates a plain object from an AccessControlList message. Also converts values to other types if specified. + * @param message AccessControlList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessControlList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an IdentityList. */ + interface IIdentityList { + + /** IdentityList identities */ + identities?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentity[]|null); + + /** IdentityList groupEdges */ + groupEdges?: (google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IEdge[]|null); + } + + /** Represents an IdentityList. */ + class IdentityList implements IIdentityList { + + /** + * Constructs a new IdentityList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentityList); + + /** IdentityList identities. */ + public identities: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentity[]; + + /** IdentityList groupEdges. */ + public groupEdges: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IEdge[]; + + /** + * Creates a new IdentityList instance using the specified properties. + * @param [properties] Properties to set + * @returns IdentityList instance + */ + public static create(properties?: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentityList): google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList; + + /** + * Encodes the specified IdentityList message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList.verify|verify} messages. + * @param message IdentityList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentityList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IdentityList message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList.verify|verify} messages. + * @param message IdentityList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentityList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IdentityList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IdentityList + * @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.v1p4beta1.IamPolicyAnalysisResult.IdentityList; + + /** + * Decodes an IdentityList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IdentityList + * @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.v1p4beta1.IamPolicyAnalysisResult.IdentityList; + + /** + * Verifies an IdentityList 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 IdentityList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IdentityList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList; + + /** + * Creates a plain object from an IdentityList message. Also converts values to other types if specified. + * @param message IdentityList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IdentityList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + } } } @@ -11778,5 +13978,26 @@ export namespace google { */ public toJSON(): { [k: string]: any }; } + + /** Code enum. */ + enum Code { + OK = 0, + CANCELLED = 1, + UNKNOWN = 2, + INVALID_ARGUMENT = 3, + DEADLINE_EXCEEDED = 4, + NOT_FOUND = 5, + ALREADY_EXISTS = 6, + PERMISSION_DENIED = 7, + UNAUTHENTICATED = 16, + RESOURCE_EXHAUSTED = 8, + FAILED_PRECONDITION = 9, + ABORTED = 10, + OUT_OF_RANGE = 11, + UNIMPLEMENTED = 12, + INTERNAL = 13, + UNAVAILABLE = 14, + DATA_LOSS = 15 + } } } diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index 9f2c7eccfac..9de100bbaec 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -13151,6 +13151,5300 @@ return v1p2beta1; })(); + asset.v1p4beta1 = (function() { + + /** + * Namespace v1p4beta1. + * @memberof google.cloud.asset + * @namespace + */ + var v1p4beta1 = {}; + + v1p4beta1.AssetService = (function() { + + /** + * Constructs a new AssetService service. + * @memberof google.cloud.asset.v1p4beta1 + * @classdesc Represents an AssetService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function AssetService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AssetService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AssetService; + + /** + * Creates new AssetService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.asset.v1p4beta1.AssetService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {AssetService} RPC service. Useful where requests and/or responses are streamed. + */ + AssetService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.asset.v1p4beta1.AssetService#analyzeIamPolicy}. + * @memberof google.cloud.asset.v1p4beta1.AssetService + * @typedef AnalyzeIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse} [response] AnalyzeIamPolicyResponse + */ + + /** + * Calls AnalyzeIamPolicy. + * @function analyzeIamPolicy + * @memberof google.cloud.asset.v1p4beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest} request AnalyzeIamPolicyRequest message or plain object + * @param {google.cloud.asset.v1p4beta1.AssetService.AnalyzeIamPolicyCallback} callback Node-style callback called with the error, if any, and AnalyzeIamPolicyResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.analyzeIamPolicy = function analyzeIamPolicy(request, callback) { + return this.rpcCall(analyzeIamPolicy, $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest, $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse, request, callback); + }, "name", { value: "AnalyzeIamPolicy" }); + + /** + * Calls AnalyzeIamPolicy. + * @function analyzeIamPolicy + * @memberof google.cloud.asset.v1p4beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest} request AnalyzeIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1p4beta1.AssetService#exportIamPolicyAnalysis}. + * @memberof google.cloud.asset.v1p4beta1.AssetService + * @typedef ExportIamPolicyAnalysisCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportIamPolicyAnalysis. + * @function exportIamPolicyAnalysis + * @memberof google.cloud.asset.v1p4beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest} request ExportIamPolicyAnalysisRequest message or plain object + * @param {google.cloud.asset.v1p4beta1.AssetService.ExportIamPolicyAnalysisCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.exportIamPolicyAnalysis = function exportIamPolicyAnalysis(request, callback) { + return this.rpcCall(exportIamPolicyAnalysis, $root.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportIamPolicyAnalysis" }); + + /** + * Calls ExportIamPolicyAnalysis. + * @function exportIamPolicyAnalysis + * @memberof google.cloud.asset.v1p4beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest} request ExportIamPolicyAnalysisRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AssetService; + })(); + + v1p4beta1.IamPolicyAnalysisQuery = (function() { + + /** + * Properties of an IamPolicyAnalysisQuery. + * @memberof google.cloud.asset.v1p4beta1 + * @interface IIamPolicyAnalysisQuery + * @property {string|null} [parent] IamPolicyAnalysisQuery parent + * @property {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IResourceSelector|null} [resourceSelector] IamPolicyAnalysisQuery resourceSelector + * @property {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IIdentitySelector|null} [identitySelector] IamPolicyAnalysisQuery identitySelector + * @property {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IAccessSelector|null} [accessSelector] IamPolicyAnalysisQuery accessSelector + */ + + /** + * Constructs a new IamPolicyAnalysisQuery. + * @memberof google.cloud.asset.v1p4beta1 + * @classdesc Represents an IamPolicyAnalysisQuery. + * @implements IIamPolicyAnalysisQuery + * @constructor + * @param {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery=} [properties] Properties to set + */ + function IamPolicyAnalysisQuery(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]]; + } + + /** + * IamPolicyAnalysisQuery parent. + * @member {string} parent + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery + * @instance + */ + IamPolicyAnalysisQuery.prototype.parent = ""; + + /** + * IamPolicyAnalysisQuery resourceSelector. + * @member {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IResourceSelector|null|undefined} resourceSelector + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery + * @instance + */ + IamPolicyAnalysisQuery.prototype.resourceSelector = null; + + /** + * IamPolicyAnalysisQuery identitySelector. + * @member {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IIdentitySelector|null|undefined} identitySelector + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery + * @instance + */ + IamPolicyAnalysisQuery.prototype.identitySelector = null; + + /** + * IamPolicyAnalysisQuery accessSelector. + * @member {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IAccessSelector|null|undefined} accessSelector + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery + * @instance + */ + IamPolicyAnalysisQuery.prototype.accessSelector = null; + + /** + * Creates a new IamPolicyAnalysisQuery instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery + * @static + * @param {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery} IamPolicyAnalysisQuery instance + */ + IamPolicyAnalysisQuery.create = function create(properties) { + return new IamPolicyAnalysisQuery(properties); + }; + + /** + * Encodes the specified IamPolicyAnalysisQuery message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery + * @static + * @param {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery} message IamPolicyAnalysisQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicyAnalysisQuery.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.resourceSelector != null && message.hasOwnProperty("resourceSelector")) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector.encode(message.resourceSelector, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identitySelector != null && message.hasOwnProperty("identitySelector")) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector.encode(message.identitySelector, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.accessSelector != null && message.hasOwnProperty("accessSelector")) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector.encode(message.accessSelector, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IamPolicyAnalysisQuery message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery + * @static + * @param {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery} message IamPolicyAnalysisQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicyAnalysisQuery.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IamPolicyAnalysisQuery message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery} IamPolicyAnalysisQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicyAnalysisQuery.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.v1p4beta1.IamPolicyAnalysisQuery(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.resourceSelector = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector.decode(reader, reader.uint32()); + break; + case 3: + message.identitySelector = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector.decode(reader, reader.uint32()); + break; + case 4: + message.accessSelector = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IamPolicyAnalysisQuery message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery} IamPolicyAnalysisQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicyAnalysisQuery.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IamPolicyAnalysisQuery message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IamPolicyAnalysisQuery.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.resourceSelector != null && message.hasOwnProperty("resourceSelector")) { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector.verify(message.resourceSelector); + if (error) + return "resourceSelector." + error; + } + if (message.identitySelector != null && message.hasOwnProperty("identitySelector")) { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector.verify(message.identitySelector); + if (error) + return "identitySelector." + error; + } + if (message.accessSelector != null && message.hasOwnProperty("accessSelector")) { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector.verify(message.accessSelector); + if (error) + return "accessSelector." + error; + } + return null; + }; + + /** + * Creates an IamPolicyAnalysisQuery message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery} IamPolicyAnalysisQuery + */ + IamPolicyAnalysisQuery.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.resourceSelector != null) { + if (typeof object.resourceSelector !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.resourceSelector: object expected"); + message.resourceSelector = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector.fromObject(object.resourceSelector); + } + if (object.identitySelector != null) { + if (typeof object.identitySelector !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.identitySelector: object expected"); + message.identitySelector = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector.fromObject(object.identitySelector); + } + if (object.accessSelector != null) { + if (typeof object.accessSelector !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.accessSelector: object expected"); + message.accessSelector = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector.fromObject(object.accessSelector); + } + return message; + }; + + /** + * Creates a plain object from an IamPolicyAnalysisQuery message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery} message IamPolicyAnalysisQuery + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IamPolicyAnalysisQuery.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.resourceSelector = null; + object.identitySelector = null; + object.accessSelector = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.resourceSelector != null && message.hasOwnProperty("resourceSelector")) + object.resourceSelector = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector.toObject(message.resourceSelector, options); + if (message.identitySelector != null && message.hasOwnProperty("identitySelector")) + object.identitySelector = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector.toObject(message.identitySelector, options); + if (message.accessSelector != null && message.hasOwnProperty("accessSelector")) + object.accessSelector = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector.toObject(message.accessSelector, options); + return object; + }; + + /** + * Converts this IamPolicyAnalysisQuery to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery + * @instance + * @returns {Object.} JSON object + */ + IamPolicyAnalysisQuery.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + IamPolicyAnalysisQuery.ResourceSelector = (function() { + + /** + * Properties of a ResourceSelector. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery + * @interface IResourceSelector + * @property {string|null} [fullResourceName] ResourceSelector fullResourceName + */ + + /** + * Constructs a new ResourceSelector. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery + * @classdesc Represents a ResourceSelector. + * @implements IResourceSelector + * @constructor + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IResourceSelector=} [properties] Properties to set + */ + function ResourceSelector(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]]; + } + + /** + * ResourceSelector fullResourceName. + * @member {string} fullResourceName + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector + * @instance + */ + ResourceSelector.prototype.fullResourceName = ""; + + /** + * Creates a new ResourceSelector instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IResourceSelector=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector} ResourceSelector instance + */ + ResourceSelector.create = function create(properties) { + return new ResourceSelector(properties); + }; + + /** + * Encodes the specified ResourceSelector message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IResourceSelector} message ResourceSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceSelector.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fullResourceName); + return writer; + }; + + /** + * Encodes the specified ResourceSelector message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IResourceSelector} message ResourceSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceSelector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceSelector message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector} ResourceSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceSelector.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.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fullResourceName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceSelector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector} ResourceSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceSelector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceSelector message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceSelector.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"; + return null; + }; + + /** + * Creates a ResourceSelector message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector} ResourceSelector + */ + ResourceSelector.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector(); + if (object.fullResourceName != null) + message.fullResourceName = String(object.fullResourceName); + return message; + }; + + /** + * Creates a plain object from a ResourceSelector message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector} message ResourceSelector + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceSelector.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.fullResourceName = ""; + if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + object.fullResourceName = message.fullResourceName; + return object; + }; + + /** + * Converts this ResourceSelector to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector + * @instance + * @returns {Object.} JSON object + */ + ResourceSelector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResourceSelector; + })(); + + IamPolicyAnalysisQuery.IdentitySelector = (function() { + + /** + * Properties of an IdentitySelector. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery + * @interface IIdentitySelector + * @property {string|null} [identity] IdentitySelector identity + */ + + /** + * Constructs a new IdentitySelector. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery + * @classdesc Represents an IdentitySelector. + * @implements IIdentitySelector + * @constructor + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IIdentitySelector=} [properties] Properties to set + */ + function IdentitySelector(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]]; + } + + /** + * IdentitySelector identity. + * @member {string} identity + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector + * @instance + */ + IdentitySelector.prototype.identity = ""; + + /** + * Creates a new IdentitySelector instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IIdentitySelector=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector} IdentitySelector instance + */ + IdentitySelector.create = function create(properties) { + return new IdentitySelector(properties); + }; + + /** + * Encodes the specified IdentitySelector message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IIdentitySelector} message IdentitySelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentitySelector.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identity != null && message.hasOwnProperty("identity")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.identity); + return writer; + }; + + /** + * Encodes the specified IdentitySelector message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IIdentitySelector} message IdentitySelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentitySelector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentitySelector message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector} IdentitySelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentitySelector.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.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identity = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IdentitySelector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector} IdentitySelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentitySelector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentitySelector message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentitySelector.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identity != null && message.hasOwnProperty("identity")) + if (!$util.isString(message.identity)) + return "identity: string expected"; + return null; + }; + + /** + * Creates an IdentitySelector message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector} IdentitySelector + */ + IdentitySelector.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector(); + if (object.identity != null) + message.identity = String(object.identity); + return message; + }; + + /** + * Creates a plain object from an IdentitySelector message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector} message IdentitySelector + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentitySelector.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.identity = ""; + if (message.identity != null && message.hasOwnProperty("identity")) + object.identity = message.identity; + return object; + }; + + /** + * Converts this IdentitySelector to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector + * @instance + * @returns {Object.} JSON object + */ + IdentitySelector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IdentitySelector; + })(); + + IamPolicyAnalysisQuery.AccessSelector = (function() { + + /** + * Properties of an AccessSelector. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery + * @interface IAccessSelector + * @property {Array.|null} [roles] AccessSelector roles + * @property {Array.|null} [permissions] AccessSelector permissions + */ + + /** + * Constructs a new AccessSelector. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery + * @classdesc Represents an AccessSelector. + * @implements IAccessSelector + * @constructor + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IAccessSelector=} [properties] Properties to set + */ + function AccessSelector(properties) { + this.roles = []; + this.permissions = []; + 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]]; + } + + /** + * AccessSelector roles. + * @member {Array.} roles + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector + * @instance + */ + AccessSelector.prototype.roles = $util.emptyArray; + + /** + * AccessSelector permissions. + * @member {Array.} permissions + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector + * @instance + */ + AccessSelector.prototype.permissions = $util.emptyArray; + + /** + * Creates a new AccessSelector instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IAccessSelector=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector} AccessSelector instance + */ + AccessSelector.create = function create(properties) { + return new AccessSelector(properties); + }; + + /** + * Encodes the specified AccessSelector message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IAccessSelector} message AccessSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessSelector.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.roles != null && message.roles.length) + for (var i = 0; i < message.roles.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.roles[i]); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.permissions[i]); + return writer; + }; + + /** + * Encodes the specified AccessSelector message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IAccessSelector} message AccessSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessSelector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessSelector message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector} AccessSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessSelector.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.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.roles && message.roles.length)) + message.roles = []; + message.roles.push(reader.string()); + break; + case 2: + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessSelector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector} AccessSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessSelector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessSelector message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessSelector.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.roles != null && message.hasOwnProperty("roles")) { + if (!Array.isArray(message.roles)) + return "roles: array expected"; + for (var i = 0; i < message.roles.length; ++i) + if (!$util.isString(message.roles[i])) + return "roles: string[] expected"; + } + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; + } + return null; + }; + + /** + * Creates an AccessSelector message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector} AccessSelector + */ + AccessSelector.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector(); + if (object.roles) { + if (!Array.isArray(object.roles)) + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector.roles: array expected"); + message.roles = []; + for (var i = 0; i < object.roles.length; ++i) + message.roles[i] = String(object.roles[i]); + } + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); + } + return message; + }; + + /** + * Creates a plain object from an AccessSelector message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector} message AccessSelector + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessSelector.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.roles = []; + object.permissions = []; + } + if (message.roles && message.roles.length) { + object.roles = []; + for (var j = 0; j < message.roles.length; ++j) + object.roles[j] = message.roles[j]; + } + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; + } + return object; + }; + + /** + * Converts this AccessSelector to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector + * @instance + * @returns {Object.} JSON object + */ + AccessSelector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AccessSelector; + })(); + + return IamPolicyAnalysisQuery; + })(); + + v1p4beta1.AnalyzeIamPolicyRequest = (function() { + + /** + * Properties of an AnalyzeIamPolicyRequest. + * @memberof google.cloud.asset.v1p4beta1 + * @interface IAnalyzeIamPolicyRequest + * @property {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery|null} [analysisQuery] AnalyzeIamPolicyRequest analysisQuery + * @property {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.IOptions|null} [options] AnalyzeIamPolicyRequest options + */ + + /** + * Constructs a new AnalyzeIamPolicyRequest. + * @memberof google.cloud.asset.v1p4beta1 + * @classdesc Represents an AnalyzeIamPolicyRequest. + * @implements IAnalyzeIamPolicyRequest + * @constructor + * @param {google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest=} [properties] Properties to set + */ + function AnalyzeIamPolicyRequest(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]]; + } + + /** + * AnalyzeIamPolicyRequest analysisQuery. + * @member {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery|null|undefined} analysisQuery + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest + * @instance + */ + AnalyzeIamPolicyRequest.prototype.analysisQuery = null; + + /** + * AnalyzeIamPolicyRequest options. + * @member {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.IOptions|null|undefined} options + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest + * @instance + */ + AnalyzeIamPolicyRequest.prototype.options = null; + + /** + * Creates a new AnalyzeIamPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest + * @static + * @param {google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest} AnalyzeIamPolicyRequest instance + */ + AnalyzeIamPolicyRequest.create = function create(properties) { + return new AnalyzeIamPolicyRequest(properties); + }; + + /** + * Encodes the specified AnalyzeIamPolicyRequest message. Does not implicitly {@link google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest + * @static + * @param {google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest} message AnalyzeIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeIamPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.encode(message.analysisQuery, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnalyzeIamPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest + * @static + * @param {google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest} message AnalyzeIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeIamPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest} AnalyzeIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeIamPolicyRequest.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.v1p4beta1.AnalyzeIamPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.analysisQuery = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.decode(reader, reader.uint32()); + break; + case 2: + message.options = $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeIamPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest} AnalyzeIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeIamPolicyRequest message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeIamPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.verify(message.analysisQuery); + if (error) + return "analysisQuery." + error; + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an AnalyzeIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest} AnalyzeIamPolicyRequest + */ + AnalyzeIamPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest(); + if (object.analysisQuery != null) { + if (typeof object.analysisQuery !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.analysisQuery: object expected"); + message.analysisQuery = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.fromObject(object.analysisQuery); + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.options: object expected"); + message.options = $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an AnalyzeIamPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest + * @static + * @param {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest} message AnalyzeIamPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeIamPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.analysisQuery = null; + object.options = null; + } + if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) + object.analysisQuery = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.toObject(message.analysisQuery, options); + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options.toObject(message.options, options); + return object; + }; + + /** + * Converts this AnalyzeIamPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + AnalyzeIamPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + AnalyzeIamPolicyRequest.Options = (function() { + + /** + * Properties of an Options. + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest + * @interface IOptions + * @property {boolean|null} [expandGroups] Options expandGroups + * @property {boolean|null} [expandRoles] Options expandRoles + * @property {boolean|null} [expandResources] Options expandResources + * @property {boolean|null} [outputResourceEdges] Options outputResourceEdges + * @property {boolean|null} [outputGroupEdges] Options outputGroupEdges + * @property {boolean|null} [analyzeServiceAccountImpersonation] Options analyzeServiceAccountImpersonation + * @property {google.protobuf.IDuration|null} [executionTimeout] Options executionTimeout + */ + + /** + * Constructs a new Options. + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest + * @classdesc Represents an Options. + * @implements IOptions + * @constructor + * @param {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.IOptions=} [properties] Properties to set + */ + function Options(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]]; + } + + /** + * Options expandGroups. + * @member {boolean} expandGroups + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options + * @instance + */ + Options.prototype.expandGroups = false; + + /** + * Options expandRoles. + * @member {boolean} expandRoles + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options + * @instance + */ + Options.prototype.expandRoles = false; + + /** + * Options expandResources. + * @member {boolean} expandResources + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options + * @instance + */ + Options.prototype.expandResources = false; + + /** + * Options outputResourceEdges. + * @member {boolean} outputResourceEdges + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options + * @instance + */ + Options.prototype.outputResourceEdges = false; + + /** + * Options outputGroupEdges. + * @member {boolean} outputGroupEdges + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options + * @instance + */ + Options.prototype.outputGroupEdges = false; + + /** + * Options analyzeServiceAccountImpersonation. + * @member {boolean} analyzeServiceAccountImpersonation + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options + * @instance + */ + Options.prototype.analyzeServiceAccountImpersonation = false; + + /** + * Options executionTimeout. + * @member {google.protobuf.IDuration|null|undefined} executionTimeout + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options + * @instance + */ + Options.prototype.executionTimeout = null; + + /** + * Creates a new Options instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options + * @static + * @param {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.IOptions=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options} Options instance + */ + Options.create = function create(properties) { + return new Options(properties); + }; + + /** + * Encodes the specified Options message. Does not implicitly {@link google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options + * @static + * @param {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.IOptions} message Options message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Options.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expandGroups != null && message.hasOwnProperty("expandGroups")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.expandGroups); + if (message.expandRoles != null && message.hasOwnProperty("expandRoles")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.expandRoles); + if (message.expandResources != null && message.hasOwnProperty("expandResources")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.expandResources); + if (message.outputResourceEdges != null && message.hasOwnProperty("outputResourceEdges")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.outputResourceEdges); + if (message.outputGroupEdges != null && message.hasOwnProperty("outputGroupEdges")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.outputGroupEdges); + if (message.analyzeServiceAccountImpersonation != null && message.hasOwnProperty("analyzeServiceAccountImpersonation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.analyzeServiceAccountImpersonation); + if (message.executionTimeout != null && message.hasOwnProperty("executionTimeout")) + $root.google.protobuf.Duration.encode(message.executionTimeout, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Options message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options + * @static + * @param {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.IOptions} message Options message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Options.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Options message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options} Options + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Options.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.v1p4beta1.AnalyzeIamPolicyRequest.Options(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.expandGroups = reader.bool(); + break; + case 2: + message.expandRoles = reader.bool(); + break; + case 3: + message.expandResources = reader.bool(); + break; + case 4: + message.outputResourceEdges = reader.bool(); + break; + case 5: + message.outputGroupEdges = reader.bool(); + break; + case 6: + message.analyzeServiceAccountImpersonation = reader.bool(); + break; + case 7: + message.executionTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Options message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options} Options + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Options.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Options message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Options.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expandGroups != null && message.hasOwnProperty("expandGroups")) + if (typeof message.expandGroups !== "boolean") + return "expandGroups: boolean expected"; + if (message.expandRoles != null && message.hasOwnProperty("expandRoles")) + if (typeof message.expandRoles !== "boolean") + return "expandRoles: boolean expected"; + if (message.expandResources != null && message.hasOwnProperty("expandResources")) + if (typeof message.expandResources !== "boolean") + return "expandResources: boolean expected"; + if (message.outputResourceEdges != null && message.hasOwnProperty("outputResourceEdges")) + if (typeof message.outputResourceEdges !== "boolean") + return "outputResourceEdges: boolean expected"; + if (message.outputGroupEdges != null && message.hasOwnProperty("outputGroupEdges")) + if (typeof message.outputGroupEdges !== "boolean") + return "outputGroupEdges: boolean expected"; + if (message.analyzeServiceAccountImpersonation != null && message.hasOwnProperty("analyzeServiceAccountImpersonation")) + if (typeof message.analyzeServiceAccountImpersonation !== "boolean") + return "analyzeServiceAccountImpersonation: boolean expected"; + if (message.executionTimeout != null && message.hasOwnProperty("executionTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.executionTimeout); + if (error) + return "executionTimeout." + error; + } + return null; + }; + + /** + * Creates an Options message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options} Options + */ + Options.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options(); + if (object.expandGroups != null) + message.expandGroups = Boolean(object.expandGroups); + if (object.expandRoles != null) + message.expandRoles = Boolean(object.expandRoles); + if (object.expandResources != null) + message.expandResources = Boolean(object.expandResources); + if (object.outputResourceEdges != null) + message.outputResourceEdges = Boolean(object.outputResourceEdges); + if (object.outputGroupEdges != null) + message.outputGroupEdges = Boolean(object.outputGroupEdges); + if (object.analyzeServiceAccountImpersonation != null) + message.analyzeServiceAccountImpersonation = Boolean(object.analyzeServiceAccountImpersonation); + if (object.executionTimeout != null) { + if (typeof object.executionTimeout !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options.executionTimeout: object expected"); + message.executionTimeout = $root.google.protobuf.Duration.fromObject(object.executionTimeout); + } + return message; + }; + + /** + * Creates a plain object from an Options message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options + * @static + * @param {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options} message Options + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Options.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expandGroups = false; + object.expandRoles = false; + object.expandResources = false; + object.outputResourceEdges = false; + object.outputGroupEdges = false; + object.analyzeServiceAccountImpersonation = false; + object.executionTimeout = null; + } + if (message.expandGroups != null && message.hasOwnProperty("expandGroups")) + object.expandGroups = message.expandGroups; + if (message.expandRoles != null && message.hasOwnProperty("expandRoles")) + object.expandRoles = message.expandRoles; + if (message.expandResources != null && message.hasOwnProperty("expandResources")) + object.expandResources = message.expandResources; + if (message.outputResourceEdges != null && message.hasOwnProperty("outputResourceEdges")) + object.outputResourceEdges = message.outputResourceEdges; + if (message.outputGroupEdges != null && message.hasOwnProperty("outputGroupEdges")) + object.outputGroupEdges = message.outputGroupEdges; + if (message.analyzeServiceAccountImpersonation != null && message.hasOwnProperty("analyzeServiceAccountImpersonation")) + object.analyzeServiceAccountImpersonation = message.analyzeServiceAccountImpersonation; + if (message.executionTimeout != null && message.hasOwnProperty("executionTimeout")) + object.executionTimeout = $root.google.protobuf.Duration.toObject(message.executionTimeout, options); + return object; + }; + + /** + * Converts this Options to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options + * @instance + * @returns {Object.} JSON object + */ + Options.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Options; + })(); + + return AnalyzeIamPolicyRequest; + })(); + + v1p4beta1.AnalyzeIamPolicyResponse = (function() { + + /** + * Properties of an AnalyzeIamPolicyResponse. + * @memberof google.cloud.asset.v1p4beta1 + * @interface IAnalyzeIamPolicyResponse + * @property {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis|null} [mainAnalysis] AnalyzeIamPolicyResponse mainAnalysis + * @property {Array.|null} [serviceAccountImpersonationAnalysis] AnalyzeIamPolicyResponse serviceAccountImpersonationAnalysis + * @property {boolean|null} [fullyExplored] AnalyzeIamPolicyResponse fullyExplored + * @property {Array.|null} [nonCriticalErrors] AnalyzeIamPolicyResponse nonCriticalErrors + */ + + /** + * Constructs a new AnalyzeIamPolicyResponse. + * @memberof google.cloud.asset.v1p4beta1 + * @classdesc Represents an AnalyzeIamPolicyResponse. + * @implements IAnalyzeIamPolicyResponse + * @constructor + * @param {google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse=} [properties] Properties to set + */ + function AnalyzeIamPolicyResponse(properties) { + this.serviceAccountImpersonationAnalysis = []; + this.nonCriticalErrors = []; + 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]]; + } + + /** + * AnalyzeIamPolicyResponse mainAnalysis. + * @member {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis|null|undefined} mainAnalysis + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse + * @instance + */ + AnalyzeIamPolicyResponse.prototype.mainAnalysis = null; + + /** + * AnalyzeIamPolicyResponse serviceAccountImpersonationAnalysis. + * @member {Array.} serviceAccountImpersonationAnalysis + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse + * @instance + */ + AnalyzeIamPolicyResponse.prototype.serviceAccountImpersonationAnalysis = $util.emptyArray; + + /** + * AnalyzeIamPolicyResponse fullyExplored. + * @member {boolean} fullyExplored + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse + * @instance + */ + AnalyzeIamPolicyResponse.prototype.fullyExplored = false; + + /** + * AnalyzeIamPolicyResponse nonCriticalErrors. + * @member {Array.} nonCriticalErrors + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse + * @instance + */ + AnalyzeIamPolicyResponse.prototype.nonCriticalErrors = $util.emptyArray; + + /** + * Creates a new AnalyzeIamPolicyResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse + * @static + * @param {google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse} AnalyzeIamPolicyResponse instance + */ + AnalyzeIamPolicyResponse.create = function create(properties) { + return new AnalyzeIamPolicyResponse(properties); + }; + + /** + * Encodes the specified AnalyzeIamPolicyResponse message. Does not implicitly {@link google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse + * @static + * @param {google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse} message AnalyzeIamPolicyResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeIamPolicyResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mainAnalysis != null && message.hasOwnProperty("mainAnalysis")) + $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.encode(message.mainAnalysis, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.serviceAccountImpersonationAnalysis != null && message.serviceAccountImpersonationAnalysis.length) + for (var i = 0; i < message.serviceAccountImpersonationAnalysis.length; ++i) + $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.encode(message.serviceAccountImpersonationAnalysis[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.fullyExplored); + if (message.nonCriticalErrors != null && message.nonCriticalErrors.length) + for (var i = 0; i < message.nonCriticalErrors.length; ++i) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.encode(message.nonCriticalErrors[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnalyzeIamPolicyResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse + * @static + * @param {google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse} message AnalyzeIamPolicyResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeIamPolicyResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeIamPolicyResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse} AnalyzeIamPolicyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeIamPolicyResponse.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.v1p4beta1.AnalyzeIamPolicyResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mainAnalysis = $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.serviceAccountImpersonationAnalysis && message.serviceAccountImpersonationAnalysis.length)) + message.serviceAccountImpersonationAnalysis = []; + message.serviceAccountImpersonationAnalysis.push($root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.decode(reader, reader.uint32())); + break; + case 3: + message.fullyExplored = reader.bool(); + break; + case 4: + if (!(message.nonCriticalErrors && message.nonCriticalErrors.length)) + message.nonCriticalErrors = []; + message.nonCriticalErrors.push($root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeIamPolicyResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse} AnalyzeIamPolicyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeIamPolicyResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeIamPolicyResponse message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeIamPolicyResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mainAnalysis != null && message.hasOwnProperty("mainAnalysis")) { + var error = $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.verify(message.mainAnalysis); + if (error) + return "mainAnalysis." + error; + } + if (message.serviceAccountImpersonationAnalysis != null && message.hasOwnProperty("serviceAccountImpersonationAnalysis")) { + if (!Array.isArray(message.serviceAccountImpersonationAnalysis)) + return "serviceAccountImpersonationAnalysis: array expected"; + for (var i = 0; i < message.serviceAccountImpersonationAnalysis.length; ++i) { + var error = $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.verify(message.serviceAccountImpersonationAnalysis[i]); + if (error) + return "serviceAccountImpersonationAnalysis." + error; + } + } + if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) + if (typeof message.fullyExplored !== "boolean") + return "fullyExplored: boolean expected"; + if (message.nonCriticalErrors != null && message.hasOwnProperty("nonCriticalErrors")) { + if (!Array.isArray(message.nonCriticalErrors)) + return "nonCriticalErrors: array expected"; + for (var i = 0; i < message.nonCriticalErrors.length; ++i) { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.verify(message.nonCriticalErrors[i]); + if (error) + return "nonCriticalErrors." + error; + } + } + return null; + }; + + /** + * Creates an AnalyzeIamPolicyResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse} AnalyzeIamPolicyResponse + */ + AnalyzeIamPolicyResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse(); + if (object.mainAnalysis != null) { + if (typeof object.mainAnalysis !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.mainAnalysis: object expected"); + message.mainAnalysis = $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.fromObject(object.mainAnalysis); + } + if (object.serviceAccountImpersonationAnalysis) { + if (!Array.isArray(object.serviceAccountImpersonationAnalysis)) + throw TypeError(".google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.serviceAccountImpersonationAnalysis: array expected"); + message.serviceAccountImpersonationAnalysis = []; + for (var i = 0; i < object.serviceAccountImpersonationAnalysis.length; ++i) { + if (typeof object.serviceAccountImpersonationAnalysis[i] !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.serviceAccountImpersonationAnalysis: object expected"); + message.serviceAccountImpersonationAnalysis[i] = $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.fromObject(object.serviceAccountImpersonationAnalysis[i]); + } + } + if (object.fullyExplored != null) + message.fullyExplored = Boolean(object.fullyExplored); + if (object.nonCriticalErrors) { + if (!Array.isArray(object.nonCriticalErrors)) + throw TypeError(".google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.nonCriticalErrors: array expected"); + message.nonCriticalErrors = []; + for (var i = 0; i < object.nonCriticalErrors.length; ++i) { + if (typeof object.nonCriticalErrors[i] !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.nonCriticalErrors: object expected"); + message.nonCriticalErrors[i] = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.fromObject(object.nonCriticalErrors[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AnalyzeIamPolicyResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse + * @static + * @param {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse} message AnalyzeIamPolicyResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeIamPolicyResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.serviceAccountImpersonationAnalysis = []; + object.nonCriticalErrors = []; + } + if (options.defaults) { + object.mainAnalysis = null; + object.fullyExplored = false; + } + if (message.mainAnalysis != null && message.hasOwnProperty("mainAnalysis")) + object.mainAnalysis = $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.toObject(message.mainAnalysis, options); + if (message.serviceAccountImpersonationAnalysis && message.serviceAccountImpersonationAnalysis.length) { + object.serviceAccountImpersonationAnalysis = []; + for (var j = 0; j < message.serviceAccountImpersonationAnalysis.length; ++j) + object.serviceAccountImpersonationAnalysis[j] = $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.toObject(message.serviceAccountImpersonationAnalysis[j], options); + } + if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) + object.fullyExplored = message.fullyExplored; + if (message.nonCriticalErrors && message.nonCriticalErrors.length) { + object.nonCriticalErrors = []; + for (var j = 0; j < message.nonCriticalErrors.length; ++j) + object.nonCriticalErrors[j] = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.toObject(message.nonCriticalErrors[j], options); + } + return object; + }; + + /** + * Converts this AnalyzeIamPolicyResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse + * @instance + * @returns {Object.} JSON object + */ + AnalyzeIamPolicyResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + AnalyzeIamPolicyResponse.IamPolicyAnalysis = (function() { + + /** + * Properties of an IamPolicyAnalysis. + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse + * @interface IIamPolicyAnalysis + * @property {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery|null} [analysisQuery] IamPolicyAnalysis analysisQuery + * @property {Array.|null} [analysisResults] IamPolicyAnalysis analysisResults + * @property {boolean|null} [fullyExplored] IamPolicyAnalysis fullyExplored + */ + + /** + * Constructs a new IamPolicyAnalysis. + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse + * @classdesc Represents an IamPolicyAnalysis. + * @implements IIamPolicyAnalysis + * @constructor + * @param {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis=} [properties] Properties to set + */ + function IamPolicyAnalysis(properties) { + this.analysisResults = []; + 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]]; + } + + /** + * IamPolicyAnalysis analysisQuery. + * @member {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery|null|undefined} analysisQuery + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @instance + */ + IamPolicyAnalysis.prototype.analysisQuery = null; + + /** + * IamPolicyAnalysis analysisResults. + * @member {Array.} analysisResults + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @instance + */ + IamPolicyAnalysis.prototype.analysisResults = $util.emptyArray; + + /** + * IamPolicyAnalysis fullyExplored. + * @member {boolean} fullyExplored + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @instance + */ + IamPolicyAnalysis.prototype.fullyExplored = false; + + /** + * Creates a new IamPolicyAnalysis instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis} IamPolicyAnalysis instance + */ + IamPolicyAnalysis.create = function create(properties) { + return new IamPolicyAnalysis(properties); + }; + + /** + * Encodes the specified IamPolicyAnalysis message. Does not implicitly {@link google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis} message IamPolicyAnalysis message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicyAnalysis.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.encode(message.analysisQuery, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.analysisResults != null && message.analysisResults.length) + for (var i = 0; i < message.analysisResults.length; ++i) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.encode(message.analysisResults[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.fullyExplored); + return writer; + }; + + /** + * Encodes the specified IamPolicyAnalysis message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis} message IamPolicyAnalysis message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicyAnalysis.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IamPolicyAnalysis message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis} IamPolicyAnalysis + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicyAnalysis.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.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.analysisQuery = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.analysisResults && message.analysisResults.length)) + message.analysisResults = []; + message.analysisResults.push($root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.decode(reader, reader.uint32())); + break; + case 3: + message.fullyExplored = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IamPolicyAnalysis message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis} IamPolicyAnalysis + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicyAnalysis.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IamPolicyAnalysis message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IamPolicyAnalysis.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.verify(message.analysisQuery); + if (error) + return "analysisQuery." + error; + } + if (message.analysisResults != null && message.hasOwnProperty("analysisResults")) { + if (!Array.isArray(message.analysisResults)) + return "analysisResults: array expected"; + for (var i = 0; i < message.analysisResults.length; ++i) { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.verify(message.analysisResults[i]); + if (error) + return "analysisResults." + error; + } + } + if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) + if (typeof message.fullyExplored !== "boolean") + return "fullyExplored: boolean expected"; + return null; + }; + + /** + * Creates an IamPolicyAnalysis message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis} IamPolicyAnalysis + */ + IamPolicyAnalysis.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis(); + if (object.analysisQuery != null) { + if (typeof object.analysisQuery !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.analysisQuery: object expected"); + message.analysisQuery = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.fromObject(object.analysisQuery); + } + if (object.analysisResults) { + if (!Array.isArray(object.analysisResults)) + throw TypeError(".google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.analysisResults: array expected"); + message.analysisResults = []; + for (var i = 0; i < object.analysisResults.length; ++i) { + if (typeof object.analysisResults[i] !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.analysisResults: object expected"); + message.analysisResults[i] = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.fromObject(object.analysisResults[i]); + } + } + if (object.fullyExplored != null) + message.fullyExplored = Boolean(object.fullyExplored); + return message; + }; + + /** + * Creates a plain object from an IamPolicyAnalysis message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis} message IamPolicyAnalysis + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IamPolicyAnalysis.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.analysisResults = []; + if (options.defaults) { + object.analysisQuery = null; + object.fullyExplored = false; + } + if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) + object.analysisQuery = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.toObject(message.analysisQuery, options); + if (message.analysisResults && message.analysisResults.length) { + object.analysisResults = []; + for (var j = 0; j < message.analysisResults.length; ++j) + object.analysisResults[j] = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.toObject(message.analysisResults[j], options); + } + if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) + object.fullyExplored = message.fullyExplored; + return object; + }; + + /** + * Converts this IamPolicyAnalysis to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @instance + * @returns {Object.} JSON object + */ + IamPolicyAnalysis.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IamPolicyAnalysis; + })(); + + return AnalyzeIamPolicyResponse; + })(); + + v1p4beta1.IamPolicyAnalysisOutputConfig = (function() { + + /** + * Properties of an IamPolicyAnalysisOutputConfig. + * @memberof google.cloud.asset.v1p4beta1 + * @interface IIamPolicyAnalysisOutputConfig + * @property {google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.IGcsDestination|null} [gcsDestination] IamPolicyAnalysisOutputConfig gcsDestination + */ + + /** + * Constructs a new IamPolicyAnalysisOutputConfig. + * @memberof google.cloud.asset.v1p4beta1 + * @classdesc Represents an IamPolicyAnalysisOutputConfig. + * @implements IIamPolicyAnalysisOutputConfig + * @constructor + * @param {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisOutputConfig=} [properties] Properties to set + */ + function IamPolicyAnalysisOutputConfig(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]]; + } + + /** + * IamPolicyAnalysisOutputConfig gcsDestination. + * @member {google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig + * @instance + */ + IamPolicyAnalysisOutputConfig.prototype.gcsDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * IamPolicyAnalysisOutputConfig destination. + * @member {"gcsDestination"|undefined} destination + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig + * @instance + */ + Object.defineProperty(IamPolicyAnalysisOutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new IamPolicyAnalysisOutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig + * @static + * @param {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisOutputConfig=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig} IamPolicyAnalysisOutputConfig instance + */ + IamPolicyAnalysisOutputConfig.create = function create(properties) { + return new IamPolicyAnalysisOutputConfig(properties); + }; + + /** + * Encodes the specified IamPolicyAnalysisOutputConfig message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig + * @static + * @param {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisOutputConfig} message IamPolicyAnalysisOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicyAnalysisOutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IamPolicyAnalysisOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig + * @static + * @param {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisOutputConfig} message IamPolicyAnalysisOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicyAnalysisOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IamPolicyAnalysisOutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig} IamPolicyAnalysisOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicyAnalysisOutputConfig.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.v1p4beta1.IamPolicyAnalysisOutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsDestination = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IamPolicyAnalysisOutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig} IamPolicyAnalysisOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicyAnalysisOutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IamPolicyAnalysisOutputConfig message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IamPolicyAnalysisOutputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } + return null; + }; + + /** + * Creates an IamPolicyAnalysisOutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig} IamPolicyAnalysisOutputConfig + */ + IamPolicyAnalysisOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination.fromObject(object.gcsDestination); + } + return message; + }; + + /** + * Creates a plain object from an IamPolicyAnalysisOutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig} message IamPolicyAnalysisOutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IamPolicyAnalysisOutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } + return object; + }; + + /** + * Converts this IamPolicyAnalysisOutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig + * @instance + * @returns {Object.} JSON object + */ + IamPolicyAnalysisOutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + IamPolicyAnalysisOutputConfig.GcsDestination = (function() { + + /** + * Properties of a GcsDestination. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig + * @interface IGcsDestination + * @property {string|null} [uri] GcsDestination uri + */ + + /** + * Constructs a new GcsDestination. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig + * @classdesc Represents a GcsDestination. + * @implements IGcsDestination + * @constructor + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.IGcsDestination=} [properties] Properties to set + */ + function GcsDestination(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]]; + } + + /** + * GcsDestination uri. + * @member {string} uri + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination + * @instance + */ + GcsDestination.prototype.uri = ""; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.IGcsDestination=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination} GcsDestination instance + */ + GcsDestination.create = function create(properties) { + return new GcsDestination(properties); + }; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && message.hasOwnProperty("uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + return writer; + }; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uri = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsDestination message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + return null; + }; + + /** + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination} GcsDestination + */ + GcsDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination(); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination} message GcsDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.uri = ""; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this GcsDestination to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination + * @instance + * @returns {Object.} JSON object + */ + GcsDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GcsDestination; + })(); + + return IamPolicyAnalysisOutputConfig; + })(); + + v1p4beta1.ExportIamPolicyAnalysisRequest = (function() { + + /** + * Properties of an ExportIamPolicyAnalysisRequest. + * @memberof google.cloud.asset.v1p4beta1 + * @interface IExportIamPolicyAnalysisRequest + * @property {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery|null} [analysisQuery] ExportIamPolicyAnalysisRequest analysisQuery + * @property {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.IOptions|null} [options] ExportIamPolicyAnalysisRequest options + * @property {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisOutputConfig|null} [outputConfig] ExportIamPolicyAnalysisRequest outputConfig + */ + + /** + * Constructs a new ExportIamPolicyAnalysisRequest. + * @memberof google.cloud.asset.v1p4beta1 + * @classdesc Represents an ExportIamPolicyAnalysisRequest. + * @implements IExportIamPolicyAnalysisRequest + * @constructor + * @param {google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest=} [properties] Properties to set + */ + function ExportIamPolicyAnalysisRequest(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]]; + } + + /** + * ExportIamPolicyAnalysisRequest analysisQuery. + * @member {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisQuery|null|undefined} analysisQuery + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest + * @instance + */ + ExportIamPolicyAnalysisRequest.prototype.analysisQuery = null; + + /** + * ExportIamPolicyAnalysisRequest options. + * @member {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.IOptions|null|undefined} options + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest + * @instance + */ + ExportIamPolicyAnalysisRequest.prototype.options = null; + + /** + * ExportIamPolicyAnalysisRequest outputConfig. + * @member {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest + * @instance + */ + ExportIamPolicyAnalysisRequest.prototype.outputConfig = null; + + /** + * Creates a new ExportIamPolicyAnalysisRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest + * @static + * @param {google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest} ExportIamPolicyAnalysisRequest instance + */ + ExportIamPolicyAnalysisRequest.create = function create(properties) { + return new ExportIamPolicyAnalysisRequest(properties); + }; + + /** + * Encodes the specified ExportIamPolicyAnalysisRequest message. Does not implicitly {@link google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest + * @static + * @param {google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest} message ExportIamPolicyAnalysisRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportIamPolicyAnalysisRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.encode(message.analysisQuery, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.encode(message.outputConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportIamPolicyAnalysisRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest + * @static + * @param {google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest} message ExportIamPolicyAnalysisRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportIamPolicyAnalysisRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportIamPolicyAnalysisRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest} ExportIamPolicyAnalysisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportIamPolicyAnalysisRequest.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.v1p4beta1.ExportIamPolicyAnalysisRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.analysisQuery = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.decode(reader, reader.uint32()); + break; + case 2: + message.options = $root.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options.decode(reader, reader.uint32()); + break; + case 3: + message.outputConfig = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportIamPolicyAnalysisRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest} ExportIamPolicyAnalysisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportIamPolicyAnalysisRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportIamPolicyAnalysisRequest message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportIamPolicyAnalysisRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.verify(message.analysisQuery); + if (error) + return "analysisQuery." + error; + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options.verify(message.options); + if (error) + return "options." + error; + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates an ExportIamPolicyAnalysisRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest} ExportIamPolicyAnalysisRequest + */ + ExportIamPolicyAnalysisRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest(); + if (object.analysisQuery != null) { + if (typeof object.analysisQuery !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.analysisQuery: object expected"); + message.analysisQuery = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.fromObject(object.analysisQuery); + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.options: object expected"); + message.options = $root.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options.fromObject(object.options); + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from an ExportIamPolicyAnalysisRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest + * @static + * @param {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest} message ExportIamPolicyAnalysisRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportIamPolicyAnalysisRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.analysisQuery = null; + object.options = null; + object.outputConfig = null; + } + if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) + object.analysisQuery = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.toObject(message.analysisQuery, options); + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options.toObject(message.options, options); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this ExportIamPolicyAnalysisRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest + * @instance + * @returns {Object.} JSON object + */ + ExportIamPolicyAnalysisRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + ExportIamPolicyAnalysisRequest.Options = (function() { + + /** + * Properties of an Options. + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest + * @interface IOptions + * @property {boolean|null} [expandGroups] Options expandGroups + * @property {boolean|null} [expandRoles] Options expandRoles + * @property {boolean|null} [expandResources] Options expandResources + * @property {boolean|null} [outputResourceEdges] Options outputResourceEdges + * @property {boolean|null} [outputGroupEdges] Options outputGroupEdges + * @property {boolean|null} [analyzeServiceAccountImpersonation] Options analyzeServiceAccountImpersonation + */ + + /** + * Constructs a new Options. + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest + * @classdesc Represents an Options. + * @implements IOptions + * @constructor + * @param {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.IOptions=} [properties] Properties to set + */ + function Options(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]]; + } + + /** + * Options expandGroups. + * @member {boolean} expandGroups + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options + * @instance + */ + Options.prototype.expandGroups = false; + + /** + * Options expandRoles. + * @member {boolean} expandRoles + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options + * @instance + */ + Options.prototype.expandRoles = false; + + /** + * Options expandResources. + * @member {boolean} expandResources + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options + * @instance + */ + Options.prototype.expandResources = false; + + /** + * Options outputResourceEdges. + * @member {boolean} outputResourceEdges + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options + * @instance + */ + Options.prototype.outputResourceEdges = false; + + /** + * Options outputGroupEdges. + * @member {boolean} outputGroupEdges + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options + * @instance + */ + Options.prototype.outputGroupEdges = false; + + /** + * Options analyzeServiceAccountImpersonation. + * @member {boolean} analyzeServiceAccountImpersonation + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options + * @instance + */ + Options.prototype.analyzeServiceAccountImpersonation = false; + + /** + * Creates a new Options instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options + * @static + * @param {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.IOptions=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options} Options instance + */ + Options.create = function create(properties) { + return new Options(properties); + }; + + /** + * Encodes the specified Options message. Does not implicitly {@link google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options + * @static + * @param {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.IOptions} message Options message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Options.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expandGroups != null && message.hasOwnProperty("expandGroups")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.expandGroups); + if (message.expandRoles != null && message.hasOwnProperty("expandRoles")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.expandRoles); + if (message.expandResources != null && message.hasOwnProperty("expandResources")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.expandResources); + if (message.outputResourceEdges != null && message.hasOwnProperty("outputResourceEdges")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.outputResourceEdges); + if (message.outputGroupEdges != null && message.hasOwnProperty("outputGroupEdges")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.outputGroupEdges); + if (message.analyzeServiceAccountImpersonation != null && message.hasOwnProperty("analyzeServiceAccountImpersonation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.analyzeServiceAccountImpersonation); + return writer; + }; + + /** + * Encodes the specified Options message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options + * @static + * @param {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.IOptions} message Options message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Options.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Options message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options} Options + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Options.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.v1p4beta1.ExportIamPolicyAnalysisRequest.Options(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.expandGroups = reader.bool(); + break; + case 2: + message.expandRoles = reader.bool(); + break; + case 3: + message.expandResources = reader.bool(); + break; + case 4: + message.outputResourceEdges = reader.bool(); + break; + case 5: + message.outputGroupEdges = reader.bool(); + break; + case 6: + message.analyzeServiceAccountImpersonation = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Options message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options} Options + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Options.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Options message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Options.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expandGroups != null && message.hasOwnProperty("expandGroups")) + if (typeof message.expandGroups !== "boolean") + return "expandGroups: boolean expected"; + if (message.expandRoles != null && message.hasOwnProperty("expandRoles")) + if (typeof message.expandRoles !== "boolean") + return "expandRoles: boolean expected"; + if (message.expandResources != null && message.hasOwnProperty("expandResources")) + if (typeof message.expandResources !== "boolean") + return "expandResources: boolean expected"; + if (message.outputResourceEdges != null && message.hasOwnProperty("outputResourceEdges")) + if (typeof message.outputResourceEdges !== "boolean") + return "outputResourceEdges: boolean expected"; + if (message.outputGroupEdges != null && message.hasOwnProperty("outputGroupEdges")) + if (typeof message.outputGroupEdges !== "boolean") + return "outputGroupEdges: boolean expected"; + if (message.analyzeServiceAccountImpersonation != null && message.hasOwnProperty("analyzeServiceAccountImpersonation")) + if (typeof message.analyzeServiceAccountImpersonation !== "boolean") + return "analyzeServiceAccountImpersonation: boolean expected"; + return null; + }; + + /** + * Creates an Options message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options} Options + */ + Options.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options(); + if (object.expandGroups != null) + message.expandGroups = Boolean(object.expandGroups); + if (object.expandRoles != null) + message.expandRoles = Boolean(object.expandRoles); + if (object.expandResources != null) + message.expandResources = Boolean(object.expandResources); + if (object.outputResourceEdges != null) + message.outputResourceEdges = Boolean(object.outputResourceEdges); + if (object.outputGroupEdges != null) + message.outputGroupEdges = Boolean(object.outputGroupEdges); + if (object.analyzeServiceAccountImpersonation != null) + message.analyzeServiceAccountImpersonation = Boolean(object.analyzeServiceAccountImpersonation); + return message; + }; + + /** + * Creates a plain object from an Options message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options + * @static + * @param {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options} message Options + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Options.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expandGroups = false; + object.expandRoles = false; + object.expandResources = false; + object.outputResourceEdges = false; + object.outputGroupEdges = false; + object.analyzeServiceAccountImpersonation = false; + } + if (message.expandGroups != null && message.hasOwnProperty("expandGroups")) + object.expandGroups = message.expandGroups; + if (message.expandRoles != null && message.hasOwnProperty("expandRoles")) + object.expandRoles = message.expandRoles; + if (message.expandResources != null && message.hasOwnProperty("expandResources")) + object.expandResources = message.expandResources; + if (message.outputResourceEdges != null && message.hasOwnProperty("outputResourceEdges")) + object.outputResourceEdges = message.outputResourceEdges; + if (message.outputGroupEdges != null && message.hasOwnProperty("outputGroupEdges")) + object.outputGroupEdges = message.outputGroupEdges; + if (message.analyzeServiceAccountImpersonation != null && message.hasOwnProperty("analyzeServiceAccountImpersonation")) + object.analyzeServiceAccountImpersonation = message.analyzeServiceAccountImpersonation; + return object; + }; + + /** + * Converts this Options to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options + * @instance + * @returns {Object.} JSON object + */ + Options.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Options; + })(); + + return ExportIamPolicyAnalysisRequest; + })(); + + v1p4beta1.ExportIamPolicyAnalysisResponse = (function() { + + /** + * Properties of an ExportIamPolicyAnalysisResponse. + * @memberof google.cloud.asset.v1p4beta1 + * @interface IExportIamPolicyAnalysisResponse + * @property {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisOutputConfig|null} [outputConfig] ExportIamPolicyAnalysisResponse outputConfig + */ + + /** + * Constructs a new ExportIamPolicyAnalysisResponse. + * @memberof google.cloud.asset.v1p4beta1 + * @classdesc Represents an ExportIamPolicyAnalysisResponse. + * @implements IExportIamPolicyAnalysisResponse + * @constructor + * @param {google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse=} [properties] Properties to set + */ + function ExportIamPolicyAnalysisResponse(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]]; + } + + /** + * ExportIamPolicyAnalysisResponse outputConfig. + * @member {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse + * @instance + */ + ExportIamPolicyAnalysisResponse.prototype.outputConfig = null; + + /** + * Creates a new ExportIamPolicyAnalysisResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse + * @static + * @param {google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse} ExportIamPolicyAnalysisResponse instance + */ + ExportIamPolicyAnalysisResponse.create = function create(properties) { + return new ExportIamPolicyAnalysisResponse(properties); + }; + + /** + * Encodes the specified ExportIamPolicyAnalysisResponse message. Does not implicitly {@link google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse + * @static + * @param {google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse} message ExportIamPolicyAnalysisResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportIamPolicyAnalysisResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.encode(message.outputConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportIamPolicyAnalysisResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse + * @static + * @param {google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse} message ExportIamPolicyAnalysisResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportIamPolicyAnalysisResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportIamPolicyAnalysisResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse} ExportIamPolicyAnalysisResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportIamPolicyAnalysisResponse.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.v1p4beta1.ExportIamPolicyAnalysisResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.outputConfig = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportIamPolicyAnalysisResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse} ExportIamPolicyAnalysisResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportIamPolicyAnalysisResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportIamPolicyAnalysisResponse message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportIamPolicyAnalysisResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates an ExportIamPolicyAnalysisResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse} ExportIamPolicyAnalysisResponse + */ + ExportIamPolicyAnalysisResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse(); + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from an ExportIamPolicyAnalysisResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse + * @static + * @param {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse} message ExportIamPolicyAnalysisResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportIamPolicyAnalysisResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.outputConfig = null; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this ExportIamPolicyAnalysisResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse + * @instance + * @returns {Object.} JSON object + */ + ExportIamPolicyAnalysisResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExportIamPolicyAnalysisResponse; + })(); + + v1p4beta1.IamPolicyAnalysisResult = (function() { + + /** + * Properties of an IamPolicyAnalysisResult. + * @memberof google.cloud.asset.v1p4beta1 + * @interface IIamPolicyAnalysisResult + * @property {string|null} [attachedResourceFullName] IamPolicyAnalysisResult attachedResourceFullName + * @property {google.iam.v1.IBinding|null} [iamBinding] IamPolicyAnalysisResult iamBinding + * @property {Array.|null} [accessControlLists] IamPolicyAnalysisResult accessControlLists + * @property {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentityList|null} [identityList] IamPolicyAnalysisResult identityList + * @property {boolean|null} [fullyExplored] IamPolicyAnalysisResult fullyExplored + */ + + /** + * Constructs a new IamPolicyAnalysisResult. + * @memberof google.cloud.asset.v1p4beta1 + * @classdesc Represents an IamPolicyAnalysisResult. + * @implements IIamPolicyAnalysisResult + * @constructor + * @param {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisResult=} [properties] Properties to set + */ + function IamPolicyAnalysisResult(properties) { + this.accessControlLists = []; + 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]]; + } + + /** + * IamPolicyAnalysisResult attachedResourceFullName. + * @member {string} attachedResourceFullName + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @instance + */ + IamPolicyAnalysisResult.prototype.attachedResourceFullName = ""; + + /** + * IamPolicyAnalysisResult iamBinding. + * @member {google.iam.v1.IBinding|null|undefined} iamBinding + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @instance + */ + IamPolicyAnalysisResult.prototype.iamBinding = null; + + /** + * IamPolicyAnalysisResult accessControlLists. + * @member {Array.} accessControlLists + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @instance + */ + IamPolicyAnalysisResult.prototype.accessControlLists = $util.emptyArray; + + /** + * IamPolicyAnalysisResult identityList. + * @member {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentityList|null|undefined} identityList + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @instance + */ + IamPolicyAnalysisResult.prototype.identityList = null; + + /** + * IamPolicyAnalysisResult fullyExplored. + * @member {boolean} fullyExplored + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @instance + */ + IamPolicyAnalysisResult.prototype.fullyExplored = false; + + /** + * Creates a new IamPolicyAnalysisResult instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @static + * @param {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisResult=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult} IamPolicyAnalysisResult instance + */ + IamPolicyAnalysisResult.create = function create(properties) { + return new IamPolicyAnalysisResult(properties); + }; + + /** + * Encodes the specified IamPolicyAnalysisResult message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @static + * @param {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisResult} message IamPolicyAnalysisResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicyAnalysisResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attachedResourceFullName != null && message.hasOwnProperty("attachedResourceFullName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.attachedResourceFullName); + if (message.iamBinding != null && message.hasOwnProperty("iamBinding")) + $root.google.iam.v1.Binding.encode(message.iamBinding, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.accessControlLists != null && message.accessControlLists.length) + for (var i = 0; i < message.accessControlLists.length; ++i) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList.encode(message.accessControlLists[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.identityList != null && message.hasOwnProperty("identityList")) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList.encode(message.identityList, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.fullyExplored); + return writer; + }; + + /** + * Encodes the specified IamPolicyAnalysisResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @static + * @param {google.cloud.asset.v1p4beta1.IIamPolicyAnalysisResult} message IamPolicyAnalysisResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicyAnalysisResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IamPolicyAnalysisResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult} IamPolicyAnalysisResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicyAnalysisResult.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.v1p4beta1.IamPolicyAnalysisResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.attachedResourceFullName = reader.string(); + break; + case 2: + message.iamBinding = $root.google.iam.v1.Binding.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.accessControlLists && message.accessControlLists.length)) + message.accessControlLists = []; + message.accessControlLists.push($root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList.decode(reader, reader.uint32())); + break; + case 4: + message.identityList = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList.decode(reader, reader.uint32()); + break; + case 5: + message.fullyExplored = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IamPolicyAnalysisResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult} IamPolicyAnalysisResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicyAnalysisResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IamPolicyAnalysisResult message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IamPolicyAnalysisResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attachedResourceFullName != null && message.hasOwnProperty("attachedResourceFullName")) + if (!$util.isString(message.attachedResourceFullName)) + return "attachedResourceFullName: string expected"; + if (message.iamBinding != null && message.hasOwnProperty("iamBinding")) { + var error = $root.google.iam.v1.Binding.verify(message.iamBinding); + if (error) + return "iamBinding." + error; + } + if (message.accessControlLists != null && message.hasOwnProperty("accessControlLists")) { + if (!Array.isArray(message.accessControlLists)) + return "accessControlLists: array expected"; + for (var i = 0; i < message.accessControlLists.length; ++i) { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList.verify(message.accessControlLists[i]); + if (error) + return "accessControlLists." + error; + } + } + if (message.identityList != null && message.hasOwnProperty("identityList")) { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList.verify(message.identityList); + if (error) + return "identityList." + error; + } + if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) + if (typeof message.fullyExplored !== "boolean") + return "fullyExplored: boolean expected"; + return null; + }; + + /** + * Creates an IamPolicyAnalysisResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult} IamPolicyAnalysisResult + */ + IamPolicyAnalysisResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult(); + if (object.attachedResourceFullName != null) + message.attachedResourceFullName = String(object.attachedResourceFullName); + if (object.iamBinding != null) { + if (typeof object.iamBinding !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.iamBinding: object expected"); + message.iamBinding = $root.google.iam.v1.Binding.fromObject(object.iamBinding); + } + if (object.accessControlLists) { + if (!Array.isArray(object.accessControlLists)) + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.accessControlLists: array expected"); + message.accessControlLists = []; + for (var i = 0; i < object.accessControlLists.length; ++i) { + if (typeof object.accessControlLists[i] !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.accessControlLists: object expected"); + message.accessControlLists[i] = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList.fromObject(object.accessControlLists[i]); + } + } + if (object.identityList != null) { + if (typeof object.identityList !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.identityList: object expected"); + message.identityList = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList.fromObject(object.identityList); + } + if (object.fullyExplored != null) + message.fullyExplored = Boolean(object.fullyExplored); + return message; + }; + + /** + * Creates a plain object from an IamPolicyAnalysisResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult} message IamPolicyAnalysisResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IamPolicyAnalysisResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.accessControlLists = []; + if (options.defaults) { + object.attachedResourceFullName = ""; + object.iamBinding = null; + object.identityList = null; + object.fullyExplored = false; + } + if (message.attachedResourceFullName != null && message.hasOwnProperty("attachedResourceFullName")) + object.attachedResourceFullName = message.attachedResourceFullName; + if (message.iamBinding != null && message.hasOwnProperty("iamBinding")) + object.iamBinding = $root.google.iam.v1.Binding.toObject(message.iamBinding, options); + if (message.accessControlLists && message.accessControlLists.length) { + object.accessControlLists = []; + for (var j = 0; j < message.accessControlLists.length; ++j) + object.accessControlLists[j] = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList.toObject(message.accessControlLists[j], options); + } + if (message.identityList != null && message.hasOwnProperty("identityList")) + object.identityList = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList.toObject(message.identityList, options); + if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) + object.fullyExplored = message.fullyExplored; + return object; + }; + + /** + * Converts this IamPolicyAnalysisResult to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @instance + * @returns {Object.} JSON object + */ + IamPolicyAnalysisResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + IamPolicyAnalysisResult.AnalysisState = (function() { + + /** + * Properties of an AnalysisState. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @interface IAnalysisState + * @property {google.rpc.Code|null} [code] AnalysisState code + * @property {string|null} [cause] AnalysisState cause + */ + + /** + * Constructs a new AnalysisState. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @classdesc Represents an AnalysisState. + * @implements IAnalysisState + * @constructor + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState=} [properties] Properties to set + */ + function AnalysisState(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]]; + } + + /** + * AnalysisState code. + * @member {google.rpc.Code} code + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState + * @instance + */ + AnalysisState.prototype.code = 0; + + /** + * AnalysisState cause. + * @member {string} cause + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState + * @instance + */ + AnalysisState.prototype.cause = ""; + + /** + * Creates a new AnalysisState instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState} AnalysisState instance + */ + AnalysisState.create = function create(properties) { + return new AnalysisState(properties); + }; + + /** + * Encodes the specified AnalysisState message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState} message AnalysisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalysisState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && message.hasOwnProperty("code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.cause != null && message.hasOwnProperty("cause")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.cause); + return writer; + }; + + /** + * Encodes the specified AnalysisState message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState} message AnalysisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalysisState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalysisState message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState} AnalysisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalysisState.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.v1p4beta1.IamPolicyAnalysisResult.AnalysisState(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.int32(); + break; + case 2: + message.cause = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalysisState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState} AnalysisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalysisState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalysisState message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalysisState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + switch (message.code) { + default: + return "code: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 16: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + break; + } + if (message.cause != null && message.hasOwnProperty("cause")) + if (!$util.isString(message.cause)) + return "cause: string expected"; + return null; + }; + + /** + * Creates an AnalysisState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState} AnalysisState + */ + AnalysisState.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState(); + switch (object.code) { + case "OK": + case 0: + message.code = 0; + break; + case "CANCELLED": + case 1: + message.code = 1; + break; + case "UNKNOWN": + case 2: + message.code = 2; + break; + case "INVALID_ARGUMENT": + case 3: + message.code = 3; + break; + case "DEADLINE_EXCEEDED": + case 4: + message.code = 4; + break; + case "NOT_FOUND": + case 5: + message.code = 5; + break; + case "ALREADY_EXISTS": + case 6: + message.code = 6; + break; + case "PERMISSION_DENIED": + case 7: + message.code = 7; + break; + case "UNAUTHENTICATED": + case 16: + message.code = 16; + break; + case "RESOURCE_EXHAUSTED": + case 8: + message.code = 8; + break; + case "FAILED_PRECONDITION": + case 9: + message.code = 9; + break; + case "ABORTED": + case 10: + message.code = 10; + break; + case "OUT_OF_RANGE": + case 11: + message.code = 11; + break; + case "UNIMPLEMENTED": + case 12: + message.code = 12; + break; + case "INTERNAL": + case 13: + message.code = 13; + break; + case "UNAVAILABLE": + case 14: + message.code = 14; + break; + case "DATA_LOSS": + case 15: + message.code = 15; + break; + } + if (object.cause != null) + message.cause = String(object.cause); + return message; + }; + + /** + * Creates a plain object from an AnalysisState message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState} message AnalysisState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalysisState.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.code = options.enums === String ? "OK" : 0; + object.cause = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = options.enums === String ? $root.google.rpc.Code[message.code] : message.code; + if (message.cause != null && message.hasOwnProperty("cause")) + object.cause = message.cause; + return object; + }; + + /** + * Converts this AnalysisState to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState + * @instance + * @returns {Object.} JSON object + */ + AnalysisState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AnalysisState; + })(); + + IamPolicyAnalysisResult.Resource = (function() { + + /** + * Properties of a Resource. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @interface IResource + * @property {string|null} [fullResourceName] Resource fullResourceName + * @property {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState|null} [analysisState] Resource analysisState + */ + + /** + * Constructs a new Resource. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @classdesc Represents a Resource. + * @implements IResource + * @constructor + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IResource=} [properties] Properties to set + */ + function Resource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Resource fullResourceName. + * @member {string} fullResourceName + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource + * @instance + */ + Resource.prototype.fullResourceName = ""; + + /** + * Resource analysisState. + * @member {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState|null|undefined} analysisState + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource + * @instance + */ + Resource.prototype.analysisState = null; + + /** + * Creates a new Resource instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IResource=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource} Resource instance + */ + Resource.create = function create(properties) { + return new Resource(properties); + }; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fullResourceName); + if (message.analysisState != null && message.hasOwnProperty("analysisState")) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.encode(message.analysisState, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fullResourceName = reader.string(); + break; + case 2: + message.analysisState = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Resource message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Resource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + if (!$util.isString(message.fullResourceName)) + return "fullResourceName: string expected"; + if (message.analysisState != null && message.hasOwnProperty("analysisState")) { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.verify(message.analysisState); + if (error) + return "analysisState." + error; + } + return null; + }; + + /** + * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource} Resource + */ + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource(); + if (object.fullResourceName != null) + message.fullResourceName = String(object.fullResourceName); + if (object.analysisState != null) { + if (typeof object.analysisState !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource.analysisState: object expected"); + message.analysisState = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.fromObject(object.analysisState); + } + return message; + }; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource} message Resource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Resource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fullResourceName = ""; + object.analysisState = null; + } + if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + object.fullResourceName = message.fullResourceName; + if (message.analysisState != null && message.hasOwnProperty("analysisState")) + object.analysisState = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.toObject(message.analysisState, options); + return object; + }; + + /** + * Converts this Resource to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource + * @instance + * @returns {Object.} JSON object + */ + Resource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Resource; + })(); + + IamPolicyAnalysisResult.Access = (function() { + + /** + * Properties of an Access. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @interface IAccess + * @property {string|null} [role] Access role + * @property {string|null} [permission] Access permission + * @property {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState|null} [analysisState] Access analysisState + */ + + /** + * Constructs a new Access. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @classdesc Represents an Access. + * @implements IAccess + * @constructor + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccess=} [properties] Properties to set + */ + function Access(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]]; + } + + /** + * Access role. + * @member {string} role + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access + * @instance + */ + Access.prototype.role = ""; + + /** + * Access permission. + * @member {string} permission + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access + * @instance + */ + Access.prototype.permission = ""; + + /** + * Access analysisState. + * @member {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState|null|undefined} analysisState + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access + * @instance + */ + Access.prototype.analysisState = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Access oneofAccess. + * @member {"role"|"permission"|undefined} oneofAccess + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access + * @instance + */ + Object.defineProperty(Access.prototype, "oneofAccess", { + get: $util.oneOfGetter($oneOfFields = ["role", "permission"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Access instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccess=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access} Access instance + */ + Access.create = function create(properties) { + return new Access(properties); + }; + + /** + * Encodes the specified Access message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccess} message Access message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Access.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.role != null && message.hasOwnProperty("role")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); + if (message.permission != null && message.hasOwnProperty("permission")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.permission); + if (message.analysisState != null && message.hasOwnProperty("analysisState")) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.encode(message.analysisState, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Access message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccess} message Access message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Access.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Access message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access} Access + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Access.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.v1p4beta1.IamPolicyAnalysisResult.Access(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.role = reader.string(); + break; + case 2: + message.permission = reader.string(); + break; + case 3: + message.analysisState = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Access message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access} Access + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Access.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Access message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Access.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.role != null && message.hasOwnProperty("role")) { + properties.oneofAccess = 1; + if (!$util.isString(message.role)) + return "role: string expected"; + } + if (message.permission != null && message.hasOwnProperty("permission")) { + if (properties.oneofAccess === 1) + return "oneofAccess: multiple values"; + properties.oneofAccess = 1; + if (!$util.isString(message.permission)) + return "permission: string expected"; + } + if (message.analysisState != null && message.hasOwnProperty("analysisState")) { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.verify(message.analysisState); + if (error) + return "analysisState." + error; + } + return null; + }; + + /** + * Creates an Access message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access} Access + */ + Access.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access(); + if (object.role != null) + message.role = String(object.role); + if (object.permission != null) + message.permission = String(object.permission); + if (object.analysisState != null) { + if (typeof object.analysisState !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access.analysisState: object expected"); + message.analysisState = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.fromObject(object.analysisState); + } + return message; + }; + + /** + * Creates a plain object from an Access message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access} message Access + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Access.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.analysisState = null; + if (message.role != null && message.hasOwnProperty("role")) { + object.role = message.role; + if (options.oneofs) + object.oneofAccess = "role"; + } + if (message.permission != null && message.hasOwnProperty("permission")) { + object.permission = message.permission; + if (options.oneofs) + object.oneofAccess = "permission"; + } + if (message.analysisState != null && message.hasOwnProperty("analysisState")) + object.analysisState = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.toObject(message.analysisState, options); + return object; + }; + + /** + * Converts this Access to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access + * @instance + * @returns {Object.} JSON object + */ + Access.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Access; + })(); + + IamPolicyAnalysisResult.Edge = (function() { + + /** + * Properties of an Edge. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @interface IEdge + * @property {string|null} [sourceNode] Edge sourceNode + * @property {string|null} [targetNode] Edge targetNode + */ + + /** + * Constructs a new Edge. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @classdesc Represents an Edge. + * @implements IEdge + * @constructor + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IEdge=} [properties] Properties to set + */ + function Edge(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]]; + } + + /** + * Edge sourceNode. + * @member {string} sourceNode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge + * @instance + */ + Edge.prototype.sourceNode = ""; + + /** + * Edge targetNode. + * @member {string} targetNode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge + * @instance + */ + Edge.prototype.targetNode = ""; + + /** + * Creates a new Edge instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IEdge=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge} Edge instance + */ + Edge.create = function create(properties) { + return new Edge(properties); + }; + + /** + * Encodes the specified Edge message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IEdge} message Edge message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Edge.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourceNode != null && message.hasOwnProperty("sourceNode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourceNode); + if (message.targetNode != null && message.hasOwnProperty("targetNode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetNode); + return writer; + }; + + /** + * Encodes the specified Edge message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IEdge} message Edge message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Edge.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Edge message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge} Edge + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Edge.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.v1p4beta1.IamPolicyAnalysisResult.Edge(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sourceNode = reader.string(); + break; + case 2: + message.targetNode = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Edge message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge} Edge + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Edge.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Edge message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Edge.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sourceNode != null && message.hasOwnProperty("sourceNode")) + if (!$util.isString(message.sourceNode)) + return "sourceNode: string expected"; + if (message.targetNode != null && message.hasOwnProperty("targetNode")) + if (!$util.isString(message.targetNode)) + return "targetNode: string expected"; + return null; + }; + + /** + * Creates an Edge message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge} Edge + */ + Edge.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge(); + if (object.sourceNode != null) + message.sourceNode = String(object.sourceNode); + if (object.targetNode != null) + message.targetNode = String(object.targetNode); + return message; + }; + + /** + * Creates a plain object from an Edge message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge} message Edge + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Edge.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sourceNode = ""; + object.targetNode = ""; + } + if (message.sourceNode != null && message.hasOwnProperty("sourceNode")) + object.sourceNode = message.sourceNode; + if (message.targetNode != null && message.hasOwnProperty("targetNode")) + object.targetNode = message.targetNode; + return object; + }; + + /** + * Converts this Edge to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge + * @instance + * @returns {Object.} JSON object + */ + Edge.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Edge; + })(); + + IamPolicyAnalysisResult.Identity = (function() { + + /** + * Properties of an Identity. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @interface IIdentity + * @property {string|null} [name] Identity name + * @property {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState|null} [analysisState] Identity analysisState + */ + + /** + * Constructs a new Identity. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @classdesc Represents an Identity. + * @implements IIdentity + * @constructor + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentity=} [properties] Properties to set + */ + function Identity(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]]; + } + + /** + * Identity name. + * @member {string} name + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity + * @instance + */ + Identity.prototype.name = ""; + + /** + * Identity analysisState. + * @member {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAnalysisState|null|undefined} analysisState + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity + * @instance + */ + Identity.prototype.analysisState = null; + + /** + * Creates a new Identity instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentity=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity} Identity instance + */ + Identity.create = function create(properties) { + return new Identity(properties); + }; + + /** + * Encodes the specified Identity message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentity} message Identity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Identity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.analysisState != null && message.hasOwnProperty("analysisState")) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.encode(message.analysisState, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Identity message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentity} message Identity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Identity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Identity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity} Identity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Identity.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.v1p4beta1.IamPolicyAnalysisResult.Identity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.analysisState = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Identity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity} Identity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Identity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Identity message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Identity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.analysisState != null && message.hasOwnProperty("analysisState")) { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.verify(message.analysisState); + if (error) + return "analysisState." + error; + } + return null; + }; + + /** + * Creates an Identity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity} Identity + */ + Identity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity(); + if (object.name != null) + message.name = String(object.name); + if (object.analysisState != null) { + if (typeof object.analysisState !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity.analysisState: object expected"); + message.analysisState = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.fromObject(object.analysisState); + } + return message; + }; + + /** + * Creates a plain object from an Identity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity} message Identity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Identity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.analysisState = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.analysisState != null && message.hasOwnProperty("analysisState")) + object.analysisState = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.toObject(message.analysisState, options); + return object; + }; + + /** + * Converts this Identity to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity + * @instance + * @returns {Object.} JSON object + */ + Identity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Identity; + })(); + + IamPolicyAnalysisResult.AccessControlList = (function() { + + /** + * Properties of an AccessControlList. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @interface IAccessControlList + * @property {Array.|null} [resources] AccessControlList resources + * @property {Array.|null} [accesses] AccessControlList accesses + * @property {Array.|null} [resourceEdges] AccessControlList resourceEdges + */ + + /** + * Constructs a new AccessControlList. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @classdesc Represents an AccessControlList. + * @implements IAccessControlList + * @constructor + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccessControlList=} [properties] Properties to set + */ + function AccessControlList(properties) { + this.resources = []; + this.accesses = []; + this.resourceEdges = []; + 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]]; + } + + /** + * AccessControlList resources. + * @member {Array.} resources + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList + * @instance + */ + AccessControlList.prototype.resources = $util.emptyArray; + + /** + * AccessControlList accesses. + * @member {Array.} accesses + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList + * @instance + */ + AccessControlList.prototype.accesses = $util.emptyArray; + + /** + * AccessControlList resourceEdges. + * @member {Array.} resourceEdges + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList + * @instance + */ + AccessControlList.prototype.resourceEdges = $util.emptyArray; + + /** + * Creates a new AccessControlList instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccessControlList=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList} AccessControlList instance + */ + AccessControlList.create = function create(properties) { + return new AccessControlList(properties); + }; + + /** + * Encodes the specified AccessControlList message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccessControlList} message AccessControlList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessControlList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resources != null && message.resources.length) + for (var i = 0; i < message.resources.length; ++i) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource.encode(message.resources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.accesses != null && message.accesses.length) + for (var i = 0; i < message.accesses.length; ++i) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access.encode(message.accesses[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resourceEdges != null && message.resourceEdges.length) + for (var i = 0; i < message.resourceEdges.length; ++i) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.encode(message.resourceEdges[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AccessControlList message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IAccessControlList} message AccessControlList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessControlList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessControlList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList} AccessControlList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessControlList.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.v1p4beta1.IamPolicyAnalysisResult.AccessControlList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.resources && message.resources.length)) + message.resources = []; + message.resources.push($root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.accesses && message.accesses.length)) + message.accesses = []; + message.accesses.push($root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.resourceEdges && message.resourceEdges.length)) + message.resourceEdges = []; + message.resourceEdges.push($root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessControlList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList} AccessControlList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessControlList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessControlList message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessControlList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resources != null && message.hasOwnProperty("resources")) { + if (!Array.isArray(message.resources)) + return "resources: array expected"; + for (var i = 0; i < message.resources.length; ++i) { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource.verify(message.resources[i]); + if (error) + return "resources." + error; + } + } + if (message.accesses != null && message.hasOwnProperty("accesses")) { + if (!Array.isArray(message.accesses)) + return "accesses: array expected"; + for (var i = 0; i < message.accesses.length; ++i) { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access.verify(message.accesses[i]); + if (error) + return "accesses." + error; + } + } + if (message.resourceEdges != null && message.hasOwnProperty("resourceEdges")) { + if (!Array.isArray(message.resourceEdges)) + return "resourceEdges: array expected"; + for (var i = 0; i < message.resourceEdges.length; ++i) { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.verify(message.resourceEdges[i]); + if (error) + return "resourceEdges." + error; + } + } + return null; + }; + + /** + * Creates an AccessControlList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList} AccessControlList + */ + AccessControlList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList(); + if (object.resources) { + if (!Array.isArray(object.resources)) + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList.resources: array expected"); + message.resources = []; + for (var i = 0; i < object.resources.length; ++i) { + if (typeof object.resources[i] !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList.resources: object expected"); + message.resources[i] = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource.fromObject(object.resources[i]); + } + } + if (object.accesses) { + if (!Array.isArray(object.accesses)) + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList.accesses: array expected"); + message.accesses = []; + for (var i = 0; i < object.accesses.length; ++i) { + if (typeof object.accesses[i] !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList.accesses: object expected"); + message.accesses[i] = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access.fromObject(object.accesses[i]); + } + } + if (object.resourceEdges) { + if (!Array.isArray(object.resourceEdges)) + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList.resourceEdges: array expected"); + message.resourceEdges = []; + for (var i = 0; i < object.resourceEdges.length; ++i) { + if (typeof object.resourceEdges[i] !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList.resourceEdges: object expected"); + message.resourceEdges[i] = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.fromObject(object.resourceEdges[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AccessControlList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList} message AccessControlList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessControlList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.resources = []; + object.accesses = []; + object.resourceEdges = []; + } + if (message.resources && message.resources.length) { + object.resources = []; + for (var j = 0; j < message.resources.length; ++j) + object.resources[j] = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource.toObject(message.resources[j], options); + } + if (message.accesses && message.accesses.length) { + object.accesses = []; + for (var j = 0; j < message.accesses.length; ++j) + object.accesses[j] = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access.toObject(message.accesses[j], options); + } + if (message.resourceEdges && message.resourceEdges.length) { + object.resourceEdges = []; + for (var j = 0; j < message.resourceEdges.length; ++j) + object.resourceEdges[j] = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.toObject(message.resourceEdges[j], options); + } + return object; + }; + + /** + * Converts this AccessControlList to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList + * @instance + * @returns {Object.} JSON object + */ + AccessControlList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AccessControlList; + })(); + + IamPolicyAnalysisResult.IdentityList = (function() { + + /** + * Properties of an IdentityList. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @interface IIdentityList + * @property {Array.|null} [identities] IdentityList identities + * @property {Array.|null} [groupEdges] IdentityList groupEdges + */ + + /** + * Constructs a new IdentityList. + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult + * @classdesc Represents an IdentityList. + * @implements IIdentityList + * @constructor + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentityList=} [properties] Properties to set + */ + function IdentityList(properties) { + this.identities = []; + this.groupEdges = []; + 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]]; + } + + /** + * IdentityList identities. + * @member {Array.} identities + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList + * @instance + */ + IdentityList.prototype.identities = $util.emptyArray; + + /** + * IdentityList groupEdges. + * @member {Array.} groupEdges + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList + * @instance + */ + IdentityList.prototype.groupEdges = $util.emptyArray; + + /** + * Creates a new IdentityList instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentityList=} [properties] Properties to set + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList} IdentityList instance + */ + IdentityList.create = function create(properties) { + return new IdentityList(properties); + }; + + /** + * Encodes the specified IdentityList message. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentityList} message IdentityList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identities != null && message.identities.length) + for (var i = 0; i < message.identities.length; ++i) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity.encode(message.identities[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.groupEdges != null && message.groupEdges.length) + for (var i = 0; i < message.groupEdges.length; ++i) + $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.encode(message.groupEdges[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IdentityList message, length delimited. Does not implicitly {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IIdentityList} message IdentityList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentityList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList} IdentityList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityList.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.v1p4beta1.IamPolicyAnalysisResult.IdentityList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.identities && message.identities.length)) + message.identities = []; + message.identities.push($root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.groupEdges && message.groupEdges.length)) + message.groupEdges = []; + message.groupEdges.push($root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IdentityList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList} IdentityList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentityList message. + * @function verify + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentityList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identities != null && message.hasOwnProperty("identities")) { + if (!Array.isArray(message.identities)) + return "identities: array expected"; + for (var i = 0; i < message.identities.length; ++i) { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity.verify(message.identities[i]); + if (error) + return "identities." + error; + } + } + if (message.groupEdges != null && message.hasOwnProperty("groupEdges")) { + if (!Array.isArray(message.groupEdges)) + return "groupEdges: array expected"; + for (var i = 0; i < message.groupEdges.length; ++i) { + var error = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.verify(message.groupEdges[i]); + if (error) + return "groupEdges." + error; + } + } + return null; + }; + + /** + * Creates an IdentityList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList} IdentityList + */ + IdentityList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList) + return object; + var message = new $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList(); + if (object.identities) { + if (!Array.isArray(object.identities)) + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList.identities: array expected"); + message.identities = []; + for (var i = 0; i < object.identities.length; ++i) { + if (typeof object.identities[i] !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList.identities: object expected"); + message.identities[i] = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity.fromObject(object.identities[i]); + } + } + if (object.groupEdges) { + if (!Array.isArray(object.groupEdges)) + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList.groupEdges: array expected"); + message.groupEdges = []; + for (var i = 0; i < object.groupEdges.length; ++i) { + if (typeof object.groupEdges[i] !== "object") + throw TypeError(".google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList.groupEdges: object expected"); + message.groupEdges[i] = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.fromObject(object.groupEdges[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an IdentityList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList + * @static + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList} message IdentityList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentityList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.identities = []; + object.groupEdges = []; + } + if (message.identities && message.identities.length) { + object.identities = []; + for (var j = 0; j < message.identities.length; ++j) + object.identities[j] = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity.toObject(message.identities[j], options); + } + if (message.groupEdges && message.groupEdges.length) { + object.groupEdges = []; + for (var j = 0; j < message.groupEdges.length; ++j) + object.groupEdges[j] = $root.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.toObject(message.groupEdges[j], options); + } + return object; + }; + + /** + * Converts this IdentityList to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList + * @instance + * @returns {Object.} JSON object + */ + IdentityList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IdentityList; + })(); + + return IamPolicyAnalysisResult; + })(); + + return v1p4beta1; + })(); + return asset; })(); @@ -29080,6 +34374,50 @@ return Status; })(); + /** + * Code enum. + * @name google.rpc.Code + * @enum {string} + * @property {number} OK=0 OK value + * @property {number} CANCELLED=1 CANCELLED value + * @property {number} UNKNOWN=2 UNKNOWN value + * @property {number} INVALID_ARGUMENT=3 INVALID_ARGUMENT value + * @property {number} DEADLINE_EXCEEDED=4 DEADLINE_EXCEEDED value + * @property {number} NOT_FOUND=5 NOT_FOUND value + * @property {number} ALREADY_EXISTS=6 ALREADY_EXISTS value + * @property {number} PERMISSION_DENIED=7 PERMISSION_DENIED value + * @property {number} UNAUTHENTICATED=16 UNAUTHENTICATED value + * @property {number} RESOURCE_EXHAUSTED=8 RESOURCE_EXHAUSTED value + * @property {number} FAILED_PRECONDITION=9 FAILED_PRECONDITION value + * @property {number} ABORTED=10 ABORTED value + * @property {number} OUT_OF_RANGE=11 OUT_OF_RANGE value + * @property {number} UNIMPLEMENTED=12 UNIMPLEMENTED value + * @property {number} INTERNAL=13 INTERNAL value + * @property {number} UNAVAILABLE=14 UNAVAILABLE value + * @property {number} DATA_LOSS=15 DATA_LOSS value + */ + rpc.Code = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OK"] = 0; + values[valuesById[1] = "CANCELLED"] = 1; + values[valuesById[2] = "UNKNOWN"] = 2; + values[valuesById[3] = "INVALID_ARGUMENT"] = 3; + values[valuesById[4] = "DEADLINE_EXCEEDED"] = 4; + values[valuesById[5] = "NOT_FOUND"] = 5; + values[valuesById[6] = "ALREADY_EXISTS"] = 6; + values[valuesById[7] = "PERMISSION_DENIED"] = 7; + values[valuesById[16] = "UNAUTHENTICATED"] = 16; + values[valuesById[8] = "RESOURCE_EXHAUSTED"] = 8; + values[valuesById[9] = "FAILED_PRECONDITION"] = 9; + values[valuesById[10] = "ABORTED"] = 10; + values[valuesById[11] = "OUT_OF_RANGE"] = 11; + values[valuesById[12] = "UNIMPLEMENTED"] = 12; + values[valuesById[13] = "INTERNAL"] = 13; + values[valuesById[14] = "UNAVAILABLE"] = 14; + values[valuesById[15] = "DATA_LOSS"] = 15; + return values; + })(); + return rpc; })(); diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index 17c44fa8aff..2728c4efb84 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -1227,6 +1227,475 @@ } } } + }, + "v1p4beta1": { + "options": { + "csharp_namespace": "Google.Cloud.Asset.V1P4Beta1", + "go_package": "google.golang.org/genproto/googleapis/cloud/asset/v1p4beta1;asset", + "java_multiple_files": true, + "java_outer_classname": "AssetProto", + "java_package": "com.google.cloud.asset.v1p4beta1", + "php_namespace": "Google\\Cloud\\Asset\\V1p4beta1", + "cc_enable_arenas": true + }, + "nested": { + "AssetService": { + "options": { + "(google.api.default_host)": "cloudasset.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AnalyzeIamPolicy": { + "requestType": "AnalyzeIamPolicyRequest", + "responseType": "AnalyzeIamPolicyResponse", + "options": { + "(google.api.http).get": "/v1p4beta1/{analysis_query.parent=*/*}:analyzeIamPolicy" + } + }, + "ExportIamPolicyAnalysis": { + "requestType": "ExportIamPolicyAnalysisRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1p4beta1/{analysis_query.parent=*/*}:exportIamPolicyAnalysis", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse", + "(google.longrunning.operation_info).metadata_type": "google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest" + } + } + } + }, + "IamPolicyAnalysisQuery": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resourceSelector": { + "type": "ResourceSelector", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "identitySelector": { + "type": "IdentitySelector", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "accessSelector": { + "type": "AccessSelector", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ResourceSelector": { + "fields": { + "fullResourceName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "IdentitySelector": { + "fields": { + "identity": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AccessSelector": { + "fields": { + "roles": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "permissions": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "AnalyzeIamPolicyRequest": { + "fields": { + "analysisQuery": { + "type": "IamPolicyAnalysisQuery", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "options": { + "type": "Options", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Options": { + "fields": { + "expandGroups": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "expandRoles": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "expandResources": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputResourceEdges": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputGroupEdges": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "analyzeServiceAccountImpersonation": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "executionTimeout": { + "type": "google.protobuf.Duration", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "AnalyzeIamPolicyResponse": { + "fields": { + "mainAnalysis": { + "type": "IamPolicyAnalysis", + "id": 1 + }, + "serviceAccountImpersonationAnalysis": { + "rule": "repeated", + "type": "IamPolicyAnalysis", + "id": 2 + }, + "fullyExplored": { + "type": "bool", + "id": 3 + }, + "nonCriticalErrors": { + "rule": "repeated", + "type": "IamPolicyAnalysisResult.AnalysisState", + "id": 4 + } + }, + "nested": { + "IamPolicyAnalysis": { + "fields": { + "analysisQuery": { + "type": "IamPolicyAnalysisQuery", + "id": 1 + }, + "analysisResults": { + "rule": "repeated", + "type": "IamPolicyAnalysisResult", + "id": 2 + }, + "fullyExplored": { + "type": "bool", + "id": 3 + } + } + } + } + }, + "IamPolicyAnalysisOutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 1 + } + }, + "nested": { + "GcsDestination": { + "fields": { + "uri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "ExportIamPolicyAnalysisRequest": { + "fields": { + "analysisQuery": { + "type": "IamPolicyAnalysisQuery", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "options": { + "type": "Options", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputConfig": { + "type": "IamPolicyAnalysisOutputConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "Options": { + "fields": { + "expandGroups": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "expandRoles": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "expandResources": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputResourceEdges": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputGroupEdges": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "analyzeServiceAccountImpersonation": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "ExportIamPolicyAnalysisResponse": { + "fields": { + "outputConfig": { + "type": "IamPolicyAnalysisOutputConfig", + "id": 1 + } + } + }, + "IamPolicyAnalysisResult": { + "fields": { + "attachedResourceFullName": { + "type": "string", + "id": 1 + }, + "iamBinding": { + "type": "google.iam.v1.Binding", + "id": 2 + }, + "accessControlLists": { + "rule": "repeated", + "type": "AccessControlList", + "id": 3 + }, + "identityList": { + "type": "IdentityList", + "id": 4 + }, + "fullyExplored": { + "type": "bool", + "id": 5 + } + }, + "nested": { + "AnalysisState": { + "fields": { + "code": { + "type": "google.rpc.Code", + "id": 1 + }, + "cause": { + "type": "string", + "id": 2 + } + } + }, + "Resource": { + "fields": { + "fullResourceName": { + "type": "string", + "id": 1 + }, + "analysisState": { + "type": "AnalysisState", + "id": 2 + } + } + }, + "Access": { + "oneofs": { + "oneofAccess": { + "oneof": [ + "role", + "permission" + ] + } + }, + "fields": { + "role": { + "type": "string", + "id": 1 + }, + "permission": { + "type": "string", + "id": 2 + }, + "analysisState": { + "type": "AnalysisState", + "id": 3 + } + } + }, + "Edge": { + "fields": { + "sourceNode": { + "type": "string", + "id": 1 + }, + "targetNode": { + "type": "string", + "id": 2 + } + } + }, + "Identity": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "analysisState": { + "type": "AnalysisState", + "id": 2 + } + } + }, + "AccessControlList": { + "fields": { + "resources": { + "rule": "repeated", + "type": "Resource", + "id": 1 + }, + "accesses": { + "rule": "repeated", + "type": "Access", + "id": 2 + }, + "resourceEdges": { + "rule": "repeated", + "type": "Edge", + "id": 3 + } + } + }, + "IdentityList": { + "fields": { + "identities": { + "rule": "repeated", + "type": "Identity", + "id": 1 + }, + "groupEdges": { + "rule": "repeated", + "type": "Edge", + "id": 2 + } + } + } + } + } + } } } } @@ -2757,9 +3226,9 @@ }, "rpc": { "options": { - "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "go_package": "google.golang.org/genproto/googleapis/rpc/code;code", "java_multiple_files": true, - "java_outer_classname": "StatusProto", + "java_outer_classname": "CodeProto", "java_package": "com.google.rpc", "objc_class_prefix": "RPC" }, @@ -2780,6 +3249,27 @@ "id": 3 } } + }, + "Code": { + "values": { + "OK": 0, + "CANCELLED": 1, + "UNKNOWN": 2, + "INVALID_ARGUMENT": 3, + "DEADLINE_EXCEEDED": 4, + "NOT_FOUND": 5, + "ALREADY_EXISTS": 6, + "PERMISSION_DENIED": 7, + "UNAUTHENTICATED": 16, + "RESOURCE_EXHAUSTED": 8, + "FAILED_PRECONDITION": 9, + "ABORTED": 10, + "OUT_OF_RANGE": 11, + "UNIMPLEMENTED": 12, + "INTERNAL": 13, + "UNAVAILABLE": 14, + "DATA_LOSS": 15 + } } } } diff --git a/packages/google-cloud-asset/src/index.ts b/packages/google-cloud-asset/src/index.ts index 7f0992d1036..d10510bfa80 100644 --- a/packages/google-cloud-asset/src/index.ts +++ b/packages/google-cloud-asset/src/index.ts @@ -20,10 +20,18 @@ import * as v1 from './v1'; import * as v1beta1 from './v1beta1'; import * as v1p1beta1 from './v1p1beta1'; import * as v1p2beta1 from './v1p2beta1'; +import * as v1p4beta1 from './v1p4beta1'; const AssetServiceClient = v1.AssetServiceClient; -export {v1, v1beta1, v1p1beta1, v1p2beta1, AssetServiceClient}; +export {v1, v1beta1, v1p1beta1, v1p4beta1, v1p2beta1, AssetServiceClient}; // For compatibility with JavaScript libraries we need to provide this default export: // tslint:disable-next-line no-default-export -export default {v1, v1beta1, v1p1beta1, v1p2beta1, AssetServiceClient}; +export default { + v1, + v1beta1, + v1p1beta1, + v1p2beta1, + v1p4beta1, + AssetServiceClient, +}; import * as protos from '../protos/protos'; export {protos}; diff --git a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts new file mode 100644 index 00000000000..18be1e8c02b --- /dev/null +++ b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client.ts @@ -0,0 +1,511 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as gax from 'google-gax'; +import { + APICallback, + Callback, + CallOptions, + Descriptors, + ClientOptions, + LROperation, +} from 'google-gax'; +import * as path from 'path'; + +import * as protosTypes from '../../protos/protos'; +import * as gapicConfig from './asset_service_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Asset service definition. + * @class + * @memberof v1p4beta1 + */ +export class AssetServiceClient { + private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _innerApiCalls: {[name: string]: Function}; + private _terminated = false; + private _opts: ClientOptions; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + operationsClient: gax.OperationsClient; + assetServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AssetServiceClient. + * + * @param {object} [options] - The configuration object. See the subsequent + * parameters for more details. + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + */ + + constructor(opts?: ClientOptions) { + // Ensure that options include the service address and port. + const staticMembers = this.constructor as typeof AssetServiceClient; + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; + const port = opts && opts.port ? opts.port : staticMembers.port; + + if (!opts) { + opts = {servicePath, port}; + } + opts.servicePath = opts.servicePath || servicePath; + opts.port = opts.port || port; + opts.clientConfig = opts.clientConfig || {}; + + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { + opts.fallback = true; + } + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = (this.constructor as typeof AssetServiceClient).scopes; + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + this._protos = this._gaxGrpc.loadProto( + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + ); + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const protoFilesRoot = opts.fallback + ? this._gaxModule.protobuf.Root.fromJSON( + require('../../protos/protos.json') + ) + : this._gaxModule.protobuf.loadSync(nodejsProtoPath); + + this.operationsClient = this._gaxModule + .lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }) + .operationsClient(opts); + const exportIamPolicyAnalysisResponse = protoFilesRoot.lookup( + '.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse' + ) as gax.protobuf.Type; + const exportIamPolicyAnalysisMetadata = protoFilesRoot.lookup( + '.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest' + ) as gax.protobuf.Type; + + this._descriptors.longrunning = { + exportIamPolicyAnalysis: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + exportIamPolicyAnalysisResponse.decode.bind( + exportIamPolicyAnalysisResponse + ), + exportIamPolicyAnalysisMetadata.decode.bind( + exportIamPolicyAnalysisMetadata + ) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.asset.v1p4beta1.AssetService', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this._innerApiCalls = {}; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.assetServiceStub) { + return this.assetServiceStub; + } + + // Put together the "service stub" for + // google.cloud.asset.v1p4beta1.AssetService. + this.assetServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.asset.v1p4beta1.AssetService' + ) + : // tslint:disable-next-line no-any + (this._protos as any).google.cloud.asset.v1p4beta1.AssetService, + this._opts + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const assetServiceStubMethods = [ + 'analyzeIamPolicy', + 'exportIamPolicyAnalysis', + ]; + + for (const methodName of assetServiceStubMethods) { + const innerCallPromise = this.assetServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + return stub[methodName].apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const apiCall = this._gaxModule.createApiCall( + innerCallPromise, + this._defaults[methodName], + this._descriptors.page[methodName] || + this._descriptors.stream[methodName] || + this._descriptors.longrunning[methodName] + ); + + this._innerApiCalls[methodName] = ( + argument: {}, + callOptions?: CallOptions, + callback?: APICallback + ) => { + return apiCall(argument, callOptions, callback); + }; + } + + return this.assetServiceStub; + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'cloudasset.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'cloudasset.googleapis.com'; + } + + /** + * The port for this API service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @param {function(Error, string)} callback - the callback to + * be called with the current project Id. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + analyzeIamPolicy( + request: protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse, + ( + | protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest + | undefined + ), + {} | undefined + ] + >; + analyzeIamPolicy( + request: protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse, + | protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest + | undefined, + {} | undefined + > + ): void; + /** + * Analyzes IAM policies based on the specified request. Returns + * a list of {@link google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult|IamPolicyAnalysisResult} matching the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery} request.analysisQuery + * Required. The request query. + * @param {google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options} [request.options] + * Optional. The request options. + * @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 [AnalyzeIamPolicyResponse]{@link google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + analyzeIamPolicy( + request: protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse, + | protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse, + | protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse, + ( + | protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'analysis_query.parent': request.analysisQuery!.parent || '', + }); + this.initialize(); + return this._innerApiCalls.analyzeIamPolicy(request, options, callback); + } + + exportIamPolicyAnalysis( + request: protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse, + protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + exportIamPolicyAnalysis( + request: protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse, + protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): void; + /** + * Exports IAM policy analysis based on the specified request. This API + * implements the {@link google.longrunning.Operation|google.longrunning.Operation} API allowing you to keep + * track of the export. The metadata contains the request to help callers to + * map responses to requests. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery} request.analysisQuery + * Required. The request query. + * @param {google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options} [request.options] + * Optional. The request options. + * @param {google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig} request.outputConfig + * 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. + * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + exportIamPolicyAnalysis( + request: protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse, + protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + >, + callback?: Callback< + LROperation< + protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse, + protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): Promise< + [ + LROperation< + protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse, + protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'analysis_query.parent': request.analysisQuery!.parent || '', + }); + this.initialize(); + return this._innerApiCalls.exportIamPolicyAnalysis( + request, + options, + callback + ); + } + + /** + * Terminate the GRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + */ + close(): Promise { + this.initialize(); + if (!this._terminated) { + return this.assetServiceStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-asset/src/v1p4beta1/asset_service_client_config.json b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client_config.json new file mode 100644 index 00000000000..9f0c6639043 --- /dev/null +++ b/packages/google-cloud-asset/src/v1p4beta1/asset_service_client_config.json @@ -0,0 +1,39 @@ +{ + "interfaces": { + "google.cloud.asset.v1p4beta1.AssetService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "AnalyzeIamPolicy": { + "timeout_millis": 300000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ExportIamPolicyAnalysis": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-asset/src/v1p4beta1/asset_service_proto_list.json b/packages/google-cloud-asset/src/v1p4beta1/asset_service_proto_list.json new file mode 100644 index 00000000000..081fb125b33 --- /dev/null +++ b/packages/google-cloud-asset/src/v1p4beta1/asset_service_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/cloud/asset/v1p4beta1/asset_service.proto", + "../../protos/google/cloud/asset/v1p4beta1/assets.proto" +] diff --git a/packages/google-cloud-asset/src/v1p4beta1/index.ts b/packages/google-cloud-asset/src/v1p4beta1/index.ts new file mode 100644 index 00000000000..6890c43379a --- /dev/null +++ b/packages/google-cloud-asset/src/v1p4beta1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {AssetServiceClient} from './asset_service_client'; diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 93e6a24b347..dde248d4b06 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,13 +1,12 @@ { - "updateTime": "2020-03-05T23:01:19.178450Z", + "updateTime": "2020-03-17T01:42:52.620638Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "f0b581b5bdf803e45201ecdb3688b60e381628a8", - "internalRef": "299181282", - "log": "f0b581b5bdf803e45201ecdb3688b60e381628a8\nfix: recommendationengine/v1beta1 update some comments\n\nPiperOrigin-RevId: 299181282\n\n10e9a0a833dc85ff8f05b2c67ebe5ac785fe04ff\nbuild: add generated BUILD file for Routes Preferred API\n\nPiperOrigin-RevId: 299164808\n\n86738c956a8238d7c77f729be78b0ed887a6c913\npublish v1p1beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299152383\n\n73d9f2ad4591de45c2e1f352bc99d70cbd2a6d95\npublish v1: update with absolute address in comments\n\nPiperOrigin-RevId: 299147194\n\nd2158f24cb77b0b0ccfe68af784c6a628705e3c6\npublish v1beta2: update with absolute address in comments\n\nPiperOrigin-RevId: 299147086\n\n7fca61292c11b4cd5b352cee1a50bf88819dd63b\npublish v1p2beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299146903\n\n583b7321624736e2c490e328f4b1957335779295\npublish v1p3beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299146674\n\n638253bf86d1ce1c314108a089b7351440c2f0bf\nfix: add java_multiple_files option for automl text_sentiment.proto\n\nPiperOrigin-RevId: 298971070\n\n373d655703bf914fb8b0b1cc4071d772bac0e0d1\nUpdate Recs AI Beta public bazel file\n\nPiperOrigin-RevId: 298961623\n\ndcc5d00fc8a8d8b56f16194d7c682027b2c66a3b\nfix: add java_multiple_files option for automl classification.proto\n\nPiperOrigin-RevId: 298953301\n\na3f791827266f3496a6a5201d58adc4bb265c2a3\nchore: automl/v1 publish annotations and retry config\n\nPiperOrigin-RevId: 298942178\n\n01c681586d8d6dbd60155289b587aee678530bd9\nMark return_immediately in PullRequest deprecated.\n\nPiperOrigin-RevId: 298893281\n\nc9f5e9c4bfed54bbd09227e990e7bded5f90f31c\nRemove out of date documentation for predicate support on the Storage API\n\nPiperOrigin-RevId: 298883309\n\nfd5b3b8238d783b04692a113ffe07c0363f5de0f\ngenerate webrisk v1 proto\n\nPiperOrigin-RevId: 298847934\n\n541b1ded4abadcc38e8178680b0677f65594ea6f\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 298686266\n\nc0d171acecb4f5b0bfd2c4ca34fc54716574e300\n Updated to include the Notification v1 API.\n\nPiperOrigin-RevId: 298652775\n\n2346a9186c0bff2c9cc439f2459d558068637e05\nAdd Service Directory v1beta1 protos and configs\n\nPiperOrigin-RevId: 298625638\n\na78ed801b82a5c6d9c5368e24b1412212e541bb7\nPublishing v3 protos and configs.\n\nPiperOrigin-RevId: 298607357\n\n4a180bfff8a21645b3a935c2756e8d6ab18a74e0\nautoml/v1beta1 publish proto updates\n\nPiperOrigin-RevId: 298484782\n\n6de6e938b7df1cd62396563a067334abeedb9676\nchore: use the latest gapic-generator and protoc-java-resource-name-plugin in Bazel workspace.\n\nPiperOrigin-RevId: 298474513\n\n244ab2b83a82076a1fa7be63b7e0671af73f5c02\nAdds service config definition for bigqueryreservation v1\n\nPiperOrigin-RevId: 298455048\n\n" + "sha": "1976b9981e2900c8172b7d34b4220bdb18c5db42", + "internalRef": "301205325" } }, { @@ -54,6 +53,15 @@ "language": "typescript", "generator": "gapic-generator-typescript" } + }, + { + "client": { + "source": "googleapis", + "apiName": "asset", + "apiVersion": "v1p4beta1", + "language": "typescript", + "generator": "gapic-generator-typescript" + } } ] } \ No newline at end of file diff --git a/packages/google-cloud-asset/synth.py b/packages/google-cloud-asset/synth.py index aaeb2aa1df8..0cafdb0d148 100644 --- a/packages/google-cloud-asset/synth.py +++ b/packages/google-cloud-asset/synth.py @@ -21,7 +21,7 @@ logging.basicConfig(level=logging.DEBUG) gapic = gcp.GAPICMicrogenerator() -versions = ['v1beta1', 'v1', 'v1p1beta1', 'v1p2beta1'] +versions = ['v1beta1', 'v1', 'v1p1beta1', 'v1p2beta1', 'v1p4beta1'] name = 'asset' for version in versions: library = gapic.typescript_library( diff --git a/packages/google-cloud-asset/test/gapic-asset_service-v1p4beta1.ts b/packages/google-cloud-asset/test/gapic-asset_service-v1p4beta1.ts new file mode 100644 index 00000000000..9a8ce3c619e --- /dev/null +++ b/packages/google-cloud-asset/test/gapic-asset_service-v1p4beta1.ts @@ -0,0 +1,246 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protosTypes from '../protos/protos'; +import * as assert from 'assert'; +import {describe, it} from 'mocha'; +const assetserviceModule = require('../src'); + +const FAKE_STATUS_CODE = 1; +class FakeError { + name: string; + message: string; + code: number; + constructor(n: number) { + this.name = 'fakeName'; + this.message = 'fake message'; + this.code = n; + } +} +const error = new FakeError(FAKE_STATUS_CODE); +export interface Callback { + (err: FakeError | null, response?: {} | null): void; +} + +export class Operation { + constructor() {} + promise() {} +} +function mockSimpleGrpcMethod( + expectedRequest: {}, + response: {} | null, + error: FakeError | null +) { + return (actualRequest: {}, options: {}, callback: Callback) => { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} +function mockLongRunningGrpcMethod( + expectedRequest: {}, + response: {} | null, + error?: {} | null +) { + return (request: {}) => { + assert.deepStrictEqual(request, expectedRequest); + const mockOperation = { + promise() { + return new Promise((resolve, reject) => { + if (error) { + reject(error); + } else { + resolve([response]); + } + }); + }, + }; + return Promise.resolve([mockOperation]); + }; +} +describe('v1p4beta1.AssetServiceClient', () => { + it('has servicePath', () => { + const servicePath = + assetserviceModule.v1p4beta1.AssetServiceClient.servicePath; + assert(servicePath); + }); + it('has apiEndpoint', () => { + const apiEndpoint = + assetserviceModule.v1p4beta1.AssetServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + it('has port', () => { + const port = assetserviceModule.v1p4beta1.AssetServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + it('should create a client with no option', () => { + const client = new assetserviceModule.v1p4beta1.AssetServiceClient(); + assert(client); + }); + it('should create a client with gRPC fallback', () => { + const client = new assetserviceModule.v1p4beta1.AssetServiceClient({ + fallback: true, + }); + assert(client); + }); + it('has initialize method and supports deferred initialization', async () => { + const client = new assetserviceModule.v1p4beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.assetServiceStub, undefined); + await client.initialize(); + assert(client.assetServiceStub); + }); + it('has close method', () => { + const client = new assetserviceModule.v1p4beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + describe('analyzeIamPolicy', () => { + it('invokes analyzeIamPolicy without error', done => { + const client = new assetserviceModule.v1p4beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest = {}; + request.analysisQuery = {}; + request.analysisQuery.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.analyzeIamPolicy = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.analyzeIamPolicy(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes analyzeIamPolicy with error', done => { + const client = new assetserviceModule.v1p4beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest = {}; + request.analysisQuery = {}; + request.analysisQuery.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.analyzeIamPolicy = mockSimpleGrpcMethod( + request, + null, + error + ); + client.analyzeIamPolicy(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('exportIamPolicyAnalysis', () => { + it('invokes exportIamPolicyAnalysis without error', done => { + const client = new assetserviceModule.v1p4beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest = {}; + request.analysisQuery = {}; + request.analysisQuery.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.exportIamPolicyAnalysis = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + client + .exportIamPolicyAnalysis(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then((responses: [Operation]) => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch((err: {}) => { + done(err); + }); + }); + + it('invokes exportIamPolicyAnalysis with error', done => { + const client = new assetserviceModule.v1p4beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest = {}; + request.analysisQuery = {}; + request.analysisQuery.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.exportIamPolicyAnalysis = mockLongRunningGrpcMethod( + request, + null, + error + ); + client + .exportIamPolicyAnalysis(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then(() => { + assert.fail(); + }) + .catch((err: FakeError) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + }); +});